Intel Arc (Mesa ANV): agc_driver_lds_beyond_device_limit loses the device in the 64-bit LDS atomic lock #2805
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 ThatsLeo on 2026-10-10T15:34:46Z.
The 64-bit LDS atomic lock let the elected lane spin in an inner loop until its compare-exchange succeeded. With the LDS in a storage buffer (#1776, LDS beyond the device's shared memory limit), that loop never ended on Intel Arc (Meteor Lake, Mesa 26.2.3 ANV,
shaderSharedInt64Atomics0):agc_driver_lds_beyond_device_limitlost the device (VK_ERROR_DEVICE_LOST) in its first run. The same lock in workgroup memory (agc_driver_lds_atomics64) passes there.Dropping the lock removes the hang, so the lock is the cause. A device-scope compare-exchange and release, and an atomic initial store of the lock, did not help. Why ANV does not finish the inner loop is not established.
Fix:
ThatsLeo/AnyPS5:fix/lds-lock-single-attempt(one commit,e894f909, onmain5edae353). Details: #2800 (closed by the intake pause).Tested: Fedora 44, GCC 16.2.1, Release.
agc_driver_lds*tests pass 3 of 3 runs on Intel Arc; the LDS and atomic tests pass on lavapipe.ctestonmain(5edae353) and on this branch, on Intel Arc and lavapipe: Intel Arc 9 failures onmain, 8 here; lavapipe 4 and 4; no new failure. The remaining failures also fail onmain: on Intel Arcagc_driver_mesh,agc_driver_f64_fma_subnormals,agc_driver_vop1_float_unary,agc_driver_vopc_compare,agc_pipeline_cacheand, on Fedora's non-PIE GCC,guest_dynamic_loader,guest_unwind_module_infoandguest_unwind_module_info_failure; on lavapipeagc_driver_f64_fma_subnormalsandguest_dynamic_loader,guest_unwind_module_infoandguest_unwind_module_info_failure.Happy for anyone with intake access to carry it.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-10T16:05:22Z.
Verified on Windows with Intel's own driver, which is the other half of where this hangs.
Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release. Intel Graphics in a Core Ultra 9 275HX (Arrow Lake, device 0x7d67, driver 32.0.101.8991) and an RTX 5060 Laptop GPU (32.0.16.1742) in the same machine. I cherry-picked
e894f909onto currentmain57f96fd2(it applies cleanly) rather than testing on5edae353.ctest -R '^agc_driver_lds' --repeat until-fail:3: all 9 pass 3/3 on both GPUs. Onmain,agc_driver_lds_beyond_device_limitloses the device on the iGPU every run.--parallel 6, iGPU withAPS5_NO_PIPELINE_LTO=1to keep the #2777 race out of it): 709/709 on the RTX 5060. On the iGPUlds_beyond_device_limitpasses and nothing new fails that's related:mesh(#2815),f64_fma_subnormals,fp16_overflow,vop1_float_unaryandvopc_compare(#2114) fail as onmain.agc_driver_gated_dispatch_capturealso failed once there, on its own 10 s wall-clock limit (10.57 s with five other tests sharing the iGPU). It has no LDS in it and passes 5/5 run on its own, so I'd put that down to load rather than this change.This lines up with what I found in #2777 from the other side: on the iGPU the hang needs the LDS in device memory and two subgroups in one workgroup, and neither Device scope, an atomic initial store, moving the lock to its own cache line, releasing with
OpAtomicExchangenor test-and-test-and-set helped. Taking one attempt per outer iteration is the first thing that does, on both drivers, so it looks like the inner spin itself that neither Intel driver will make progress past.AI-assisted (Claude Code); every number above is from runs on this machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T01:08:41Z.
Fixed by #3015.