Skip to content

fix(agc): keep the pipeline library extensions enabled under APS5_NO_GPL - #7828

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
savvaniss:fix/gpl-off-keep-library-extensions
Oct 20, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
savvaniss:fix/gpl-off-keep-library-extensions

Conversation

@savvaniss

@savvaniss savvaniss commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Fixes the AMD GPU faults in APS5_NO_GPL tests (#7809). The cause is not in the f32 flush probe from #6503. It is the device that APS5_NO_GPL opens.

APS5_NO_GPL=1 opened a device without VK_EXT_graphics_pipeline_library and the five extensions that go with it. The AMD Windows driver keeps one on-disk pipeline cache (%LOCALAPPDATA%\AMD\VkCache) for both kinds of device. A compute pipeline compiled on one kind and loaded from the cache on the other runs with the wrong descriptor layout:

  • First dispatch: the probe writes nothing, so its output buffer keeps the 0xdeadbeef fill.
  • Next dispatch: it reads a buffer descriptor from that buffer and page-faults at 0xbeefdeadbeef.

Since #6503, every device runs the same probe pipelines when it opens. In a parallel suite, the libraries-on tests fill the cache first, so the three AMD tests that set APS5_NO_GPL and open a device fault every run. Each fault is a TDR. On my machine the driver twice failed to recover from one, and the PC needed a hard reset.

Now the device enables the extensions and their features whenever the GPU supports them. APS5_NO_GPL only turns off their use (graphicsPipelineLibrary), so every device on a GPU builds the same pipelines. The draws of a APS5_NO_GPL device still use render passes and whole pipelines.

Other switches also change the extension set, for example APS5_NO_TIMELINE and APS5_NO_HOST_IMPORT. Their tests pass on the RX 9070 XT, so this PR leaves them alone.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release. RX 9070 XT (driver 32.0.31041.1004) and UHD 770 (driver 32.0.101.7088).

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

Sequence main 6b8228b this PR
libraries on, on, then off on, on pass; off faults (read invalid at 0xbeefdeadb000) all pass
libraries off, off, then on off, off pass; on faults in the same way all pass

Run alone with a warm cache, the APS5_NO_GPL test passes on main 4 times out of 4. Only a pipeline cached by the other kind of device makes it fault.

Full ctest --parallel 4, ANYPS5_GPU set, AMD driver cache emptied first:

main 6b8228b this PR (cda8e66)
RX 9070 XT 3 failed; every APS5_NO_GPL test skipped after device-fault ... 0xbeefdeadb000; 2 to 4 groups of tests stalled 10–24 s waiting for GPU resets; the same run on 7f596df, and on 6b8228b with #7682, hung the machine 1 failed: agc_trimmed_import (below); no device-fault, no no usable Vulkan device, no stalled tests
UHD 770 7 failed (Intel image-table and MSAA tests, known) the same 7 failed

agc_trimmed_import fails under parallel load on main too, with the same message (after an unmap of 1440 KiB ... served from the import that pinned the old ones). Run alone on this PR it passes 10 times out of 10. The first run of this fix on 52f8222 passed all 1623 tests on the RX 9070 XT.

The two Windows freezes, with the event log and the full ctest output, are in #7809.

Validation: Khronos validation layer 1.4.363 (Vulkan SDK), VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ctest -R <tests> -V, on main cded26c68 and on this PR merged into it, on both GPUs (AMD driver cache emptied first). Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS. Tests: the 12 pipeline-library, draw-cache-reuse, stencil-replay and layered-volume tests. No VUID- error on either side. The only messages are warnings, the same on both sides (Undefined-Value-ShaderOutputNotConsumed, ...-DynamicRendering, WARNING-VkImageSubresourceRange-layerCount-compatibility). On the RX 9070 XT, main leaves out the three APS5_NO_GPL tests (#7809). With this PR they run there and log the same warnings as on the UHD 770's main.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes AMD Windows GPL-off: the f32 flush startup probe (#6503) page-faults at 0xbeefdeadbeef, so every APS5_NO_GPL test loses its device #7809
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300; Intel UHD Graphics 770, driver 32.0.101.7088, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

APS5_NO_GPL opened a device without VK_EXT_graphics_pipeline_library and
the five extensions that go with it. The AMD Windows driver shares its
on-disk pipeline cache between devices with and without those extensions,
so a compute pipeline compiled on one kind of device and loaded on the
other ran with the wrong descriptor layout. The startup f32 flush probe
(boykopovar#6503) runs the same compute pipelines on every device. In a parallel
test run, every APS5_NO_GPL test therefore page-faulted at 0xbeefdeadbeef,
an address read from the probe's own 0xdeadbeef fill. Each fault reset the
GPU, and twice the reset hung the machine.

The device now enables the extensions and their features whenever the
GPU supports them. APS5_NO_GPL only turns off their use, so every device
on a GPU builds the same pipelines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6146 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6249 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6290 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6636 docs/dev/ENVIRONMENT.md
PR 6683 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6718 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6788 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6820 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6946 docs/dev/ENVIRONMENT.md
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 6951 docs/dev/ENVIRONMENT.md
PR 6960 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7369 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7457 docs/dev/ENVIRONMENT.md
PR 7484 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7604 docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 7888 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7922 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/ENVIRONMENT.md
PR 8014 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

@thuanquang

thuanquang commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

An RDNA 2 run, since the PR has RDNA 4 and Intel runs only. RX 6700 XT (gfx1031), AMD's Windows driver 32.0.21045.5002, Windows 11 26200, Release, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1. main 38de0a470 against main 38de0a470 with this PR merged (cda8e66cc, clean merge).

Each sequence runs one renamed copy of the test executable, so AMD's per-executable pipeline cache starts empty and is shared only by the steps of that sequence. "on" is the default device, "off" is APS5_NO_GPL=1. Every sequence ran twice, with the same result both times:

test, steps from an empty cache main this PR
agc_driver_draw_cache_reuse_tests: on, on, off off loses the device all pass
the same: off, off, on on loses the device all pass
agc_driver_stencil_replay_tests: on, on, off off loses the device all pass
the same: off, off, on on loses the device all pass
agc_driver_layered_volume_draw_tests: off (--vertex-only), on, on (--vertex-only), off (--vertex-only) both on steps lose the device all pass
the same: on, on (--vertex-only), off (--vertex-only), on off loses the device all pass
agc_driver_cmask_fast_clear_tests: on, off, on off loses the device all pass
the same: off, on, off on loses the device all pass
agc_driver_recorder_tests --pipeline-library-only: on, off and off, on pass pass

On main, every lost device is vkQueueSubmit recorder: Vulkan result -4 after [device-fault] read invalid at 0xbeefdeadb000 (16 of the 18 faults) or 0xbeefdeadc000 (2, both in the layered-volume sequence). Only a step whose library mode differs from the one that filled the cache fails, in either order. With the PR, no step reports a device fault, and a step after the first is served from the cache (about 0.25-0.45 s against 0.7-0.8 s for the first) in either mode. The driver recovered from every fault here; this card did not hang.

agc_driver_cmask_fast_clear_tests is the test #7875 records for the RX 6400. On this RDNA 2 card it loses the device in whichever library mode runs after its cache was filled in the other (with APS5_NO_GPL=1 after a libraries-on run, as in a ctest suite). From an empty cache it passes in either mode, and with this PR it passes in every order.

Full ctest --parallel 4 --timeout 120 (the ctest executables keep their names, so their driver caches persist between runs as they would for a user): on main, 1684 tests, 6 failed: log_macros and log_macros_timestamps (ccache rewrites __FILE__ in local builds here), agc_trimmed_import (fails here on every build, #6499), and agc_driver_layered_volume_vertex_no_gpl, agc_driver_draw_cache_reuse_off and agc_driver_stencil_replay_no_gpl, each with [device-fault] read invalid at 0xbeefdead... and Vulkan result -4. With this PR, 1684 tests, 3 failed: the first three. The three APS5_NO_GPL tests pass, and the log has no device-fault line.

@oneandonlydean
oneandonlydean merged commit db9fe52 into boykopovar:main Oct 20, 2026
13 checks passed
thuanquang added a commit to thuanquang/AnyPS5 that referenced this pull request Oct 20, 2026
boykopovar#7351 kept robustBufferAccess2 off on AMD's proprietary driver because
enabling it broke agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex
and agc_driver_subvector_loop on an RX 6700 XT. With boykopovar#7623 and boykopovar#7828 on
main, those tests pass with the feature on, in either library-mode order.
This reverts 48b394d and keeps the record of boykopovar#7623's empty-mask test in
the s_subvector_loop debt entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thuanquang added a commit to thuanquang/AnyPS5 that referenced this pull request Oct 20, 2026
enabling it broke agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex
and agc_driver_subvector_loop on an RX 6700 XT. With boykopovar#7623 and boykopovar#7828 on
main, those tests pass with the feature on, in either library-mode order.
This reverts 48b394d and keeps the record of boykopovar#7623's empty-mask test in
the s_subvector_loop debt entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thuanquang added a commit to thuanquang/AnyPS5 that referenced this pull request Oct 21, 2026
enabling it broke agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex
and agc_driver_subvector_loop on an RX 6700 XT. With boykopovar#7623 and boykopovar#7828 on
main, those tests pass with the feature on, in either library-mode order.
This reverts 48b394d and keeps the record of boykopovar#7623's empty-mask test in
the s_subvector_loop debt entry.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs fix error Closes an issue (Fixes #N)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants