From 209f08f39d64c918bd62309df49c5993ac83ff08 Mon Sep 17 00:00:00 2001 From: Maciej Bielski Date: Wed, 22 Jan 2025 17:29:28 +0100 Subject: [PATCH] fix: do not access UMD-managed SVM-allocation while in-use 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 --- .../core/test_copy/src/test_copy_events.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/conformance_tests/core/test_copy/src/test_copy_events.cpp b/conformance_tests/core/test_copy/src/test_copy_events.cpp index 6075f7f2..1bb05907 100644 --- a/conformance_tests/core/test_copy/src/test_copy_events.cpp +++ b/conformance_tests/core/test_copy/src/test_copy_events.cpp @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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));