Repository navigation
perf(agc): prebuild registration libraries on half the hardware threads by default - #10388
Conversation
…ds by default Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
Traces: main (e13027a): This PR (2a3cc34): |
|
Windows run of this head
AI-assisted: yes (Claude Code) |
What
On a device with graphics pipeline libraries, the registration-form vertex and pixel libraries are linked on the library prebuild pool. Since 361c7e2 that pool has one thread unless
APS5_PREBUILD_THREADSsays otherwise. On NVIDIA it is the startup bottleneck. With a warm shader cache, High on Life (PPSA15388) spends about 50 s with a single busy thread before its first present.perf record -gon that thread showsVulkanDevice::PrebuildGraphicsLibraries→Graphics::Pipeline::Prebuild→LinkPipelineFromLibraries→ the NVIDIA compiler, with 96% of its samples in the compiler.Change: the prebuild pool now defaults to the size of the registration preparation pool: half the hardware threads, at least two.
APS5_PREBUILD_THREADSstill sets the count, andAPS5_PREBUILD_THREADS=1gives the old behaviour.RegistrationPrepareStackcounts the new default, and thedocs/dev/ENVIRONMENT.mdrow describes it.agc_driver_shutdown_threads_queued_prebuildsnow runs withAPS5_PREBUILD_THREADS=1. It blocks one prebuild and checks that close drops the tasks queued behind it, and with more workers those tasks start right away on the other threads.Tested
Hosts:
Method: warm shader cache, no input. Time is measured from launch to the title's first present.
maine13027amain74f6fa8 / the same change on itmainc188e01APS5_PREBUILD_THREADS=16mainc188e01APS5_PREBUILD_THREADS=16APS5_PREBUILD_THREADS=1/=12main, one with this change) crashed after their first present, in a guest-side race of this title that predates both builds. Their first-present times are included.pipelineLibrary=1), but the start time doesn't change. Linking isn't the bottleneck there, so the change neither helps nor hurts.APS5_TRACE_SUMMARY_EVERY=10. Over the walking intervals:No regression.
Summary lines: PPSA15388 title screen,
APS5_TRACE_SECONDS=10:10, same machine. These are the runs whose traces are attached. Once the title is up, frame times and GPU time are unchanged:AGC tests:
maine13027a, the 39 tests matchingprebuild|registration_prepare|prepared_|shutdown_threadspass on both, with the same validation errors:vkCreateDevice-ppEnabledExtensionNames-01387×108 andVkPipelineColorBlendStateCreateInfo-pAttachments-00605×14.agc_drivertests were run withctest -V -j8onmain74f6fa8 and this change, withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1, on the RTX 4090.VUID-:vkCreateDevice-ppEnabledExtensionNames-01387×1506,VkWriteDescriptorSet-descriptorType-00337×18,VkPipelineColorBlendStateCreateInfo-pAttachments-00605×18,VkImageMemoryBarrier-image-03320×6.agc_driver_sample_order,_grid_referenceand_recipe_depth_locationsfail on both. test(agc): read the sample order tests' depth through a sampled copy #9056 and fix(agc): bind the sample order depth set after its pipeline #9503 are open for them.agc_driver_pixel_lds, with a device fault. It fails the same way onmain74f6fa8 when run alone (3 of 3 runs, and 5 of 5 on this PR withAPS5_PREBUILD_THREADS=1), so it isn't caused by this change. It passed once inmain's parallel run.agc_driver_shutdown_threads_queued_prebuildsfailed with the new default ("closing ran the queued library prebuilds"). With one blocked worker, the other workers ran the queued prebuilds. Its environment now pinsAPS5_PREBUILD_THREADS=1. All nineagc_driver_shutdown_threads*tests pass.ShaderRegistry.cppfrommain,agc_driver_registration_prepare_stackfails with "the preparation and prebuild pools count 17 live threads of the 32 they started". With this PR it passes.tools/check_conventions.pypasses.tools/env_reference.py --checkreports onlyAPS5_NO_WGI, which is undocumented onmaintoo.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)agc_drivertests and titles); AMD Radeon Pro V620, RADV Mesa 25.2.8, Ubuntu 24.04 (title start only)🤖 Generated with Claude Code
Tested and written by Claude (AI assistant) on a contributor's machine.