Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal. You can also buy games using our partner links for GOG and Humble Store.
We do often include affiliate links to earn us some pennies. See more here.

Valve's shader cache system can be extremely helpful for Linux gaming, however it can also at times be quite problematic but Valve may have solved a big problem with it.

The idea behind the system is that you're supposed to see small regular downloads for the shader cache of each game, as Valve continue to build it up and then spread it out to everyone to help improve game performance on Linux and Steam Deck. However, over the years quite a lot of people have reported how it kept giving full downloads of the whole thing instead of being incremental.

Writing on the GitHub bug report from 2021 today, Valve developer Pierre-Loup Griffais said:

Shader cache downloads are designed to be incremental. Reports here indicate a daily download of the full shader cache file size, which is inconsistent with expectations - a small download and full disk write is expected instead.

After looking at the logs shared on this issue and on #9200, we've investigated and found a server-side problem with the system that keeps track of the ordering of shaders in those updates.

We've just rolled out an initial fix and will continue to monitor the situation. If the issue persists, please comment on this report and attach your shader_log[.previous].txt as indicated above.

Hopefully now fewer people (or no one) will see the issue but do let them know on the bug report if it happens to you.

Article taken from GamingOnLinux.com.
Tags: Misc, Steam
37 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly checked on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly.
See more from me
The comments on this article are closed.
All posts need to follow our rules. For users logged in: please hit the Report Flag icon on any post that breaks the rules or contains illegal / harmful content. Guest readers can email us for any issues.
22 comments
Page: 1/2»
  Go to:

Schattenspiegel Feb 15, 2023
that would be really nice if it was fixed. though i always wondered why they did not simply specify a reasonable cooldown timer per game once the cache has been downloaded once.


Last edited by Schattenspiegel on 15 February 2023 at 9:06 pm UTC
StalePopcorn Feb 15, 2023
I'd love to have the option to choose which games get shader cache downloads too. Thanks for the good news!
MayeulC Feb 15, 2023
That's a welcome improvement, hopefully not needing to download (and compile) multiple gigabytes of shaders every time.

I also second a per-game option. There are only a few games I care about at any given time, though I leave them on my HDD for faster access. I think my shader cache now uses north of 100GB... I'm not even sure if that's still useful, since Mesa also has a size limit?

I also wonder if old shaders are evicted from servers?
Grogan Feb 15, 2023
I had that get turned on by accident (steam client update did it once) and it was horrendous. I'd rather compile and cache my own shaders, thank you. (The pre-cached shaders are probably pretty darned practical on the Steam Deck though, I would expect)
InhaleOblivion Feb 16, 2023
Valve continues to make Linux gaming more practical and this increases how quickly you can swap and play various games. Nothing worse than trying to start a game and having to wait for an update. Granted shader cache updates can usually be skipped to get load the game faster
Schattenspiegel Feb 16, 2023
ok so now we have only a few hundred kb downloads and half an hour of shader pre-compiling in the background...for however many people use this feature and dare to have more than one game installed ... this seems a bit wasteful energy wise, does it not?
Phlebiac Feb 16, 2023
I restarted Steam and got 12 downloads, which look like some of the usual culprits, such as Rise of the Tomb Raider. So not sure if it had the desired effect for me?
Rhythagoras Feb 16, 2023
Really glad they made an effort to solve this... For the last month or so, Dota 2 was re-downloading the entire shader cache every day (between 600 and 800mb). Today it only downloaded 129kb. Much better!
Botonoski Feb 16, 2023
They oughta build up options for users to manage their shader cache more readily, be nice to turn it off on a per game basis since so many simpler games do not noticeably benefit from it performance wise. Even just a single button to purge cache for a game or for the entire library would he nice, in case you need to free up space or suspect the cache is causing technical issues.
STiAT Feb 16, 2023
Note that you still need to download the full shader cache once, and get increments after that.

I will probably disable background processing again, depending on how many updates I get daily having 50 games installed.

Steam still has to process the whole cache, it's just downloading less. And I do not play all games I have installed all the time, so background processing is a waste if the increments happen often on a lot of games.
Bogomips Feb 16, 2023
My internet connection is still ADSL with a narrow bandwith, and I have disabled the pre-caching a long time ago, because there is no benefits for me I only play a handful of games from my library ten times bigger. So a per-game option would be nice.
F.Ultra Feb 16, 2023
View PC info
  • Supporter
Any one knows how this all works with games like Callisto Protocol where Steam downloads shader caches only for the game to then upon launch to rebuild the shaders anyway, sounds like the two systems are fighting each other and that perhaps the steam shader cache should be disabled for games like this, or does it still help in some way that I don't understand?
MayeulC Feb 16, 2023
Any one knows how this all works with games like Callisto Protocol where Steam downloads shader caches only for the game to then upon launch to rebuild the shaders anyway, sounds like the two systems are fighting each other and that perhaps the steam shader cache should be disabled for games like this, or does it still help in some way that I don't understand?

I haven't played that specific game, but lots of things can happen.

Firstly, having a cache should accelerate your launch times, then, because cached shaders are not recompiled.

Secondly, drivers tend to not compile shaders until they are actually used, which cause stutter, but reduce compilation time a lot (a whole lot of shaders are apparently unused, usually). That one is debatable, but this is where the steam shader cache usually helps. There are ways to force it, so it could be what the game is doing here.

Indeed, if the game recompiles everything, you should just expect a very minor speed improvement on launch (assuming background processing of shaders is disabled, for a "fair" comparison: otherwise, launch speed should increase a lot).
CatKiller Feb 16, 2023
View PC info
  • Supporter Plus
For those that are interested in the whys of the shader problem, this article is a good read.
rcrit Feb 16, 2023
View PC info
  • Supporter Plus
Seems like there is more room for improvement. I leave steam running all the time, sometimes for weeks, with an occasional scheduled download but nothing major. Every time I restart the client I get 20+ downloads immediately, plus recompilation and today was no different. I restarted just now and got 21 downloads for a total of 2.6GB (with associated fossilize_replay processes).

Or maybe this is its last gasp and next time things will be golden.
timekills Feb 17, 2023
shader cache was broken for me. it just kept downloading and piling up to 30GB in total, so I disabled it, and I didn't notice any game-breaking stutters, probably because my 16 threads CPU dealt with compiling shaders fast enough. If shaders can be shipped precompiled, why don't games do it?

if shaders should be compiled for your hardware ans software specifically, why even bothering with this precompiled cache system?

Short answer to the two questions is
1: As you mention in the 2nd question, it is both hardware and OS dependent. The combination of those that each player could have is obviously unknown to the game developer, as well as a large variable so adding those to the game would include a SIGNIFICANT file size increase for everyone with most of that data irrelevant to each user.

2: Of equal significance, the cache is more required for Linux as the programs and graphics are designed to work with (typically) Windows drivers. So pre-adding them as above is not useful for the majority of people. However, Steam building then for Linux already removes one major variable, and with the Steam Deck builds removes all variables as the hardware is consistent. They have the info on your system, so know which cache is applicable whether Steam Deck or PC.

Aside: this is a common issue for later console system emulation, and why some emulators can support shared graphical caches and some do not. I.E. how much a hardware/OS difference impacts the emulation ability determinesv whether it's even viable to share.
Korhaka Feb 17, 2023
Steam → Settings → Shader Pre-Caching → Allow background processing of Vulkan shaders

Since I enabled that I had pretty much forgot that shader pre-caching was a thing.
14 Feb 18, 2023
View PC info
  • Supporter Plus
ok so now we have only a few hundred kb downloads and half an hour of shader pre-compiling in the background...for however many people use this feature and dare to have more than one game installed ... this seems a bit wasteful energy wise, does it not?
It would happen during gameplay anyway, so it's only a waste if you don't play the games you have installed. If that's true, then you are wasting money and material on your hard drive too.

Your same thought has crossed my mind, too. It's partly the reason why I only keep games installed which I've played within the last 12 months.
14 Feb 18, 2023
View PC info
  • Supporter Plus
Every time I restart the client I get 20+ downloads immediately, plus recompilation and today was no different. I restarted just now and got 21 downloads for a total of 2.6GB (with associated fossilize_replay processes).

Or maybe this is its last gasp and next time things will be golden.
I noticed the same happening to me. I'm not sure if it has gone away because I haven't been able to get on Steam for a while. But you're not alone!
rcrit Feb 18, 2023
View PC info
  • Supporter Plus
Every time I restart the client I get 20+ downloads immediately, plus recompilation and today was no different. I restarted just now and got 21 downloads for a total of 2.6GB (with associated fossilize_replay processes).

Or maybe this is its last gasp and next time things will be golden.
I noticed the same happening to me. I'm not sure if it has gone away because I haven't been able to get on Steam for a while. But you're not alone!

Thanks for that!

I restarted the client just now to apply the latest beta update and for the first time in recent memory not a single download was done, so I have hope that things are indeed fixed.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.