Linux / GE-Proton11-14 (RTX 5090): pipelines are compiled again every launch; the driver's disk cache is never hit through the host pipeline library #472
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#472
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?
@zmelumian972 on GitHub · 2026-11-30 19:43 UTC · original
Setup. CachyOS, kernel 7.3.6, RTX 5090 32 GB, driver 620.73.04, Ryzen 7 9800X3D, 62 GB. GE-Proton11-14 (viewtree wineserver) run through
files/bin/winedirectly, vkd3d-proton v3.1-83 as bundled.mainadaa77a3, release build,vice-tay play --res 1440 --dlss off --set VICE_TAY_CODE_TABLE_AFTER=1(#428), saved game that loads straight into the world.What happens
Every launch spends its first ~45 s at 0.4-5 fps, and later areas freeze again, while NVIDIA's compiler (
libnvidia-gpucomp.so) takes 74-79% of the process's CPU (perf, 5 s samples). The driver's cache file grows by 70-170 MB on each launch, so the same work is redone and stored again every time.vice-tay warmand--preloaddid not change this. On Windows #423 reports the same symptom as fixed onadaa77a3; on Linux it is not.Three causes found (each measured)
Pipelines made through the host pipeline library are not reused by NVIDIA's disk cache. The same library names were "slow load"s (2.8-5 s each) in consecutive launches: 44 of 52 in run 8 had been slow in run 7 too. Made without the library, the same driver's cache works:
vice-tay warm --these <600 indices>in one process took 25.3 s of compile time, then 0.7 s in a new process (median 1.06 ms → 0.30 ms). That held in an 856 MB cache file, so cache size is not it.VICE_TAY_LIBRARY_LOADS=neveralone did not help (pipelines are still stored through the library and recompiled next launch). A local switch that skips the library entirely (VICE_TAY_LIBRARY=0, 8 lines inpipeline::library::library(), branch on my fork, not pushed) fixed it:LOADS=neverSteady play after that: 21-36 fps (mean 27).
NVIDIA's Linux cache gives each concurrently running process its own file, and a later process only reads the first ("main") file well. Wine's
explorer.exe /desktoploads the driver, opens the cache and takes the main file whenever the game starts it (it inherits the game's environment), so the game is pushed to a side file. Fix in my launcher: give the game its own__GL_SHADER_DISK_CACHE_PATH, and startexplorer.exe /desktopfirst with__GL_SHADER_DISK_CACHE=0before running the game in the same wineserver. Checked with/proc/<pid>/fd: the game then holds the main file and the desktop holds none.vice-tay warmcannot fill the main file. Its parent process creates a full D3D12 device (known::fingerprint()→host(), and the translator key's host settings), takes the main file, and only coordinates; its--theseworkers land in side files the game never reads. Probes over the used list ran at 2-2.8 pipelines/s (cold compiles) even after the game itself had filled the main file. Changing the cache variables for the workers from the parent (Command::env/env_remove) does not reach a Wine child's driver, so that cannot fix it. A fix would have the parent avoid opening the device (for example, take the fingerprint from the first worker), or warm in one process.Also worth knowing
.bin/.tocinto another__GL_SHADER_DISK_CACHE_PATHmakes the driver reset the file in place on first open (a hard link then wipes the original too).VICE_TAY_CODE_TABLE_AFTER=1(#428).Proposal
On Linux NVIDIA (vkd3d-proton), run without the host pipeline library by default, or offer
VICE_TAY_LIBRARY=0, and rely on the driver's disk cache. I can open a PR with the switch if that is the preferred direction. The Linux launcher steps for cause 2 could go into the docs, since there is no Linux launcher onmainnow.Logs (runs 4-17) and the scripts are kept locally; I can attach any of them.
@TaynanGT on GitHub · 2026-11-30 23:43 UTC · original
This was a really useful write-up. Measuring the library on and off, and checking
/proc/<pid>/fdto see who actually holds the main cache file, made the call easy.Cause 1 is in #485, now on
main, and it went the way you proposed. Under Wine on an NVIDIA card no host pipeline library is kept by default, so pipelines come from the driver and its disk cache.VICE_TAY_LIBRARY=0turns the library off anywhere and=1keeps it under Wine, in case some setup does better with it. Windows is untouched. It's detected through ntdll'swine_get_versionplus the adapter's vendor id, and the start of the log says when it kicks in (no host pipeline library (VICE_TAY_LIBRARY)). I didn't wait for your branch since it's only a few lines, but thanks for offering.What it doesn't do:
mainright now. A short doc with your two steps, the game's own__GL_SHADER_DISK_CACHE_PATHandexplorer.exe /desktopstarted first with__GL_SHADER_DISK_CACHE=0, would be very welcome as a PR. Somewhere likedocs/linux.mdis fine.vice-tay warmfilling side files) isn't changed. Your read of it looks right to me: the parent opens a full device for the fingerprint. Taking the fingerprint from the first worker sounds like the cleaner fix. I haven't done it because I can't measure it here, and without that I'd just be guessing. If you want to take it on, go for it.I don't have a Linux box, so the default is untested here beyond the unit tests. Could you run current
mainwithoutVICE_TAY_LIBRARY=0and confirm you get the same as your runs 12 and 13? I'll leave this open until then.@zmelumian972 on GitHub · 2026-12-01 18:37 UTC · original
Checked current
main(65b9beaa, release, noVICE_TAY_LIBRARYset) on the same Linux setup: 1440p, DLSS off,--set VICE_TAY_BVH_BUILDER=0 --framegen 0to match the earlier runs, 180 s of play per launch.The default works as described: every launch logs
no host pipeline library (VICE_TAY_LIBRARY) ... wine=true nvidia=true, and it behaves the same as myVICE_TAY_LIBRARY=0build.But I couldn't reproduce runs 12/13's clean result, on either build. With a different save than those runs (theirs was overwritten), warm launches still wait for compute pipelines:
3aad3bf3+VICE_TAY_LIBRARY=0Each warm launch drops under 1 fps from about 45 s to about 95 s and adds 130–170 MB to the driver cache, so some compute pipelines still miss NVIDIA's disk cache even without the library. Keeping the library off by default is still right; it isn't worse than the switch. But it doesn't remove all the recompiles in this scene. I'll try to find which pipelines miss the cache and why.
Separately: 2 of 5 launches of
mainstopped on the title's own breakpoint 4 s after start (image+0x31f51, exit 3), before any world load. It didn't repeat in the next launches, and I have the crash logs and dumps if useful.