Repository navigation
d3d12: say when the driver's pipeline cache stops keeping new pipelines (RT-PIPELINE-CACHE-GROWTH-STALL) - #2062
Conversation
…es (RT-PIPELINE-CACHE-GROWTH-STALL) A driver can stop adding to a large VkPipelineCache with no error. On NVIDIA 610.88 a 1.23 GB or 1.35 GB cache came back the same size to the byte after a 2 s compile, so the next run compiles the same pipelines again and nothing says why. The runtime now takes the cache's size at creation and at each session save, counts the title's pipeline builds that took at least 200 ms, and logs once when 16 or more compiled while the cache grew less than 64 KiB. pipeline_cache_store_test covers the decision; docs/d3d12_vulkan.md records the measurements.
MSedgeMC
left a comment
There was a problem hiding this comment.
Verified on the PR branch: python3 -m unittest discover -s tests -p 'test_docs_*.py' -> 47 tests OK; the new GrowthWatch logic is backed by runtime/src/pipeline_cache_store.h:78 and runtime/src/pipeline_profile.h:46, and the standalone C++ unit test compiles and passes (g++ -std=c++20 runtime/test/pipeline_cache_store_test.cpp -> exit 0). The new docs describe the watch condition and remedy consistently with the source. Caveat: the NVIDIA 610.88 growth-stall measurements in the docs are GPU-specific observations I cannot reproduce on this host; I verified their consistency with the code, not the numbers. Advisory: branch carries 7 older commits not on main.
|
Review at
Run: this head merged onto main AI-assisted (Claude Code). |
RT-PIPELINE-CACHE-GROWTH-STALL, claimed in #1608 after the finding just above it.
What
The runtime says once, in the log, when the title's pipeline builds keep compiling but the driver's
VkPipelineCachehas stopped growing (the numbers below show the format, not a run):pipeline_profile::DriverCall(it already wraps both titlevkCreate*Pipelinescalls) always times the call and counts successful builds of at least 200 ms incompiled_builds(). A cache hit takes a few milliseconds, also while the title loads every core. Printing still needsLEONIDA_PSO_PROFILE=1.pipeline_cache_store::GrowthWatch(pure, no Vulkan) compares two cache sizes with the builds that compiled between them: 16 or more compiled and less than 64 KiB of growth reports once.LEONIDA_PIPELINE_CACHE_BYTES. The size query is the one the save already makes.docs/d3d12_vulkan.mdrecords the measurements under "Pipeline caches".Why
A driver can stop adding to a large cache without an error, and then a session file stops helping without anything saying so. Measured on an RTX 5060 Ti, NVIDIA 610.88, Windows 11 23H2:
vk_pipeline_checknamedgta6rt.exe)__GL_SHADER_DISK_CACHE=0In the game (main fe15534 + #1886): seeded with the 1.23 GB file, 68 of the ~110 builds over 200 ms in one run were over 200 ms again in the next; started with no seed, 5 of 164 were. An older cache of mostly main-set graphics pipelines stopped growing at 4.9 GB, so there is no fixed size to test against, hence a growth check instead of a size limit. #1886 measured a 1,285 MB session on an RTX 5080, still growing.
Tested
scripts/build_runtime.ps1.pipeline_cache_store_testgainstest_growth(no Vulkan, no GPU): no reference at creation, a growing cache at any size, too few builds, report once, counting from the previous save, a count that went backwards.ctest -R "pipeline_cache|compile_teardown|pipeline_workers|pso_profile|d3d12_pipeline": 10/10 pass.ctest -j 8: everything passes exceptroot_sig,d3d12_state_sweepandd3d12_pso_validation, which fail the same way on main fe15534 without this change on this machine.scripts/check_no_game_data.pyon the changed files: clean.Related: #1886 (raises the save limit, so sessions reach this size), #1756 (checkpoint scheduling; both touch
save_session_pipeline_cache, the overlap is one added line).