AGC: on NVIDIA 615.78.08 (Linux) a saved vk-pipelines file serves another process only the pipelines its writer stored first; with an empty driver shader cache one title recompiles 13 compute pipelines of 1.0-3.7 M words on every warm boot #11106
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 SleglJan on 2026-10-25T17:43:19Z.
On an RTX 3080 with NVIDIA 615.78.08 on Linux, the vk-pipelines file AnyPS5 saves serves the next process only the pipelines the writing process stored first. In one title (147 MB file, 754 entries, written by one run), nine warm runs with the driver's shader disk cache empty each report a creation-feedback miss on the same 13 compute pipelines of 1.0-3.7 M SPIR-V words. The runs started from that file or from the 757-entry files that two of them saved.
Setup
main5357acd697plus #5372 at30868735e8with its662a50bf7ereverted, plus local logging; four of item 1's nine runs also carry a local per-pipeline cache file store. Every environment variable, the local diagnostics and the tools: details below.__GL_SHADER_DISK_CACHE=0.What the title runs show
Not tested: another GPU or driver version, Windows, the driver disk cache at its default size, a single-threaded replay (which would attribute each replay variant to its own entry).
Options we see, none proposed here: keeping the driver's shader disk cache persistent (documented variables); per-pipeline files from short-lived helper processes that reach the X display (single-entry files imported in every synthetic test and in the journal replays up to 1.1 M words, one of the 13 above among them; untested inside the title process and for the other 12).
Related: #9836 (journal keeps its newest pipelines), #8309 (journal cap recompiles), #10632 (replay priority, Windows only). None reports this import behaviour.
Trees, environment and logging
Every title run:
APS5_WRITTEN_SHADOW_MAX_KIB=2048,APS5_PROFILE_DRAW=1,APS5_TRACE_SUMMARY_EVERY=60,SDL_VIDEODRIVER=x11, pad input from a file. The 754-entry file's writer also hadAPS5_PIPELINE_JOURNAL_MAX_MIB=2048; its 1,777 MiB journal is over the default 1 GiB cap, so every later run rewrote it (#9836). Trees:main5357acd697plus #5372 at30868735e8with its662a50bf7ereverted, plus one env-gated local diagnostic (unset). The runs in items 1-3 and 5 add local logging: creation feedback (VK_EXT_pipeline_creation_feedback) and the driver's duration on compute creations over 100 K words, andvkGetPipelineCacheDatasize queries around creations over 1 M words. Item 3's runs, and the run that wrote their files, add a per-pipeline cache file store (its own cache per creation, one repeat creation per export). The 754-entry file's writer and item 4's two runs used the tree without the feedback and size diagnostics. Item 2's file was written by a local test binary added with the local logging that replays the journal into an empty cache (localANYPS5_PRIME_PIPELINE_CACHE=1, localANYPS5_DIAG_JOURNAL_ORDER=largest,APS5_PIPELINE_JOURNAL_THREADS=16,APS5_PROFILE_DRAW=1,__GL_SHADER_DISK_CACHE=0, X display reachable). Item 2's title run started from the files of the run that wrote the 754-entry file, with only the vk-pipelines file replaced by this one. The journal replays below ran the same binary from the per-pipeline-store tree with localANYPS5_PRIME_PIPELINE_CACHE=1,APS5_PIPELINE_JOURNAL_THREADS=16,APS5_PROFILE_DRAW=1and localAPS5_PIPELINE_BLOBS=1, in the journal's own order, in on mode, with the X display reachable and no vk-pipelines file. Between5357acd697and upstreammain7a25f87620, PipelineCache.cpp is unchanged and PipelineJournal.cpp has only #10632 (Windows) and a static_assert.Per-run numbers
__GL_SHADER_DISK_CACHE=1,__GL_SHADER_DISK_CACHE_PATHoutside the sandbox,__GL_SHADER_DISK_CACHE_SIZE=17179869184,__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1; the filled cache was 148.8 MB in 2 files; only compute creations over 100 K words are logged (longest 633 ms in the second run).Synthetic tests (no title data; a 460-line Vulkan program and a GLSL generator, each step a fresh process)
__GL_SHADER_DISK_CACHE=0: another off-mode process is served every probed variant (6 probes, 0 to 199). An on-mode process is served the probed variants 0, 20, 50 and 80 and misses 100, 130, 150, 180 and 199.Replays of the title's journal in a separate process (sandboxed, 395 pipelines, 16 threads, on mode; one run each)
Cache data format and our reading
vkGetPipelineCacheDataon this driver returns the 32-byte Vulkan header, an entry count, then entries of a 16-byte key, a 4-byte size, a 40-byte header and the data. In every file we parsed, the entries are in ascending order of one 32-bit header field that is equal for the same key in files from different processes. So an entry's position follows its key, not when it was written; the three entries a later run added to the 754-entry file sit at indices 42, 143 and 151. A cache that has held enough data has one entry whose key ends in_NVDICT_(2,097,152 B in the title's caches, 960,701 B in the synthetic one); its content differs between caches filled by different processes, and a file AnyPS5 saves keeps the dictionary entry of the process that first wrote it (the two 757-entry files of item 1, saved from a live cache created from the 754-entry file, carry that file's; item 5's, whose writer started without a vk-pipelines file and merged its later saves into its own earlier file, carries its own). In the synthetic 200-variant cache, 97 entries are 240-242 KB (a single-variant export is 240 KB) and 103 are 7.6-35 KB. We read this as: from some point a process compresses the entries it writes with that dictionary, and another process with the driver's disk cache on uses only the entries written before that point. The format is undocumented, the point is not a fixed size (the writer in item 2 added its dictionary entry between 5.3 and 12.8 MB of cache data; the synthetic writer holds 97 full-size entries, about 23 MB), and the reading does not explain why an off-mode reader was served every probed variant of the synthetic cache but, from the off-mode title file, only the first compute pipeline over 1 M words its writer stored. For a helper-process design: on this driverpipelineCacheUUID's last 8 bytes differ for a process that cannot reach the X display, so a headless helper writes data under a pipelineCacheUUID the windowed title's device does not report.AI-assisted: yes (Claude Code)