ValveSoftware / Fossilize

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

Why is fossilize always running? #247

Open YellowOnion opened 5 months ago

YellowOnion commented 5 months 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 4 months 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.

notnotme commented 3 months ago

Hello this happens to me also. My laptop is drawing all power it can once I launch steam because proton games fossilize the replay (compiling shader ahead of time) as soon as it start.

I usually disable turbo on my processor unless I really need it, this avoid fossilize drawing all power the laptop is allowed to (70W, yes), but fossilize replay still block all my core to 100%. In my case, 2300MHz. It constantly run at 64°C with little fan noise.

And yes, fossilize things can run litteraly for HOURS (3, yesterday, until I get bored and turned off Steam myself).