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:43:05 +00:00 by zmelumian972 · 1 comment
zmelumian972 commented 2026-11-30 19:43:05 +00:00 (Migrated from github.com)
Contributor

Imported from TaynanGT/Vice-Tay. Originally posted by zmelumian972 on 2026-11-30T19:43:05Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:6704763178 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/issues/472). Originally posted by [zmelumian972](https://github.com/zmelumian972) on 2026-11-30T19:43:05Z. --- **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.
TaynanGT commented 2026-11-30 23:43:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T23:43:32Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7295454829 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/issues/472#issuecomment-7295454829). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T23:43:32Z. --- 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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay#472
No description provided.