Skip to content

[UR][L0] Fix issue with memadvise/prefetch in command buffers #19140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions unified-runtime/source/adapters/level_zero/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ ur_result_t createSyncPointAndGetZeEvents(
if (CommandBuffer->IsInOrderCmdList) {
UR_CALL(createSyncPointBetweenCopyAndCompute(CommandBuffer, ZeCommandList,
ZeEventList));
if (!ZeEventList.empty()) {
NumSyncPointsInWaitList = ZeEventList.size();
}
return UR_RESULT_SUCCESS;
}

Expand Down Expand Up @@ -1330,9 +1327,9 @@ ur_result_t urCommandBufferAppendUSMPrefetchExp(
CommandBuffer->ZeComputeCommandList, NumSyncPointsInWaitList,
SyncPointWaitList, true, RetSyncPoint, ZeEventList, ZeLaunchEvent));

if (NumSyncPointsInWaitList) {
if (!ZeEventList.empty()) {
ZE2UR_CALL(zeCommandListAppendWaitOnEvents,
(CommandBuffer->ZeComputeCommandList, NumSyncPointsInWaitList,
(CommandBuffer->ZeComputeCommandList, ZeEventList.size(),
ZeEventList.data()));
}

Expand Down Expand Up @@ -1394,9 +1391,9 @@ ur_result_t urCommandBufferAppendUSMAdviseExp(
NumSyncPointsInWaitList, SyncPointWaitList, true, RetSyncPoint,
ZeEventList, ZeLaunchEvent));

if (NumSyncPointsInWaitList) {
if (!ZeEventList.empty()) {
ZE2UR_CALL(zeCommandListAppendWaitOnEvents,
(CommandBuffer->ZeComputeCommandList, NumSyncPointsInWaitList,
(CommandBuffer->ZeComputeCommandList, ZeEventList.size(),
ZeEventList.data()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ struct urInOrderCommandBufferExpTest
virtual void SetUp() override {
UUR_RETURN_ON_FATAL_FAILURE(urCommandBufferExpExecutionTest::SetUp());

// Level-Zero bug https://github.com/intel/llvm/issues/18544
// Re-enable these tests once fixed
UUR_KNOWN_FAILURE_ON(uur::LevelZero{});

ur_exp_command_buffer_desc_t desc{
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC, // stype
nullptr, // pnext
Expand Down