Warmed pipelines don't reach the title, and the title's own aren't kept for the next launch (RTX 3060) #423
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
old-names
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay#423
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?
@Indy2l on GitHub · 2026-11-28 15:53 UTC · original
i5-12400F / RTX 3060 12 GB (driver 621.40) / 16 GB, Windows 11, Series S,
-Machine 3060, diag build ofmainfe7c6e5, prologue save.What happens
Pipelines that
victory warmcompiles do not reach the running title, and pipelines the title compiles while it plays are not there at its next launch. Every launch after a translator change, warmed or not, rebuilds the same pipelines in play. On this PC that keeps the world black for several minutes (see #422).Measured
Before each run, the driver's shader cache files for
victory.exe(%LOCALAPPDATA%\NVIDIA\DXCache\*a9d9d953f4*) and the cache directory'spipelinesfolder were removed. Shader translations were kept.made=)-WarmPipelines(victory warm --used: 1,963 made in 309 s, median 388 ms)So the warm compiled the route's pipelines and the driver stored them, yet the title compiled almost all of them again at full cost. The queue drained at about the same rate as in the cold run.
Related observations
victory warm --used --again --limit 200straight after a warm: in the first round most pipelines compiled again (median 94 ms, p99 14.9 s). In the second round all 200 came back in 1 s. A third full--used --againpass over 2,623 pipelines was again at full cost (median 139 ms). So the driver keeps some warm results and not others, and it is not clear why.16edfec), after full warms, runs started with an empty queue (made pipelines came back at once). After the translator change infcded4ethat never returned, through several launches and two full warms. Vice-Tay's driver cache files had grown to 22.8 GB by then. After I deleted them, recovery over later launches was gradual.pipeline::library::allows_static_samplerskeeps about half the route's pipelines out ofhost-pipelines.bin, so they rely on the driver cache alone. WithVICTORY_LIBRARY_STATIC_SAMPLERS=1a second launch loaded 2,501 and built 168. That confirms the missing pipelines are those, but I did not keep the setting, given the sampler-order risk the comment describes.ExitProcessinstead ofTerminateProcess(a local test) made the driver write its cache at exit, but it did not change the next launch.Not known
Why the title process does not get the warm's driver cache entries. The settings are the same (the warm runs from
play.ps1with the same environment), andVICTORY_D3D12_DRED=faultsis on in both. A comparison of the pipeline descriptions the warm builds with those the title builds for the same key would tell whether they differ.🤖 Generated with Claude Code
@Kal0s-design on GitHub · 2026-11-28 16:12 UTC · original
I think the missing half is the same thing #395 is about, and your own numbers fit it.
victory warmmakes pipelines in worker processes, 40 each (AT_ONCEinapps/victory/src/warm.rs), several at once. On NVIDIA a pipeline with static samplers depends on the order its process first made those samplers (that's the comment onallows_static_samplers). Each worker meets its own 40 pipelines, so it numbers the samplers its own way, and the title numbers them differently again. If the driver's cache entry or compiled code carries that numbering, what the warm stored can't be reused by the title, and it would only be the static-sampler pipelines, i.e. the half that stays out ofhost-pipelines.bin.That would also explain the
--againrounds:--limit 200twice in a row: same 200 pipelines, same split into workers, same order inside each, so the same sampler numbering both times, and the second round came back in 1 s.--used --againpass over 2,623: a different set per worker than any earlier run, so a different numbering, and full cost again.fcded4eit worked, possibly because the cache files were all written under one numbering that kept repeating; after the translator change every key was new and the per-process orders no longer lined up.The last one is a guess. The first two follow from how the workers are cut.
#395 makes every process create the listed samplers first, in the list's order, right after the device exists (
pipeline::samplers::primeinHostcreation). Warm workers go through the sameHost, so with it the warm and the title should number samplers the same way, as long as the workers see the same cache folder and itsstatic-samplers.txt. The list file is opened exclusively, so parallel workers appending to it shouldn't corrupt it.So a cheap check is your run 44 again on #395: cold driver cache,
-WarmPipelines, then play, and see whether the queue drains much sooner than 480 s.made=will probably stay high either way, since with thepipelinesfolder cleared a driver cache hit still counts as a make, it's just fast. One thing this doesn't cover: if pipelines without static samplers were also slow in run 44, there's a second cause on top. The per-pipeline times in the log would show which ones paid.I haven't run any of this myself, it's from reading the code.
AI-assisted: yes
@Indy2l on GitHub · 2026-11-28 18:13 UTC · original
Follow-up, tested on #395 (same PC, same route, base
fe7c6e5):The sampler order is not what keeps warm results from the title here. With
static-samplers.txtholding all 22 samplers, so that every warm worker and the title make them in the same order, and with a cleared driver cache andpipelinesfolder,-WarmPipelinesbuilt 1,982 pipelines (median 404 ms). The title then made 1,814 in play, and the queue emptied about 7 minutes into the world, the same as without #395 (run 44: 1,827, about 8 minutes).What #395 does fix is the launch after that. With the samplers listed, the static-sampler pipelines are stored in
host-pipelines.bin(17 to 125 MB), and the next plain launch loaded 2,023 and made 28, with no queue and no black start. Textures were unchanged againstmain(details on #395).So two separate problems remain open here:
victory warmresults do not reach the title through the driver cache even with matching sampler order. During 11 minutes of play the title wrote nothing to the driver cache files either.🤖 Generated with Claude Code
@TaynanGT on GitHub · 2026-11-29 11:35 UTC · original
Thanks for separating the two cache problems. The 2,023 loaded vs 28 rebuilt pipelines on the next launch is useful evidence for #395, but the warm-to-title handoff remains unresolved. I'd inspect cache identity and driver writes independently of sampler ordering.
@Indy2l on GitHub · 2026-11-29 13:00 UTC · original
Following up on cache identity and driver writes, same PC and route, base
fe7c6e5(no #395).The pipeline record is current. A fresh
VICTORY_PIPELINE_BOOK=1run, with the oldknown-*.binmoved aside, recorded the same 83,559 pipelines and 19,104 shaders byte for byte (only the order differs). Sovictory warmbuilds from what the title creates today.Warm and title hand the driver identical pipelines. I added local logging, not for upstream, to
HostPipeline::new: each process writes one line per host pipeline, with the title's shaders and state, hashes of the serialized root signature and of each stage's DXIL (including the rectangle GS), the library flag, the library name, and the time the create or load took. In a-WarmPipelinesrun, all 2,647 pipelines that both the warm workers and the title made were identical in every field.The driver cache does reach the title, except for most static-sampler pipelines. In a second run I moved
host-pipelines.binaside after the warm, so every pipeline had to come from the driver cache or be compiled:So the warm works for pipelines without static samplers: they come back in under a millisecond. The roughly 440 slow ones all have static samplers. Their root signature decides it: of 248 static-sampler root signatures, 60 were always slow, 184 always fast and 4 mixed. The slow ones hold more samplers (mostly 5 to 8, against 1 to 3 for the fast ones). No sampler kind appears only in slow roots. Between two warm runs, worker to worker, it was the same: static-sampler pipelines were compiled again, the others were mostly cheap.
What that does to a launch. With the warm, there was no black start: the scene was recognizable from the first world frame, and draws dropped for a missing pipeline were down to the ray-tracing ones (about 290 a frame) within about 90 s. But the picture still took minutes to fill in. That matches the remaining queue: about 860 s of static-sampler compiles on 3 workers, which kept 200 to 800 pipelines in the queue for about 5 minutes, at a median of 3.3 fps (8.0 with an empty queue). Launches whose queue was empty from the start filled in much sooner. I can't yet say how the queue spoils the picture while nothing beyond the ray-tracing draws is dropped. Texture streaming was the same in both kinds of launch.
Driver writes. The warm's writes grew Vice-Tay's driver cache files from 3.36 to 5.02 GB. The last write came as the warm finished. The title wrote nothing to them during 7 minutes of play.
This fits the per-process static-sampler indices #395 deals with. My guess is that the driver keys or validates those entries by the process's sampler state, and that more samplers make a match less likely. It doesn't explain why the earlier #395 run (all 22 samplers listed, the same order in every process) didn't drain the queue faster. The title also makes the descriptor-heap samplers that the warm workers never create, which could shift those indices. I haven't tested that.
What follows for "precompile once per update" on NVIDIA: the warm can't hand these pipelines over through the driver cache. A warm that stores them in
host-pipelines.bin(in one process, with #395's fixed order) would. #395's second launch (2,023 loaded, 28 made) already shows that route works once they are in the library.@marekpastuszczak-lang on GitHub · 2026-11-29 13:38 UTC · original
I reproduce the original report on a second PC, and warming from one process, without the
victory warmmaster, makes the results reach the title here.Setup. Windows 11, RTX 5070 Ti 16 GB (driver 616.56), i9-9900K, 32 GB. Series S profile, 3840×2160 output, DLSS Quality, frame generation, 3 pipeline workers.
fe7c6e52with #329, #370 and #395 merged locally, plus the two local changes below. Each variant ran under its own copy of the exe with a new name, so each started with an empty driver cache without deleting anything. Cache folder: translated shaders,known-pipelines.bin,known-shaders.bin,early-pipelines.txt,static-samplers.txt(25 entries), nohost-pipelines.bin.In the title (warm of 2,550 pipelines, then 6 minutes from the same save):
victory warm --usedas it is (10 processes)The title added no driver cache file of its own in any of the three.
Without the title (a later single process asks the driver for the same 2,550; times per pipeline, 12 threads):
victory warm --usedas it isSo on this PC nothing from the stock warm comes back, not even pipelines without static samplers: it is indistinguishable from a cold cache. That differs from @Indy2l's result above, where pipelines without static samplers did come back from the warm. I don't know why (driver 621.40 there, 616.56 here, or something else). After the one-process warm about 130 of 2,550 still take over 100 ms; I did not split them by static samplers.
A hypothesis, not traced: the driver gives processes of the same exe that run side by side separate cache files (10 new file pairs after the 10-process warm, 1 after the single process), and a later single process does not read what the workers wrote. The master creates a D3D12 device before starting any worker (
known::fingerprint()callshost()for the driver version) and keeps it for the whole warm, so it may be holding the file a later process opens. @Indy2l's numbers don't fit this fully, so treat it as a lead.The two local changes
known::makecompiles withVICTORY_WARM_THREADSthreads inside one process and still reportsat/madein the requested order. A script callsvictory warm --these …directly in batches of 256, one process at a time, so nothing else holds a device. All 83,562 recorded pipelines took about 70 minutes this way, with no process failures.pipeline::samplersfalls back toVICTORY_SAMPLER_DIRwhen there is no library folder, becausewarmworkers never set one, so with #395 as it is they do not readstatic-samplers.txt. C shows this alone changes nothing here; I have not tested B without it.Possible directions for
victory warm: no D3D12 device in the master (or get the fingerprint from a short-lived child), and threads in one worker process at a time instead of processes side by side. Storing the warmed pipelines straight intohost-pipelines.bin, as suggested above, would not depend on the driver cache at all; VIctory-NVIDIA has such a path (VICTORY_WARM_SHARED,preload), which I have not measured in isolation.I can share the patch if useful.
AI-assisted: yes (measured and written with Claude Code).
@TaynanGT on GitHub · 2026-11-29 14:39 UTC · original
Thanks for the single-process measurements. I have a local implementation of parallel pipeline warming with a single persistent library writer (
a6fc5a52a), and further work on the cache handoff is in progress. Your driver-cache observations support testing this route, but the title reusing the warmed library and persisting new pipelines still need to be verified separately.@TaynanGT on GitHub · 2026-11-30 17:00 UTC · original
mainhas moved to a new line of the code and everything is now named Vice-Tay:vice-tay.exe play, andVICE_TAY_*switches instead ofVICTORY_*(details in #468). Could you check whether this still happens on the currentmainand say so here, with a log if you can?@Indy2l on GitHub · 2026-11-30 18:41 UTC · original
Checked on the current
main(adaa77a3): this no longer happens. Warmed pipelines reach the title, and the ones it makes while playing are there at its next launch.Same PC (i5-12400F, RTX 3060 12 GB, 16 GB, Windows 11),
vice-tay.exe play --series-s --dlss offwith the built-in settings, diag build, prologue save. The pipeline cache started from the old line's book; nothing was cleared.play --preload: 25,985 shaders in about 3 min, then the 3,306 used pipelines into the library in 870 sOn the old
main(fe7c6e5) the same route made about 1,800 pipelines in play whether warmed or not, and the queue took 8 to 10 minutes to empty. Here the library is loaded at the start (3,081 loaded in run85, about 8 ms each) and what the title adds is kept for the next launch. That fits the static samplers now being in one order (pipeline::samplers), so those pipelines can go into the library instead of relying on the driver cache.From my side this can be closed. Logs available if you want them.
AI-assisted: yes
@TaynanGT on GitHub · 2026-11-30 23:43 UTC · original
Thanks for going back and measuring it on the new line instead of just saying "seems fine". 131 made in play on the first launch and 17 on the second, against ~1,800 every time on
fe7c6e5, is the answer.Closing this one. If the queue starts refilling at every launch again, reopen it with the log from two launches in a row.