Skip to contentSkip to conversation

lib/amdgpu: enable compute scratch two-hop test on gfx12

PATCH New Jesse Zhang 2 participants 2 messages Jul 14

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/amdgpu: enable compute scratch two-hop test on gfx12

The kfdtest-style FlatScratchAccess two-hop scratch dispatch was gated to gfx11 only, so amdgpu-scratch-test-compute-with-IP-COMPUTE-UQM ran empty (vacuous SUCCESS) on gfx12. The shader (ScratchCopyDwordIsa) and the PM4 emitter already program the gfx12 scratch path (COMPUTE_DISPATCH_SCRATCH_BASE HW-loads the read-only SCRATCH_BASE; shader uses s_setreg HW_REG_SCRATCH_BASE and FLAT_*_NSS scope:SCOPE_SYS), and the kernel now exports dev_info.scratch_base for gfx12. Un-gate version 12 and reuse the same emitter.

Verified on GFX12: two-hop round-trip returns dst==0x01010101, using the kernel-reported aperture 0x0002000000000000, no faults/resets.

---
 lib/amdgpu/compute_utils/amd_dispatch.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
lib/amdgpu/compute_utils/amd_dispatch.c +5 -4
index 926690f13..6f0d031a1 100644
@@ -458,7 +458,7 @@ amdgpu_memcpy_dispatch_test(amdgpu_device_handle device_handle,
  */
 #ifdef AMDGPU_LLVM_ENABLED
 static void
-amdgpu_emit_scratch_dispatch_gfx11(struct amdgpu_cmd_base *base_cmd,
+amdgpu_emit_scratch_dispatch(struct amdgpu_cmd_base *base_cmd,
 			 uint64_t mc_shader, uint64_t mc_scratch,
 			 uint64_t arg_src, uint64_t arg_dst, uint32_t num_waves)
 {
@@ -592,8 +592,8 @@ amdgpu_scratch_dispatch_test(amdgpu_device_handle device_handle,
 	uint8_t isa[4096];
 	size_t isa_size = 0;
 
-	if (version != 11) {
-		igt_info("SKIP scratch two-hop: gfx11 only, got %u\n", version);
+	if (version != 11 && version != 12) {
+		igt_info("SKIP scratch two-hop: gfx11/gfx12 only, got %u\n", version);
 		return 0;
 	}
 
@@ -676,7 +676,8 @@ amdgpu_scratch_dispatch_test(amdgpu_device_handle device_handle,
 		/* Generation-specific scratch dispatch packets */
 		switch (version) {
 		case 11:
-			amdgpu_emit_scratch_dispatch_gfx11(cmd, mc_shader,
+		case 12:
+			amdgpu_emit_scratch_dispatch(cmd, mc_shader,
 							   mc_scratch, arg_src, arg_dst, num_waves);
 			break;
 		default:
Signature · 1 line
2.49.0
#1 lore raw

✗ Fi.CI.BUILD: failure for lib/amdgpu: enable compute scratch two-hop test on gfx12

== Series Details ==

== Series Details ==

Series: lib/amdgpu: enable compute scratch two-hop test on gfx12
URL : https://patchwork.freedesktop.org/series/170367/
State : failure

== Summary ==

Applying: lib/amdgpu: enable compute scratch two-hop test on gfx12 Patch failed at 0001 lib/amdgpu: enable compute scratch two-hop test on gfx12 When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".