AMD Windows GPL-off: the f32 flush startup probe (#6503) page-faults at 0xbeefdeadbeef, so every APS5_NO_GPL test loses its device #7809

Closed
opened 2026-10-19 08:25:48 +00:00 by savvaniss · 3 comments
savvaniss commented 2026-10-19 08:25:48 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T08:25:48Z.


What happens

Since #6503 (ac14d6317, merged 10-19), VulkanDevice runs ProbeFloat32FlushToZero while it opens. On an RX 9070 XT, when graphics pipeline libraries are off, the probe's dispatch page-faults and the device is lost before the test starts. All three AMD tests that set APS5_NO_GPL=1 and open a device do this every run: agc_driver_draw_cache_reuse_off, agc_driver_stencil_replay_no_gpl and agc_driver_layered_volume_vertex_no_gpl. They return 77, so ctest reports them as skipped, not failed.

[src/VulkanDevice.cpp:1565 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=0
[src/VulkanDevice.cpp:1942 VulkanDevice] Vulkan device ready device=... queue=... family=0
[write-watch] host imports of write-watched memory keep the write watch: yes (...)
[device-fault] result 0: GPU fault
[device-fault] read invalid at 0xbeefdeadb000 (precision 0x1000)
skipped, no usable Vulkan device: vkCreateComputePipelines: Vulkan result -4

The faulting page is 0xbeefdeadbeef. That is a buffer base built from two words of the probe's Output.fill(0xdeadbeefu): base_lo 0xdeadbeef, plus 0xdeadbeef & 0xffff as base_hi. In the GPL-off case the shader seems to read a descriptor from the output buffer rather than from the user data. With libraries off, Target() sets fixedPushSlots and registrationModules to false, so the user-data path differs from the GPL path.

Why it matters on Windows

Each fault is a TDR (WER LiveKernelEvent 141). Tests that open a device during the reset hit the probe too. They fail with vkCreateComputePipelines color transfer: Vulkan result -4 (read invalid at 0x0) and skip after 10 to 24 s. That is why full AMD runs on main now show groups of 3 or 4 slow skipped tests.

On this machine the AMD driver recovered from most of these resets. Twice it did not. Each time the GPU stayed at 100 %, both screens went black, and the PC needed a hard reset (Kernel-Power 41, no Event 4101). Both freezes happened during full ctest --parallel 4 runs, on 7f596df48 and on 6b8228b2b.

Evidence

AMD RX 9070 XT, driver 32.0.31041.1004 Intel UHD 770
07377573f (before #6503) GPL-off tests pass, no TDR in 2 full runs pass
7f596df48 and 6b8228b2b 3 of 3 GPL-off tests lose the device in the probe; 2 TDRs per full run the 4 pipelineLibrary=0 tests log [float-controls] f32 denormal flush: hardware and pass
GPL on, same AMD run 271 tests log f32 denormal flush: hardware (0 of 5472 ...) same

The AMD driver version and Windows build are the same in the good and bad runs.

Workaround

APS5_NO_HW_F32_FLUSH=1 skips the probe (float32FlushToZeroCandidate is false). Leaving out _no_gpl|draw_cache_reuse_off also avoids the faults.

Related: #5150 (another AMD Windows GPL-off device loss).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5920439349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7809). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T08:25:48Z. --- ### What happens Since #6503 (ac14d6317, merged 10-19), `VulkanDevice` runs `ProbeFloat32FlushToZero` while it opens. On an RX 9070 XT, when graphics pipeline libraries are off, the probe's dispatch page-faults and the device is lost before the test starts. All three AMD tests that set `APS5_NO_GPL=1` and open a device do this every run: `agc_driver_draw_cache_reuse_off`, `agc_driver_stencil_replay_no_gpl` and `agc_driver_layered_volume_vertex_no_gpl`. They return 77, so ctest reports them as skipped, not failed. ```text [src/VulkanDevice.cpp:1565 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=0 [src/VulkanDevice.cpp:1942 VulkanDevice] Vulkan device ready device=... queue=... family=0 [write-watch] host imports of write-watched memory keep the write watch: yes (...) [device-fault] result 0: GPU fault [device-fault] read invalid at 0xbeefdeadb000 (precision 0x1000) skipped, no usable Vulkan device: vkCreateComputePipelines: Vulkan result -4 ``` The faulting page is `0xbeefdeadbeef`. That is a buffer base built from two words of the probe's `Output.fill(0xdeadbeefu)`: base_lo `0xdeadbeef`, plus `0xdeadbeef & 0xffff` as base_hi. In the GPL-off case the shader seems to read a descriptor from the output buffer rather than from the user data. With libraries off, `Target()` sets `fixedPushSlots` and `registrationModules` to false, so the user-data path differs from the GPL path. ### Why it matters on Windows Each fault is a TDR (WER `LiveKernelEvent 141`). Tests that open a device during the reset hit the probe too. They fail with `vkCreateComputePipelines color transfer: Vulkan result -4` (`read invalid at 0x0`) and skip after 10 to 24 s. That is why full AMD runs on main now show groups of 3 or 4 slow skipped tests. On this machine the AMD driver recovered from most of these resets. Twice it did not. Each time the GPU stayed at 100 %, both screens went black, and the PC needed a hard reset (Kernel-Power 41, no Event 4101). Both freezes happened during full `ctest --parallel 4` runs, on 7f596df48 and on 6b8228b2b. ### Evidence | | AMD RX 9070 XT, driver 32.0.31041.1004 | Intel UHD 770 | |---|---|---| | 07377573f (before #6503) | GPL-off tests pass, no TDR in 2 full runs | pass | | 7f596df48 and 6b8228b2b | 3 of 3 GPL-off tests lose the device in the probe; 2 TDRs per full run | the 4 `pipelineLibrary=0` tests log `[float-controls] f32 denormal flush: hardware` and pass | | GPL on, same AMD run | 271 tests log `f32 denormal flush: hardware (0 of 5472 ...)` | same | The AMD driver version and Windows build are the same in the good and bad runs. ### Workaround `APS5_NO_HW_F32_FLUSH=1` skips the probe (`float32FlushToZeroCandidate` is false). Leaving out `_no_gpl|draw_cache_reuse_off` also avoids the faults. Related: #5150 (another AMD Windows GPL-off device loss).
MarcZX10 commented 2026-10-19 08:45:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T08:45:37Z.


I traced the GPL-dependent fields through current main. ProbeFloat32FlushToZero calls ShaderRecompiler::Recompile directly for compute shaders and then VulkanDevice::Dispatch; fixedPushSlots and registrationModules are only consumed by the graphics ShaderRegistry path. computePipelineFlags() also does not vary with graphicsPipelineLibrary. So the 0xbeefdeadbeef address is strong evidence of a bad descriptor/user-data value, but the proposed GPL-off target flags do not by themselves explain it in this probe path.

Could you identify the first of the six Run combinations that faults (mode and MixedCode/TinyCode/MixedTinyCode), and capture that shader's SPIR-V plus its recompile binding/push-constant layout on the failing AMD setup? Comparing that with the GPL-on run should distinguish a shader ABI/layout mismatch from an AMD compute-pipeline driver issue before changing the startup probe.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263303518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7809#issuecomment-6263303518). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T08:45:37Z. --- I traced the GPL-dependent fields through current main. `ProbeFloat32FlushToZero` calls `ShaderRecompiler::Recompile` directly for compute shaders and then `VulkanDevice::Dispatch`; `fixedPushSlots` and `registrationModules` are only consumed by the graphics `ShaderRegistry` path. `computePipelineFlags()` also does not vary with `graphicsPipelineLibrary`. So the `0xbeefdeadbeef` address is strong evidence of a bad descriptor/user-data value, but the proposed GPL-off target flags do not by themselves explain it in this probe path. Could you identify the first of the six `Run` combinations that faults (mode and `MixedCode`/`TinyCode`/`MixedTinyCode`), and capture that shader's SPIR-V plus its recompile binding/push-constant layout on the failing AMD setup? Comparing that with the GPL-on run should distinguish a shader ABI/layout mismatch from an AMD compute-pipeline driver issue before changing the startup probe.
savvaniss commented 2026-10-19 09:13:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T09:13:27Z.


Found the root cause, and it isn't the probe's code. The probe only made it visible.

The AMD Windows driver keeps one on-disk pipeline cache (%LOCALAPPDATA%\AMD\VkCache) for devices with and without the pipeline-library extensions, and APS5_NO_GPL=1 opened a device without them. A compute pipeline compiled by one kind of device and loaded by the other runs with the wrong descriptor layout. Its first dispatch writes nothing, so the probe's output keeps its 0xdeadbeef fill. The next dispatch reads a buffer descriptor from that output and faults at 0xbeefdeadbeef.

With agc_driver_draw_cache_reuse_tests on the RX 9070 XT, starting from an empty AMD driver cache:

  • libraries on, on, then off: the off run faults;
  • libraries off, off, then on: the on run faults, the same way.

On its own with a warm cache, the APS5_NO_GPL test passes, 4 times out of 4.

Fix in #7828: the device keeps the extensions and their features enabled, and APS5_NO_GPL only stops using them. Both sequences above then pass. The full AMD suite (--parallel 4, empty driver cache) runs without a single device-fault or stalled test.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263778221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7809#issuecomment-6263778221). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T09:13:27Z. --- Found the root cause, and it isn't the probe's code. The probe only made it visible. The AMD Windows driver keeps one on-disk pipeline cache (`%LOCALAPPDATA%\AMD\VkCache`) for devices with and without the pipeline-library extensions, and `APS5_NO_GPL=1` opened a device without them. A compute pipeline compiled by one kind of device and loaded by the other runs with the wrong descriptor layout. Its first dispatch writes nothing, so the probe's output keeps its `0xdeadbeef` fill. The next dispatch reads a buffer descriptor from that output and faults at `0xbeefdeadbeef`. With `agc_driver_draw_cache_reuse_tests` on the RX 9070 XT, starting from an empty AMD driver cache: - libraries on, on, then off: the off run faults; - libraries off, off, then on: the on run faults, the same way. On its own with a warm cache, the `APS5_NO_GPL` test passes, 4 times out of 4. Fix in #7828: the device keeps the extensions and their features enabled, and `APS5_NO_GPL` only stops using them. Both sequences above then pass. The full AMD suite (`--parallel 4`, empty driver cache) runs without a single `device-fault` or stalled test.
savvaniss commented 2026-10-19 12:02:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T12:02:00Z.


@MarcZX10 thanks, your trace was right: the target flags never reach the probe. I dumped what the probe recompiles on the RX 9070 XT before any dispatch, with and without APS5_NO_GPL. For all 18 runs, the SPIR-V, push constants, bindings and specialization constants are byte-identical between the two. The device differs only in its extension set, and the AMD driver's shared on-disk pipeline cache serves a pipeline compiled on one kind of device to the other (the sequences in my comment above). #7828 keeps the extension set the same.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6266724680 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7809#issuecomment-6266724680). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T12:02:00Z. --- @MarcZX10 thanks, your trace was right: the target flags never reach the probe. I dumped what the probe recompiles on the RX 9070 XT before any dispatch, with and without `APS5_NO_GPL`. For all 18 runs, the SPIR-V, push constants, bindings and specialization constants are byte-identical between the two. The device differs only in its extension set, and the AMD driver's shared on-disk pipeline cache serves a pipeline compiled on one kind of device to the other (the sequences in my comment above). #7828 keeps the extension set the same. AI-assisted: yes (Claude Code)
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#7809
No description provided.