[igt-dev] [PATCH 5/9] tests/amdgpu: add GPU reset tests for gfx, compute and sdma.
vitaly.prosyak at amd.com
vitaly.prosyak at amd.com
Fri Nov 11 21:52:09 UTC 2022
From: Vitaly Prosyak <vitaly.prosyak at amd.com>
Use the shared amdgpu_wait_memory_helper.
The GPU reset is occurred due to the wait for the register
in memory to be changed is not executed on time.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak at amd.com>
Reviewed-by: Pierre-eric Pelloux-prayer <Pierre-eric.Pelloux-prayer at amd.com>
---
tests/amdgpu/amd_deadlock.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/tests/amdgpu/amd_deadlock.c b/tests/amdgpu/amd_deadlock.c
index 109aaac18..d4de20114 100644
--- a/tests/amdgpu/amd_deadlock.c
+++ b/tests/amdgpu/amd_deadlock.c
@@ -26,6 +26,7 @@
#include "lib/amdgpu/amd_memory.h"
#include "lib/amdgpu/amd_command_submission.h"
#include "lib/amdgpu/amd_dispatch.h"
+#include "lib/amdgpu/amd_deadlock_helpers.h"
static void
amdgpu_dispatch_hang_slow_gfx(amdgpu_device_handle device_handle)
@@ -39,6 +40,24 @@ amdgpu_dispatch_hang_slow_compute(amdgpu_device_handle device_handle)
amdgpu_dispatch_hang_slow_helper(device_handle, AMDGPU_HW_IP_COMPUTE);
}
+static void
+amdgpu_deadlock_gfx(amdgpu_device_handle device_handle)
+{
+ amdgpu_wait_memory_helper(device_handle, AMDGPU_HW_IP_GFX);
+}
+
+static void
+amdgpu_deadlock_compute(amdgpu_device_handle device_handle)
+{
+ amdgpu_wait_memory_helper(device_handle, AMDGPU_HW_IP_COMPUTE);
+}
+
+static void
+amdgpu_deadlock_sdma(amdgpu_device_handle device_handle)
+{
+ amdgpu_wait_memory_helper(device_handle, AMDGPU_HW_IP_DMA);
+}
+
igt_main
{
amdgpu_device_handle device;
@@ -64,6 +83,14 @@ igt_main
igt_assert_eq(r, 0);
}
+ igt_subtest("amdgpu_deadlock_sdma")
+ amdgpu_deadlock_sdma(device);
+
+ igt_subtest("amdgpu_deadlock_gfx")
+ amdgpu_deadlock_gfx(device);
+
+ igt_subtest("amdgpu_deadlock_compute")
+ amdgpu_deadlock_compute(device);
igt_subtest("dispatch_hang_slow_compute")
amdgpu_dispatch_hang_slow_compute(device);
--
2.25.1
More information about the igt-dev
mailing list