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

Open
opened 2026-11-30 19:44:33 +00:00 by github-bot · 2 comments
Owner

@⁠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/wine directly, vkd3d-proton v3.1-83 as bundled. main adaa77a3, 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 warm and --preload did not change this. On Windows #423 reports the same symptom as fixed on adaa77a3; on Linux it is not.

Three causes found (each measured)

  1. 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=never alone 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 in pipeline::library::library(), branch on my fork, not pushed) fixed it:

    Run Library Pipeline waits ("waited its most") 5 s reports under 10 fps after first frame Compiler share in the world
    11 on, LOADS=never 3 many (0.4-5 fps for ~45 s) 79%
    12 off (first launch) 0 0 not in the profile
    13 off (next launch) 0 0 not in the profile

    Steady play after that: 21-36 fps (mean 27).

  2. 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 /desktop loads 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 start explorer.exe /desktop first with __GL_SHADER_DISK_CACHE=0 before running the game in the same wineserver. Checked with /proc/<pid>/fd: the game then holds the main file and the desktop holds none.

  3. vice-tay warm cannot 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 --these workers 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

  • Hard-linking or copying a cache .bin/.toc into another __GL_SHADER_DISK_CACHE_PATH makes the driver reset the file in place on first open (a hard link then wipes the original too).
  • No Xid in any of 13 launches with 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 on main now.

Logs (runs 4-17) and the scripts are kept locally; I can attach any of them.

**@⁠zmelumian972** on GitHub · 2026-11-30 19:43 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/472) **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/wine` directly, vkd3d-proton v3.1-83 as bundled. `main` `adaa77a3`, 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 warm` and `--preload` did not change this. On Windows #423 reports the same symptom as fixed on `adaa77a3`; on Linux it is not. ### Three causes found (each measured) 1. **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=never` alone 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 in `pipeline::library::library()`, branch on my fork, not pushed) fixed it: | Run | Library | Pipeline waits ("waited its most") | 5 s reports under 10 fps after first frame | Compiler share in the world | |---|---|---|---|---| | 11 | on, `LOADS=never` | 3 | many (0.4-5 fps for ~45 s) | 79% | | 12 | off (first launch) | 0 | 0 | not in the profile | | 13 | off (next launch) | 0 | 0 | not in the profile | Steady play after that: 21-36 fps (mean 27). 2. **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 /desktop` loads 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 start `explorer.exe /desktop` first with `__GL_SHADER_DISK_CACHE=0` before running the game in the same wineserver. Checked with `/proc/<pid>/fd`: the game then holds the main file and the desktop holds none. 3. **`vice-tay warm` cannot 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 `--these` workers 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 - Hard-linking or copying a cache `.bin`/`.toc` into another `__GL_SHADER_DISK_CACHE_PATH` makes the driver reset the file in place on first open (a hard link then wipes the original too). - No Xid in any of 13 launches with `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 on `main` now. Logs (runs 4-17) and the scripts are kept locally; I can attach any of them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 19:44:33 +00:00
Author
Owner

@⁠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>/fd to 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=0 turns the library off anywhere and =1 keeps it under Wine, in case some setup does better with it. Windows is untouched. It's detected through ntdll's wine_get_version plus 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:

  • Cause 2 (explorer.exe taking the main cache file) lives in the launcher, and there's no Linux launcher on main right now. A short doc with your two steps, the game's own __GL_SHADER_DISK_CACHE_PATH and explorer.exe /desktop started first with __GL_SHADER_DISK_CACHE=0, would be very welcome as a PR. Somewhere like docs/linux.md is fine.
  • Cause 3 (vice-tay warm filling 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 main without VICE_TAY_LIBRARY=0 and confirm you get the same as your runs 12 and 13? I'll leave this open until then.

**@⁠TaynanGT** on GitHub · 2026-11-30 23:43 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/472#issuecomment-7295454829) This was a really useful write-up. Measuring the library on and off, and checking `/proc/<pid>/fd` to 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=0` turns the library off anywhere and `=1` keeps it under Wine, in case some setup does better with it. Windows is untouched. It's detected through ntdll's `wine_get_version` plus 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: - **Cause 2** (explorer.exe taking the main cache file) lives in the launcher, and there's no Linux launcher on `main` right now. A short doc with your two steps, the game's own `__GL_SHADER_DISK_CACHE_PATH` and `explorer.exe /desktop` started first with `__GL_SHADER_DISK_CACHE=0`, would be very welcome as a PR. Somewhere like `docs/linux.md` is fine. - **Cause 3** (`vice-tay warm` filling 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 `main` without `VICE_TAY_LIBRARY=0` and confirm you get the same as your runs 12 and 13? I'll leave this open until then.
Author
Owner

@⁠zmelumian972 on GitHub · 2026-12-01 18:37 UTC · original

Checked current main (65b9beaa, release, no VICE_TAY_LIBRARY set) on the same Linux setup: 1440p, DLSS off, --set VICE_TAY_BVH_BUILDER=0 --framegen 0 to 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 my VICE_TAY_LIBRARY=0 build.

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:

launch build pipeline waits driver cache after
1 (empty cache) main 6, 61 s –
2 main 5, 53 s 355 MB
3 main 6, 56 s (one frame 28 s) 539 MB
4 3aad3bf3 + VICE_TAY_LIBRARY=0 4, 45 s (one frame 29.5 s) 668 MB

Each 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 main stopped 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.

**@⁠zmelumian972** on GitHub · 2026-12-01 18:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/472#issuecomment-7321249297) Checked current `main` (`65b9beaa`, release, no `VICE_TAY_LIBRARY` set) on the same Linux setup: 1440p, DLSS off, `--set VICE_TAY_BVH_BUILDER=0 --framegen 0` to 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 my `VICE_TAY_LIBRARY=0` build. 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: | launch | build | pipeline waits | driver cache after | |---|---|---|---| | 1 (empty cache) | main | 6, 61 s | – | | 2 | main | 5, 53 s | 355 MB | | 3 | main | 6, 56 s (one frame 28 s) | 539 MB | | 4 | `3aad3bf3` + `VICE_TAY_LIBRARY=0` | 4, 45 s (one frame 29.5 s) | 668 MB | Each 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 `main` stopped 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.