Repository navigation
fix(agc): keep shader modules of pipeline library parts alive for background linking - #4445
Merged
oneandonlydean merged 1 commit intoOct 12, 2026
Conversation
…kground linking boykopovar#4152 dropped the device-wide module list that boykopovar#3173 added, so Pipeline destroys the shader modules right after the library parts are created, also for the parts prebuilt at registration. AMD's Windows driver still reads them during the background link-time-optimized link and faults inside amdvlk64.dll. Hand the modules of each new part to the device's library store again and destroy them in ClearPipelineLibraries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 tasks done
This was referenced Oct 12, 2026
10 tasks done
Contributor
Author
|
The crash also reaches titles. I re-ran the homebrew catalog sweep on AMD Windows (Radeon 860M, driver 32.0.13058.8001), one 60-second run per title, relinked with
Jelly5 and Emby5 ran 60 s on Three more titles exit early on
AI-assisted: yes (Claude Code) |
10 tasks done
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #4435. On AMD's Windows driver, 47 AGC tests have crashed inside
amdvlk64.dllsince #4152. The driver still reads a pipeline library part's shader modules during the background link-time-optimized link, afterPipelinehas destroyed them. Destroying them is legal Vulkan, so this works around a driver bug.#3173 handed the modules of each newly created part to the device's library store and destroyed them in
ClearPipelineLibraries. #4152 reworkedLinkPipelineFromLibrariesand that store went away. This puts it back on the current code:LinkPipelineFromLibrariestakes the caller's modules again. When background linking is on, it moves the ones a new part uses intoDeviceLibraries::modulesand clears them in the caller's span.Pipeline.cpppass_modules: the draw path and perf(agc): build shader pipeline libraries when shaders are registered #4152's prebuild-at-registration path. Their existing destroy loops then skip the handed-over modules, since they areVK_NULL_HANDLE.ClearPipelineLibrariesdestroys the stored modules after the parts and layouts.A part that loses the race to another thread is destroyed as before, and its modules stay with the caller.
Tested
Radeon 860M (RDNA 3.5, AMD Windows driver 32.0.13058.8001), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release. Tests run one at a time, with the shader cache emptied first.
ctest -R '^agc_' -j 1maine7c70a2dfamdvlk64.dll, 27 non-zero exits, 1 timeout)mainwithAPS5_NO_PIPELINE_LTO=1mainctest -E '^agc_' -j 4).tools/check_conventions.py --base mainandgit diff --checkpass.conventions_ci_gate. That test flags the pre-0ab2a04dbuild.ymlthe fork uses to run full builds, not this change.Upstream CI runs the GPU tests on lavapipe, which doesn't show the fault, so CI can't tell this change from
main.#4363 changes the same function (
LinkPipelineFromLibraries, the part keys). With it merged and without this change, the failing tests still fail. The two touch different lines, but whichever merges second may need a rebase.Checklist
main; no other open PR implements the same changeNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)