AGC: 64-bit LDS atomics under the workgroup lock never finish in workgroups over 64 threads on AMD RDNA 2 (Windows) #6666
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-16T03:22:18Z.
On an AMD RDNA 2 iGPU (Windows), a 64-bit LDS atomic under the workgroup lock (
LockedLdsUpdate, SpirvMemoryInstructions.cpp:1310) never finishes once the workgroup has more than 64 threads. With 64 or fewer it gives the exact result. This is whatagc_driver_lds_mixed_width_atomicshits: it is the only LDS 64-bit test above 64 threads (256).LdsAtomics64uses 32 andLdsBeyondDeviceLimit64.Ryzen 9 7950X iGPU (RDNA 2, 0x164e), driver 32.0.21045.5002, Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
main5d9dcc42d. The RX 9060 XT (RDNA 4, 0x7590, 32.0.31041.1004) in the same machine is the control. Measured with a local change to the test that sets the uniform kernel's workgroup width and timesDispatch+WaitIdle:ds_add_u64+ds_add_u32)ds_add_u32replaced bys_nop(64-bit only)0x000003fffffffc00), 30 msLockedLdsUpdateelects one lane per wave for theOpAtomicCompareExchangeand leaves the loop on a wave-uniform ballot (#833), so lanes of one wave never wait on each other, and the results are exact up to 64 threads. Over 64 threads, a workgroup on RDNA 2 can occupy both CUs of a WGP. That may be what changes, but I haven't confirmed it.Not related to #6284 (ASTRO BOT on RX 6600 XT), whose cached modules contain no
LockedLdsUpdate.Reproduce
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T03:37:52Z.
I opened PR #6670 for a concrete SPIR-V issue in the lock setup: every invocation currently emits a non-atomic store of zero to the same workgroup lock before the barrier. The PR changes this to one store from
LocalInvocationIndex == 0and adds a structural regression check with a negative control. The focused SPIR-V lock test and conventions check pass on Linux; I could not run the reported AMD Windows GPU case here. If you can runagc_driver_lds_mixed_width_atomicson your RDNA 2 setup against the PR head, that would establish whether this race explains the hang.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T14:48:59Z.
RDNA 3 data point:
agc_driver_lds_mixed_width_atomicspasses 3 of 3 here, in under 0.3 s each, so the stall looks specific to RDNA 2 rather than to AMD's Windows driver in general.Windows 11 (26300), Radeon 860M (RDNA 3.5,
1002:1114, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release,main82ddae75b+ #6436 (which only changes the SPIR-V words passed tovkCreateShaderModule), #6670 not applied.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T08:27:41Z.
RDNA 3 data point: Radeon 780M (Ryzen Z1 Extreme, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.
agc_spirv_lds_atomic_lockagc_driver_lds_mixed_width_atomics(256 threads), 3 runsmain5d9dcc42d4864a7480The test ran in full (
lds mixed width atomics tests passed, no skip). So with this driver the 780M is not affected — the failure listed for a 780M in #3358 does not reproduce here on either build. With #3882 (RDNA 3.5 passes) and the RX 9060 XT above, the stall is so far seen only on RDNA 2 and GCN 5.AI-assisted: yes (runs made on the device above).