Skip to contentSkip to conversation

tests/amd_dispatch: add negative test

PATCH New Jesse Zhang 2 participants 3 messages Oct 11, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/amd_dispatch: add negative test

Dispatch a bad program on gfx/compute ring.
Check wether they will hang.
Expose the additional parameter 'hung' to the upper layer. Dispatch existent a binary shader that waits for the register to be changed, but it does not occur and as a result, we have GPU reset and check this.

V3:
-add detail description and fix code style(Kamil) -Improve test description(Vitaly)

Cc Vitaly Prosyak <[email protected]>
Cc Luben Tuikov <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian Koenig <[email protected]>
Cc Kamil Konieczny <[email protected]>
---
 lib/amdgpu/amd_dispatch.c   |  4 ++--
 lib/amdgpu/amd_dispatch.h   |  2 +-
 tests/amdgpu/amd_dispatch.c | 38 ++++++++++++++++++++++++++++++++-----
 3 files changed, 36 insertions(+), 8 deletions(-)
lib/amdgpu/amd_dispatch.c +2 -2
index 9de3986ba..040381a11 100644
@@ -524,7 +524,7 @@ amdgpu_dispatch_hang_slow_helper(amdgpu_device_handle device_handle,
 	}
 }
 
-void amdgpu_gfx_dispatch_test(amdgpu_device_handle device_handle, uint32_t ip_type)
+void amdgpu_gfx_dispatch_test(amdgpu_device_handle device_handle, uint32_t ip_type, int hang)
 {
 	int r;
 	struct drm_amdgpu_info_hw_ip info;
@@ -547,7 +547,7 @@ void amdgpu_gfx_dispatch_test(amdgpu_device_handle device_handle, uint32_t ip_ty
 		amdgpu_memset_dispatch_test(device_handle, ip_type, ring_id,
 					    version);
 		amdgpu_memcpy_dispatch_test(device_handle, ip_type, ring_id,
-					    version, 0);
+					    version, hang);
 	}
 }
 
lib/amdgpu/amd_dispatch.h +1 -1
index c500b5b3f..4df8b1355 100644
@@ -27,7 +27,7 @@
 #include <amdgpu.h>
 
 void amdgpu_gfx_dispatch_test(amdgpu_device_handle device_handle,
-			      uint32_t ip_type);
+			      uint32_t ip_type, int hang);
 
 void amdgpu_memcpy_dispatch_test(amdgpu_device_handle device_handle,
 					uint32_t ip_type,
tests/amdgpu/amd_dispatch.c +33 -5
index 769f26cd0..323284306 100644
@@ -24,6 +24,18 @@ amdgpu_dispatch_hang_slow_compute(amdgpu_device_handle device_handle)
 	amdgpu_dispatch_hang_slow_helper(device_handle, AMDGPU_HW_IP_COMPUTE);
 }
 
+static void
+amdgpu_dispatch_hang_gfx(amdgpu_device_handle device_handle)
+{
+	amdgpu_gfx_dispatch_test(device_handle, AMDGPU_HW_IP_GFX, 1);
+}
+
+static void
+amdgpu_dispatch_hang_compute(amdgpu_device_handle device_handle)
+{
+	amdgpu_gfx_dispatch_test(device_handle, AMDGPU_HW_IP_COMPUTE, 1);
+}
+
 static void
 amdgpu_gpu_reset_test(amdgpu_device_handle device_handle, int drm_amdgpu)
 {
@@ -54,8 +66,8 @@ amdgpu_gpu_reset_test(amdgpu_device_handle device_handle, int drm_amdgpu)
 	r = amdgpu_cs_ctx_free(context_handle);
 	igt_assert_eq(r, 0);
 
-	amdgpu_gfx_dispatch_test(device_handle, AMDGPU_HW_IP_GFX);
-	amdgpu_gfx_dispatch_test(device_handle, AMDGPU_HW_IP_COMPUTE);
+	amdgpu_gfx_dispatch_test(device_handle, AMDGPU_HW_IP_GFX, 0);
+	amdgpu_gfx_dispatch_test(device_handle, AMDGPU_HW_IP_COMPUTE, 0);
 }
 
 igt_main
@@ -85,7 +97,7 @@ igt_main
 		asic_rings_readness(device, 1, arr_cap);
 
 	}
-	igt_describe("Test-GPU-reset-using-a-binary-shader-to-hang-the-job-on-compute-ring");
+	igt_describe("Test GPU reset using a binary shader to slow hang the job on compute ring");
 	igt_subtest_with_dynamic("amdgpu-dispatch-test-compute-with-IP-COMPUTE") {
 		if (arr_cap[AMD_IP_COMPUTE]) {
 			igt_dynamic_f("amdgpu-dispatch-test-compute")
@@ -93,7 +105,7 @@ igt_main
 		}
 	}
 
-	igt_describe("Test-GPU-reset-using-a-binary-shader-to-hang-the-job-on-gfx-ring");
+	igt_describe("Test GPU reset using a binary shader to slow hang the job on gfx ring");
 	igt_subtest_with_dynamic("amdgpu-dispatch-test-gfx-with-IP-GFX") {
 		if (arr_cap[AMD_IP_GFX]) {
 			igt_dynamic_f("amdgpu-dispatch-test-gfx")
@@ -101,7 +113,23 @@ igt_main
 		}
 	}
 
-	igt_describe("Test-GPU-reset-using-amdgpu-debugfs-to-hang-the-job-on-gfx-ring");
+	igt_describe("Test GPU reset using a binary shader to hang the job on gfx ring");
+	igt_subtest_with_dynamic("amdgpu-dispatch-hang-test-gfx-with-IP-GFX") {
+		if (arr_cap[AMD_IP_GFX]) {
+			igt_dynamic_f("amdgpu-dispatch-hang-test-gfx")
+			amdgpu_dispatch_hang_gfx(device);
+		}
+	}
+
+	igt_describe("Test GPU reset using a binary shader to hang the job on compute ring");
+	igt_subtest_with_dynamic("amdgpu-dispatch-hang-test-compute-with-IP-COMPUTE") {
+		if (arr_cap[AMD_IP_COMPUTE]) {
+			igt_dynamic_f("amdgpu-dispatch-hang-test-compute")
+			amdgpu_dispatch_hang_compute(device);
+		}
+	}
+
+	igt_describe("Test GPU reset using amdgpu debugfs to hang the job on gfx ring");
 	igt_subtest_with_dynamic("amdgpu-reset-test-gfx-with-IP-GFX-and-COMPUTE") {
 		if (arr_cap[AMD_IP_GFX] && arr_cap[AMD_IP_COMPUTE]) {
 			igt_dynamic_f("amdgpu-reset-gfx-compute")
Signature · 1 line
2.25.1
#1 lore raw

[igt-dev] ✓ CI.xeBAT: success for tests/amd_dispatch: add negative test (rev3)

== Series Details ==

== Series Details ==

Series: tests/amd_dispatch: add negative test (rev3)
URL : https://patchwork.freedesktop.org/series/124802/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_7527_BAT -> XEIGTPW_9967_BAT
====================================================

Summary
-------

**SUCCESS**

No regressions found.

Participating hosts (4 -> 4)
------------------------------

No changes in participating hosts

Known issues
------------

Here are the changes found in XEIGTPW_9967_BAT that come from known issues:

### IGT changes ###

#### Possible fixes ####

* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- bat-adlp-7: [FAIL][1] ([Intel XE#480]) -> [PASS][2] +1 other test pass
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7527/bat-adlp-7/igt@kms_flip@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9967/bat-adlp-7/igt@kms_flip@[email protected]

* {igt@xe_create@create-execqueues-noleak}:
- bat-adlp-7: [FAIL][3] ([Intel XE#524]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7527/bat-adlp-7/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9967/bat-adlp-7/igt@[email protected]
- bat-pvc-2: [FAIL][5] -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7527/bat-pvc-2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9967/bat-pvc-2/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
[Intel XE#524]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/524

Build changes
-------------

* IGT: IGT_7527 -> IGTPW_9967

IGTPW_9967: 9967
IGT_7527: 46f98a3041f73a1d6ee7ec3ace6eba79b15369c4 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-423-37b2d042c23ae6a10055ea92101a15083d64c718: 37b2d042c23ae6a10055ea92101a15083d64c718

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9967/index.html

#2 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for tests/amd_dispatch: add negative test (rev3)

In reply to Jesse Zhang
== Series Details ==

== Series Details ==

Series: tests/amd_dispatch: add negative test (rev3)
URL : https://patchwork.freedesktop.org/series/124802/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13737 -> IGTPW_9967
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_9967 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_9967, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/index.html

Participating hosts (37 -> 38)
------------------------------

Additional (1): bat-dg2-8

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_9967:

### IGT changes ###

#### Possible regressions ####

* igt@kms_flip@basic-flip-vs-dpms@a-dp1:
- bat-dg2-8: NOTRUN -> [FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@kms_flip@[email protected]

Known issues
------------

Here are the changes found in IGTPW_9967 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_mmap@basic:
- bat-dg2-8: NOTRUN -> [SKIP][2] ([i915#4083])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@gem_mmap_gtt@basic:
- bat-dg2-8: NOTRUN -> [SKIP][3] ([i915#4077]) +2 other tests skip
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@gem_tiled_pread_basic:
- bat-dg2-8: NOTRUN -> [SKIP][4] ([i915#4079]) +1 other test skip
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@gem_tiled_pread_basic.html

* igt@i915_pm_rps@basic-api:
- bat-dg2-8: NOTRUN -> [SKIP][5] ([i915#6621])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [PASS][6] -> [DMESG-FAIL][7] ([i915#5334])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13737/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html

* igt@i915_suspend@basic-s3-without-i915:
- bat-dg2-8: NOTRUN -> [SKIP][8] ([i915#6645])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
- bat-dg2-8: NOTRUN -> [SKIP][9] ([i915#5190])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_addfb_basic@basic-y-tiled-legacy:
- bat-dg2-8: NOTRUN -> [SKIP][10] ([i915#4215] / [i915#5190])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_addfb_basic@framebuffer-vs-set-tiling:
- bat-dg2-8: NOTRUN -> [SKIP][11] ([i915#4212]) +6 other tests skip
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_addfb_basic@tile-pitch-mismatch:
- bat-dg2-8: NOTRUN -> [SKIP][12] ([i915#4212] / [i915#5608])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- bat-dg2-8: NOTRUN -> [SKIP][13] ([i915#4103] / [i915#4213] / [i915#5608]) +1 other test skip
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_flip@basic-flip-vs-modeset@a-dp1:
- bat-dg2-8: NOTRUN -> [FAIL][14] ([i915#4190])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@kms_flip@[email protected]

* igt@kms_flip@basic-flip-vs-modeset@d-dp1:
- bat-dg2-8: NOTRUN -> [FAIL][15] ([i915#6121]) +8 other tests fail
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@kms_flip@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- bat-dg2-8: NOTRUN -> [SKIP][16] ([fdo#109285])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_force_connector_basic@prune-stale-modes:
- bat-dg2-8: NOTRUN -> [SKIP][17] ([i915#5274])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-c-dp-1:
- bat-dg2-8: NOTRUN -> [DMESG-WARN][18] ([i915#8585]) +19 other tests dmesg-warn
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@kms_pipe_crc_basic@[email protected]

* igt@kms_psr@cursor_plane_move:
- bat-dg2-8: NOTRUN -> [SKIP][19] ([i915#1072]) +3 other tests skip
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@kms_psr@cursor_plane_move.html

* igt@kms_setmode@basic-clone-single-crtc:
- bat-dg2-8: NOTRUN -> [SKIP][20] ([i915#3555] / [i915#4098])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@prime_vgem@basic-fence-flip:
- bat-dg2-8: NOTRUN -> [SKIP][21] ([i915#3708])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@prime_vgem@basic-fence-mmap:
- bat-dg2-8: NOTRUN -> [SKIP][22] ([i915#3708] / [i915#4077]) +1 other test skip
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

* igt@prime_vgem@basic-write:
- bat-dg2-8: NOTRUN -> [SKIP][23] ([i915#3291] / [i915#3708]) +2 other tests skip
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-8/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s0@lmem0:
- bat-dg2-9: [INCOMPLETE][24] ([i915#9275]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13737/bat-dg2-9/igt@gem_exec_suspend@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/bat-dg2-9/igt@gem_exec_suspend@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4190]: https://gitlab.freedesktop.org/drm/intel/issues/4190
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5608]: https://gitlab.freedesktop.org/drm/intel/issues/5608
[i915#6121]: https://gitlab.freedesktop.org/drm/intel/issues/6121
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6645]: https://gitlab.freedesktop.org/drm/intel/issues/6645
[i915#8585]: https://gitlab.freedesktop.org/drm/intel/issues/8585
[i915#9275]: https://gitlab.freedesktop.org/drm/intel/issues/9275

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_7527 -> IGTPW_9967

CI-20190529: 20190529
CI_DRM_13737: c768959add20d28639e5bfa4cea2544aab51879e @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_9967: 9967
IGT_7527: 46f98a3041f73a1d6ee7ec3ace6eba79b15369c4 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9967/index.html