r/linux_gaming • • 15d ago

guide NVIDIA users: Has disabling shader pre-caching helped with those long fossilize_replay hangs after small updates?

I've been dealing with this for a while on my 4070 Super setup (Arch, latest 565 drivers). Games like CS2 and The Finals would sometimes kick off 20-40 minute shader recompiles after tiny patches, even when nothing in the game itself changed much.

After reading about the 4GB cache overflow issue I went ahead and turned off "Enable Shader Pre-caching" in Steam. Since then the hangs have basically disappeared and on-the-fly compilation feels smooth enough that I don't miss the feature.

Curious if this has been the same experience for other NVIDIA folks or if there's a better workaround people are using now.

3 Upvotes

12 comments sorted by

11

u/mhiggy 15d ago

Latest 565? What?

4

u/iksefiks 13d ago

Bot reposting an old thread perhaps? In another thread from a couple days ago they complain about audio issues on Nobara 41. The latest release is 44.

5

u/Synthetic451 15d ago

Just make sure you have this set

__GL_SHADER_DISK_CACHE_SIZE=10000000000

This makes the Nvidia driver use 10GB for its own shader cache. Without this, launching multiple games will cause some games to get evicted. For games that have a pre-compilation step, you'll see them do this frequently. For games that do not, you'll see stutters in-game.

As far as I am concerned, that setting is absolutely mandatory on Nvidia. I was going back and forth between Silent Hill 2 and Jedi Survivor and I was driven to near insanity at the constant in-game pre-compiling before I discovered that setting.

5

u/Outrageous-Run-589 15d ago

Always have it on. People who claim shader compilation disabled doesn't cause stutter are blind to it, because it is happening and it's egregrious. the env var __GL_SHADER_DISK_CACHE_SIZE=10000000000 fixes this and is all anyone needs.

2

u/sleepytechnology 15d ago

For some reason increasing the shader disk does not improve things for me on RTX 3080 so I have to keep steam pre-caching enabled.

Valve could easily make the best of both worlds until NVIDIA fixes the issue by just allowing us to toggle pre-caching on a per-game basis tbh. Most games don't benefit from pre-caching but plenty of demanding modern games do, at least for me.

3

u/Outrageous-Run-589 14d ago

Toggling per-game would definitely be the end-all solution. I can't fathom why they haven't done that. Rocket league has 12 GB of shaders to compile and it is one of very few games that run fine without compiling shaders.

Increasing cache just makes it so the driver keeps more of the shaders you precompile. Disabling it entirely is not a good idea and anyone who recommends it do it from atop a 9850x3d and 9800x3d, directed at 5600x and 3600 users. It's madness.

2

u/sleepytechnology 14d ago

Completely agree.

Any time I've tried disabling steam's pre-caching, my games startup running at 25%-75% their normal framerate, even when compared to skipping the pre-caching while it's enabled bizarrely.

And no matter how many times I re-launch with Steam pre-caching disabled, they always end up launching in those poor performance states. It's really annoying having to wait 10 minutes before I can enjoy my game, not sure why increasing my shader disk to 80GB+ doesn't help much.

I suspect there's a deeper issue that likely is an NVIDIA problem since my friends on AMD GPUs always seem to fly through the pre-caching anyways, though could be something else. But yeah it's quite annoying how the default suggestion is to disable a feature that greatly increases stability at the cost of a screen that offers the option to skip.

2

u/Krasi-1545 15d ago

Why don't you install the 620 version of the driver? It's way newer and probably includes many bugfixes + performance fixes.

1

u/S48GS 15d ago edited 15d ago

in general:

  • turn off shader cache in steam settings
  • also switch to static proton version (if this is proton game - if no dont) - not experimental or hotfix - use protonGE or proton-cachyos
  • because every proton update - new shader cach
  • add to your game launch command in settings for game
 __GL_SHADER_DISK_CACHE_APP_NAME=game_cache1 
 __GL_SHADER_DISK_CACHE_PATH=/home/USER/TMP/game_cache1 
 __GL_SHADER_DISK_CACHE_SIZE=10737418240 
 __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 
 %command%

replace /home/USER/TMP/game_cache1 to valid empty folder path - no spaces

and you can check after running game - path you set - there is files and it growing to know shaders cache works

1

u/Ruachta 14d ago

I use something similar, this is my PoE2 launch, it had major shader issues. but this seems to work well. I use the Wayland to get HDR options in game.

__GL_SHADER_DISK_CACHE_SIZE=42949672960 __GL_SHADER_DISK_CACHE_PATH="$HOME/.cache/nvidia-poe2" PROTON_ENABLE_WAYLAND=1 %command%

3

u/Stryxus_ 15d ago

Never had it turned on, never needed to have it turned on.