Intel Arc (Mesa ANV): agc_driver_lds_beyond_device_limit loses the device in the 64-bit LDS atomic lock #2805

Closed
opened 2026-10-10 15:34:46 +00:00 by ThatsLeo · 2 comments
ThatsLeo commented 2026-10-10 15:34:46 +00:00 (Migrated from github.com)
Contributor

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, shaderSharedInt64Atomics 0): agc_driver_lds_beyond_device_limit lost the device (VK_ERROR_DEVICE_LOST) in its first run. The same lock in workgroup memory (agc_driver_lds_atomics64) passes there.

  • The elected lane tries the compare-exchange once. On failure it is not served, and the existing outer loop, which runs until the ballot finds no pending lane, elects again. The update and its result are unchanged; no instruction semantics change.

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, on main 5edae353). Details: #2800 (closed by the intake pause).

Tested: Fedora 44, GCC 16.2.1, Release.

  • All 12 agc_driver_lds* tests pass 3 of 3 runs on Intel Arc; the LDS and atomic tests pass on lavapipe.
  • Full ctest on main (5edae353) and on this branch, on Intel Arc and lavapipe: Intel Arc 9 failures on main, 8 here; lavapipe 4 and 4; no new failure. The remaining failures also fail on main: on Intel Arc agc_driver_mesh, agc_driver_f64_fma_subnormals, agc_driver_vop1_float_unary, agc_driver_vopc_compare, agc_pipeline_cache and, on Fedora's non-PIE GCC, guest_dynamic_loader, guest_unwind_module_info and guest_unwind_module_info_failure; on lavapipe agc_driver_f64_fma_subnormals and guest_dynamic_loader, guest_unwind_module_info and guest_unwind_module_info_failure.

Happy for anyone with intake access to carry it.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5792675407 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2805). Originally posted by [ThatsLeo](https://github.com/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, `shaderSharedInt64Atomics` 0): `agc_driver_lds_beyond_device_limit` lost the device (`VK_ERROR_DEVICE_LOST`) in its first run. The same lock in workgroup memory (`agc_driver_lds_atomics64`) passes there. - The elected lane tries the compare-exchange once. On failure it is not served, and the existing outer loop, which runs until the ballot finds no pending lane, elects again. The update and its result are unchanged; no instruction semantics change. 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`](https://github.com/ThatsLeo/AnyPS5/tree/fix/lds-lock-single-attempt) (one commit, `e894f909`, on `main` `5edae353`). Details: #2800 (closed by the intake pause). **Tested:** Fedora 44, GCC 16.2.1, Release. - All 12 `agc_driver_lds*` tests pass 3 of 3 runs on Intel Arc; the LDS and atomic tests pass on lavapipe. - Full `ctest` on `main` (`5edae353`) and on this branch, on Intel Arc and lavapipe: Intel Arc 9 failures on `main`, 8 here; lavapipe 4 and 4; no new failure. The remaining failures also fail on `main`: on Intel Arc `agc_driver_mesh`, `agc_driver_f64_fma_subnormals`, `agc_driver_vop1_float_unary`, `agc_driver_vopc_compare`, `agc_pipeline_cache` and, on Fedora's non-PIE GCC, `guest_dynamic_loader`, `guest_unwind_module_info` and `guest_unwind_module_info_failure`; on lavapipe `agc_driver_f64_fma_subnormals` and `guest_dynamic_loader`, `guest_unwind_module_info` and `guest_unwind_module_info_failure`. Happy for anyone with intake access to carry it. AI-assisted: yes.
Silverash-i8 commented 2026-10-10 16:05:22 +00:00 (Migrated from github.com)
Author
Contributor

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 e894f909 onto current main 57f96fd2 (it applies cleanly) rather than testing on 5edae353.

  • ctest -R '^agc_driver_lds' --repeat until-fail:3: all 9 pass 3/3 on both GPUs. On main, agc_driver_lds_beyond_device_limit loses the device on the iGPU every run.
  • Full ctest (--parallel 6, iGPU with APS5_NO_PIPELINE_LTO=1 to keep the #2777 race out of it): 709/709 on the RTX 5060. On the iGPU lds_beyond_device_limit passes and nothing new fails that's related: mesh (#2815), f64_fma_subnormals, fp16_overflow, vop1_float_unary and vopc_compare (#2114) fail as on main. agc_driver_gated_dispatch_capture also 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 OpAtomicExchange nor 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099472495 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2805#issuecomment-6099472495). Originally posted by [Silverash-i8](https://github.com/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 e894f909 onto current `main` 57f96fd2 (it applies cleanly) rather than testing on 5edae353. - `ctest -R '^agc_driver_lds' --repeat until-fail:3`: all 9 pass 3/3 on both GPUs. On `main`, `agc_driver_lds_beyond_device_limit` loses the device on the iGPU every run. - Full ctest (`--parallel 6`, iGPU with `APS5_NO_PIPELINE_LTO=1` to keep the #2777 race out of it): 709/709 on the RTX 5060. On the iGPU `lds_beyond_device_limit` passes and nothing new fails that's related: `mesh` (#2815), `f64_fma_subnormals`, `fp16_overflow`, `vop1_float_unary` and `vopc_compare` (#2114) fail as on `main`. `agc_driver_gated_dispatch_capture` also 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 `OpAtomicExchange` nor 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.
oneandonlydean commented 2026-10-11 01:08:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T01:08:41Z.


Fixed by #3015.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6104055239 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2805#issuecomment-6104055239). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T01:08:41Z. --- Fixed by #3015.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#2805
No description provided.