From d3bfcd3277be5ec57da88b16259c9420f6f272ed Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Tue, 14 Oct 2025 18:07:46 +0800 Subject: [PATCH] minor patches for SQTT over usb on gfx12 (#12627) * disable cpu_access in the sqtt buffer allocation not sure if this is required, it results in a very slow call to pcie_mem_write over USB GPU, removing it worked fine. * fix itrace_se_mask on gfx12 on gfx11 it gave 6 se, on gfx11 this value is 2 so no instructions were traced. * Revert "fix itrace_se_mask on gfx12" This reverts commit 0644adbcd1e84b7a617b34b436f9dd63d8270305. --- tinygrad/runtime/ops_amd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/runtime/ops_amd.py b/tinygrad/runtime/ops_amd.py index af239b8948..d35539b495 100644 --- a/tinygrad/runtime/ops_amd.py +++ b/tinygrad/runtime/ops_amd.py @@ -819,7 +819,7 @@ class AMDDevice(HCQCompiled): f"ppfeaturemask={(ppfeaturemask&~0x8000):#x} (current {ppfeaturemask=:#x} & ~PP_GFXOFF_MASK) to amdgpu module parameters\n" "For more information read https://github.com/tinygrad/tinygrad/blob/master/extra/sqtt/README.md") SQTT_BUFFER_SIZE = getenv("SQTT_BUFFER_SIZE", 256) # in mb, per shader engine - self.sqtt_buffers = [self.allocator.alloc(SQTT_BUFFER_SIZE*1024*1024, BufferSpec(cpu_access=True, nolru=True)) for _ in range(self.se_cnt)] + self.sqtt_buffers = [self.allocator.alloc(SQTT_BUFFER_SIZE*1024*1024, BufferSpec(nolru=True)) for _ in range(self.se_cnt)] self.sqtt_itrace_se_mask = getenv("SQTT_ITRACE_SE_MASK", 2) # -1 enable all, 0 disable all, >0 bitmask for where to enable instruction tracing self.sqtt_next_cmd_id = itertools.count(0) cast(AMDComputeQueue, self.hw_compute_queue_t()).sqtt_start(self.sqtt_buffers, self.sqtt_itrace_se_mask).submit(self)