ValveSoftware / Fossilize

A serialization format for various persistent Vulkan object types.
MIT License
538 stars 45 forks source link

Why is fossilize always running? #247

Open YellowOnion opened 1 week ago

YellowOnion commented 1 week ago

I have a 12 core Ryzen 5900x and only a few games on my computer, but it seems that steam is constantly running fossilize.

How on earth does it take my computer 28mins to compile a fully featured Linux kernel, but after rebooting, Steam spends hours processing who knows what?

I just cannot fathom this order of magnitude of required processing, Especially considering steam never even bothers to update my games, so I cannot fathom why It would need to spend so long processing shaders from World of Tanks and Apex Legends (and Noita/Factorio if that even counts as OpenGL titles).

kakra commented 1 week ago

First of all, this may be a bug, and I wonder if this can be fixed by purging the shader cache.

But then again: shader pipelines are crowd-sourced and redistributed. Especially in service games, this probably adds new shader pipelines every so often, and these are distributed back to you, so your system can compile the pipelines for your GPU and driver to eliminate stutters. And before any misconception comes up: Steam does not distribute compiled shaders because those are individual per system/hardware combination. Instead you get something like the "source code" of the pipelines, fossilize runs that through the GPU driver which compiles it for your system, the results are written to the cache. So you're going to see around twice as much contents as has been downloaded by Steam.

If you don't like that and think you don't encounter a lot of new shaders, you can disable background processing. This may result in a longer startups process of games (either because Steam pre-processes shaders, which you can skip, or because games preload shaders in the loading screens).

I'd start by renaming the shader cache directory to see if that changes things. Then compare the directories if there's a massive difference in size. In that case, something may have simply been broken in the cache and you can delete your old copy. Quit Steam before renaming or changing anything here.

If the issue persists, see if disabling background processing fixes it. There are bug reports around here which cover buggy background processing.