perf: first-visit freezes of up to 10 s from graphics pipeline library builds under the GpuMutex (PPSA06207, Radeon 8060S) #25352
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 kripotker on 2026-11-21T23:38:36Z.
Title and scene
PPSA06207 (What Remains of Edith Finch) 01.001.000. Molly's story: a 90-second window opened while paused in Molly's room, covering her turning into a cat and the climb that follows.
What is slow or what changed
The first time the AMD driver compiles a scene's pipelines, the game freezes for several seconds. Once the driver has cached them, the same scene doesn't freeze. In the freeze, the draw committer builds graphics pipeline library parts one after another (
Vulkan.GraphicsPipelineLibrary, up to 1 s each) while it holdsGuestMemory::GpuMutex(). Queue worker 0x0 waits behind it atfill.Driver::commitDraw(Execution/src/Driver/Draw/Draw.cpp) takes the GPU mutex at theDrawsite and holds it acrossVulkanDevice::Draw. That call reaches thevkCreateGraphicsPipelinescalls for missing parts inGraphics/src/PipelineLibrary.cpp. Compute pipelines are already built outside the mutex: the[vk]line reportscompute pipelines created 116 (0 under the GPU mutex).The same scene and window, captured twice:
Vulkan.GraphicsPipelineLibraryGpuMutex.wait.fillDriver.Draw.shader_compile_and_link%LOCALAPPDATA%\AMD\VkCache) and AnyPS5'spipelines.journalandvk-pipelines-*.binwere moved aside before the run.The 10480 ms frame (present 2970, starting 38460 ms into the cold window), right after the "…was a cat!" text:
Graphics.DrawVulkan.GraphicsPipelineLibraryGpuMutex.wait.fillDriver.Packet.memory_waitDriver.Draw.shader_compile_and_linkThe 26 parts are built one after another on the draw committer:
Earlier full play sessions (
APS5_TRACE_SUMMARY_EVERY=2withAPS5_PROFILE_DRAW=1) showed the same pattern every time a run reached a scene for the first time:Vulkan.GraphicsPipelineLibraryin each.[lock]line in the worst one: the draw thread held the mutex atdrawfor 9441 ms of 10 s, the longest hold 1017 ms. Queue 0x0 waited 4982 ms behinduntagged/draw.The pipeline journal is not the fix on this driver: the warm capture had AnyPS5's journal empty and still didn't freeze, because the driver's own cache served the parts. A player meets these freezes on a first playthrough.
Two directions, neither tried:
PipelineLibrarypart builds a draw needs beforecommitDrawtakes the mutex, so the other queues keep running.APS5_LIBRARY_PREBUILD=1builds parts early, but #23812 made it opt-in because it builds far more than a title reaches.Summary lines
Both captures on
main8763aeffdc37, not dirty. AMD Radeon 8060S (Strix Halo APU,1002:1586), AMD proprietary driver 26.11.2 (LLPC, 32.0.32029.2010), AMD Ryzen AI MAX+ 388, Windows 11 Pro 10.0.26300, 3840x2160, WinLibs GCC 15.2.0 r7, Release.The full summary lines are in
summary-cold.jsonlandsummary-warm.jsonl, with the traces.APS5_HOST_IMPORT_MIB=8192keeps the import budget out of the measurement. At this machine's default of 3383 MiB, refused imports halve the frame rate (#7047).Traces
trace-cold.json.gz(34 MB) andtrace-warm.json.gz(45 MB) are over GitHub's 25 MB attachment limit. They and both summary files are at https://github.com/kripotker/AnyPS5/releases/tag/trace-ppsa06207-first-visit-pipelines.Digest
python3 tools/trace_digest.py trace-cold.json.gz:python3 tools/trace_digest.py trace-warm.json.gz:Capture
Both left unticked on purpose:
APS5_PROFILE_*was set. The otherAPS5_TRACE_*switches are the ones that set the window:APS5_TRACE_EVENTSandAPS5_TRACE_TRIGGER_FILE, which opens it on a trigger file once the scene is reached. The game ran from a background shell with stdout and stderr sent to the null device, so no log file was written.AI-assisted: yes