Skip to content

Commit

Permalink
fix: do not access UMD-managed SVM-allocation while in-use
Browse files Browse the repository at this point in the history
It is illegal with UMD-managed migrations to access a SVM-allocation
from CPU side while it is still in-use on GPU side. In such scenario
a CPU-side access triggers data fetch from GPU-side and then any
subsequent GPU-side modification will not be observable on the CPU-side.
With UMD-managed migrations there is no way to tell the GPU that it
should fetch the allocation again from CPU-side before modifying it.

The removed `EXPECT_NE` statements are not mandatory for the goals of
the tests while their side-effects make things worse.

Signed-off-by: Maciej Bielski <[email protected]>
  • Loading branch information
MaciejBielski committed Jan 22, 2025
1 parent d6f60a2 commit 209f08f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions conformance_tests/core/test_copy/src/test_copy_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ void RunGivenMemoryCopiesWithDependenciesWhenExecutingCommandListTest(
// Verify Copy Waits for Signal
lzt::event_host_synchronize(test.hEvent, UINT64_MAX);
EXPECT_EQ(ZE_RESULT_NOT_READY, zeEventQueryStatus(hEvent1));
EXPECT_NE(0, memcmp(src_buffer, dst_buffer, test.size));

EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(hEvent1));

Expand Down Expand Up @@ -288,11 +287,9 @@ void RunGivenMemoryCopyThatWaitsOnEventWhenExecutingCommandListTest(
lzt::execute_command_lists(cmd_bundle.queue, 1, &cmd_bundle.list, nullptr);
}

// Verify Copy Waits for Signal
// This sleep simulates work (e.g. file i/o) on the host that would cause
// with a high probability the device to have to wait
std::this_thread::sleep_for(std::chrono::milliseconds(1));
EXPECT_NE(0, memcmp(src_buffer, dst_buffer, test.size));

EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(test.hEvent));

Expand Down Expand Up @@ -355,8 +352,6 @@ void RunGivenMemoryFillsThatSignalAndWaitWhenExecutingCommandListTest(

lzt::event_host_synchronize(test.hEvent, UINT64_MAX);
EXPECT_EQ(ZE_RESULT_NOT_READY, zeEventQueryStatus(hEvent1));
// Verify Device waits for Signal
EXPECT_NE(0, memcmp(ref_buffer, dst_buffer, test.size));

EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(hEvent1));

Expand Down Expand Up @@ -417,11 +412,9 @@ void RunGivenMemoryFillThatWaitsOnEventWhenExecutingCommandListTest(
lzt::execute_command_lists(cmd_bundle.queue, 1, &cmd_bundle.list, nullptr);
}

// Verify Device waits for Signal
// This sleep simulates work (e.g. file i/o) on the host that would cause
// with a high probability the device to have to wait
std::this_thread::sleep_for(std::chrono::milliseconds(1));
EXPECT_NE(0, memcmp(ref_buffer, dst_buffer, test.size));

EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(test.hEvent));

Expand Down Expand Up @@ -493,7 +486,6 @@ void RunGivenMemoryCopyRegionWithDependenciesWhenExecutingCommandListTest(
// Verify Copy Waits for Signal
lzt::event_host_synchronize(test.hEvent, UINT64_MAX);
EXPECT_EQ(ZE_RESULT_NOT_READY, zeEventQueryStatus(hEvent1));
EXPECT_NE(0, memcmp(src_buffer, dst_buffer, test.size));

// Signal Event On Host
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(hEvent1));
Expand Down Expand Up @@ -561,11 +553,9 @@ void RunGivenMemoryCopyRegionThatWaitsOnEventWhenExecutingCommandListTest(
lzt::execute_command_lists(cmd_bundle.queue, 1, &cmd_bundle.list, nullptr);
}

// Verify Copy Waits for Signal
// This sleep simulates work (e.g. file i/o) on the host that would cause
// with a high probability the device to have to wait
std::this_thread::sleep_for(std::chrono::milliseconds(1));
EXPECT_NE(0, memcmp(src_buffer, dst_buffer, test.size));

// Signal Event On Host
EXPECT_EQ(ZE_RESULT_SUCCESS, zeEventHostSignal(test.hEvent));
Expand Down

0 comments on commit 209f08f

Please sign in to comment.