perf(agc): reserve a physical core each for the draw committer and the draw finisher on Windows #17697
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17697"
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 Nesyth on 2026-11-09T10:28:28Z.
What
Windows can leave another busy thread on the SMT sibling of the draw committer's core for a whole run. The committer then stays slower until the process exits, and boots of the same scene fall into fast and slow modes. This PR gives the committer, and the draw finisher when it runs, a physical core of their own through CPU sets.
APS5_WORKER_AFFINITY,APS5_WORKER_AFFINITY_MASK), with inline recording (APS5_PIPELINED_DRAWS=0), or outside Windows. On parts with two last-level caches the cores come from the cache of the first unparked performance core; this was not run on such a part.APS5_NO_COMMITTER_COREturns both off,APS5_NO_FINISHER_COREonly the finisher's, andAPS5_COMMITTER_CPU=<logical processor>names the committer's processor on any host. Each reservation prints one[affinity]line.CpuTopology.hpp, tested incpu_topology_tests: SMT on and off, hybrid parts, parked cores, two caches, two processor groups, a requested processor and too few cores.APS5_DRAW_PIPELINEor by default with #15456.Tested
Windows 11 Pro 26300, Radeon RX 7900 XTX (AMD Software 26.10.1), Ryzen 7 7800X3D, Release, MinGW-w64 GCC 15.2.
PPSA04264 on main
095ff72367, the same save. Each boot had a 30 s warm-up and was measured for 150 s. Boots alternated the reservation on and off (APS5_NO_COMMITTER_CORE=1). Committer time is the mean of the last 8[draw] pipelinedreports.APS5_DRAW_PIPELINE=1APS5_DRAW_PIPELINE=1FPS is +29% in the default mode and +25% with the draw finisher. No boot had a fatal error or a lost device. Four trace captures in the default mode, alternating, with
APS5_TRACE_SECONDS=240:60, give the same picture. With the reservation off: 428 and 430 presents in 60 s, frame p50 140.4 and 139.3 ms. With it on: 552 and 543 presents, p50 108.3 and 110.0 ms. GPU busy is 34.0-35.0 ms per present in all four. After the rebase onto9d2e737432, the build passes,agc_thread_prioritypasses, andcpu_topology_testspasses under WSL Ubuntu with GCC 12.Captures
Four trace captures in the default mode, alternating main at this PR's base (
9d2e737432, no reservation) and the PR head (9d8e4f7b97), the same save:APS5_TRACE_SECONDS=240:60,APS5_TRACE_SUMMARY_EVERY=10,APS5_TRACE_EVENTS=4194304(no thread buffer filled, so no events were dropped). Title fields in the summary lines are redacted.9d2e7374329d8e4f7b979d2e7374329d8e4f7b97The
seconds 240:60summary lines:tools/trace_digest.py, main 1seconds 240:60 from present 2805: 306 presents, frame p50 138.1 / p90 195.3 / p99 1636.1 / max 2225.8 ms, GPU busy 34.1 ms per present
AMD Radeon RX 7900 XTX, AMD proprietary driver 26.10.1 (LLPC), Windows 10.0.26300, 3840x2160, commit
9d2e737432, dropped: noSlowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 157.3, Graphics.Draw 135.4, Driver.Packet.draw 125.7, Driver.Draw 124.5, Graphics.Draw.draw_and_resource_release 119.2, Driver.Draw.draw_enqueued 64.5, Vulkan.GraphicsPipeline 51.7, Vulkan.GraphicsPipeline.create 50.1, Vulkan.GraphicsPipelineLibrary 50.1, batch 34.1
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
tools/trace_digest.py, PR 1seconds 240:60 from present 3838: 534 presents, frame p50 110.3 / p90 118.9 / p99 132.1 / max 486.0 ms, GPU busy 33.4 ms per present
AMD Radeon RX 7900 XTX, AMD proprietary driver 26.10.1 (LLPC), Windows 10.0.26300, 3840x2160, commit
9d8e4f7b97, dropped: noSlowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 72.0, Graphics.Draw 53.4, Driver.Packet.draw 51.4, Driver.Draw 50.4, Graphics.Draw.draw_and_resource_release 43.0, batch 33.4, Driver.Draw.shader_compile_and_link 17.5, Driver.Packet.dispatch 15.9, Driver.Draw.draw_enqueued 10.1, VideoOut.Flip 10.1
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)