Nvidia Shader Caching doesn't really work?
A question to Nvidia GPU owners. Have you noticed that shader caching doesn't really work on Windows?

For example let's take a look at Devil May Cry 4 Special Edition, a game where shader compilation causes visible stutters and can be easily reproduced time and time again: You run a benchmark and notice that when those fire dogs spawn for the first time you get a guaranteed frametime spike. That's a shader compilation happening right there.

Now, after shaders have been compiled the next time fire dogs spawn again, they don't cause any frametime spikes. That is until you restart the benchmark/restart the game/change level. Then once again the game compiles the same shaders and causes a one time frametime spike. Rinse and repeat.

Nvidia's Shader Cache is supposed to combat that issue by... Caching shaders. The problem is that for some reason shader cache on vs off doesn't really make any difference in games which have that problem. Technically, when Shader Cache is turned on it does SOMETHING; I can see a bunch of .nvph files created in AppData/Local/NVIDIA/DXCache folder, but on practice those cache files turn out to be meaningless.

For example if I delete shader cache completely, then turn it back on and launch Devil May Cry 4 Special Edition, shader cache creates a 4KB .nvph, and that's it. It never grows bigger after playing the game. It doesn't create any additional files. And of cource the game stutters every time it compiles the new shaders.

The thing is I have seen at least one person who claimed that shader caching actually works for them in that particular game (ie they get stutters when shaders are being compiled for the first time as everybody else, but afterwards shader caches do its job to properly combat further frametime fluctuations), but that person was playing on Linux.

So, once again, does shader caching work for anyone on Windows 10/11? If yes, what gpu and gpu driver version do you have?
Last edited by PainkilleR; 3 Jul @ 9:35am
< >
Showing 1-2 of 2 comments
Lixire 3 Jul @ 9:37am 
it was completely broken for me on 576.02 with some games. like I could play CS2, close the game, restart PC and again it does "compiling shaders" when loading into the same map I was in before the restart

However now it works as intended after the recent NVIDIA drivers, I'm on RTX 5080 running driver 576.88 on Windows 11 24H2
Some games store the shader cache in its own folder; sometimes within the folder structure that holds the game config and saved games in the appdata or user folder somewhere. It's not always going to store that in the NVIDIA appdata folder.
Have you set NVIDIA Shader Cache to Unlimited? If not then there you go.

But yes this can often be a driver issue, DDU wipe out everything in safe mode each and every time and avoid new drivers when things are stable. If you must move to a newer driver, again DDU wipe and clean install it every time. Keep the installer for the older driver just in case you need to go back to that for some reason.
< >
Showing 1-2 of 2 comments
Per page: 1530 50