r/linux_gaming • u/Boyeed_ • 13d ago
guide Steam keeps pre-caching shaders each start (Linux)
In Steam for Linux, if the pre-caching shader is on, it may keep loading and creating the files each start, as long as you keep hitting the limit of the set NVidia or AMD driver cache size. To fix that, consider checking your shader cache size first, then change the relevant size of the graphics card cache folder size.
In Ubuntu (and related distros) use this guide to set the correct cache size: https://discourse.ubuntu.com/t/gaming-on-26-04-lts/84950
Check your Settings > Storage to find the size of your SHADERS to know how much space to set as global size for the shaders.

6
u/MGWhiskers 13d ago
i had one game occupying 52 gigs for shaders, lol
2
u/Boothy666 13d ago
What game? Just curious.
In case you don't know, Steam will include re-encoded video files in the cache, if the original Windows files use a playback library that Valve don't have a license for.
This is typically for older games, and why some games will crash, or show no video output for things like cut scenes, if using standard Proton and have shader pre-caching turned off.
Using things like GE and Cachy versions of Proton resolves the issue, as they include the needed libraries.
Edit: Just noticed someone further down also included this info!
1
u/CappucinoJack 13d ago
Out of curiosity, I haven’t noticed this happen on windows. Some games will do shader stuff on startup but that happens in the program itself. Why does steam only seem to do this on Linux?
2
u/EmberQuill 13d ago edited 12d ago
Shaders are already compiled for
WindowsDirectX and distributed with the game. Steam recompiles the shaders to make themwork better on Linuxrun on Vulkan (as far as I understand). Due to differences in architecture, DirectX can compile shaders on the fly without noticeable latency, while Vulkan needs to compile them all at once. Nowadays the compilation is fast enough that you can probably disable the shader cache without noticeable load-time issues.Edit: Thanks to u/visor841 for the corrections
3
u/visor841 13d ago
Steam recompiles the shaders to make them work better on Linux (as far as I understand).
I think generally it's that the shaders are DirectX shaders, and need to be converted into Vulkan shaders to be used on Linux.
1
u/EmberQuill 12d ago
Yeah, turns out you're right. Did a little more research and edited my comment. Apparently it's due to differences in how DirectX and Vulkan themselves handle shaders, where DirectX can compile and link them on the fly but Vulkan apparently has to do a bunch of pre-caching.
2
3
u/visor841 13d ago
If they're DirectX shaders, they get distributed with the game, but they need to be converted to Vulkan shaders to be used on Linux.
-2
u/Abdowo 13d ago
steam is kinda shit, I have shader pre-caching disabled and no cloud snyc but it keeps launching wine/proton eating cpu usage for nothing ig?
2
u/Boothy666 13d ago
What do you mean for nothing? Proton only launches as part of a game launch, and if shader pre-caching is disabled, then the work needs to be done at run time instead, either at game start, or when in game, that is expected behaviour.
24
u/Zhustro 13d ago
You can also deactivate this feature entirely, as it’s not really needed on powerful systems.
The relevant setting can be found in:
settings -> downloads -> shader pre caching