ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.24k stars 175 forks source link

Shader pre-caching getting stuck #7472

Open nstgc opened 3 years ago

nstgc commented 3 years ago

I've been having issue with Fossilize lately. Basically, it gets stuck at 0% when building.

I've tried clearing my download cache, clearing my shader cache (disabling caching and restarting), and reverting to the stable build of Steam. This was especially strange when it got stuck building shaders for Skyrim SE when I didn't have shaders installed. Games which normally take under a minute to compile shaders for such as Command and Conquer 3 or Divinity: Original sin are hanging for hours. Stranger still, the compiler doesn't appear to be doing anything. Normally while compiling my CPU frequency is maxed out, but that isn't the case now.

$ pacman -Q|grep mesa
lib32-libva-mesa-driver 20.2.2-2
lib32-mesa 20.2.2-2
lib32-mesa-vdpau 20.2.2-2
libva-mesa-driver 20.2.2-2
mesa 20.2.2-2
mesa-demos 8.4.0-4
mesa-vdpau 20.2.2-2
Processor Information:
    CPU Vendor:  GenuineIntel
    CPU Brand:         Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz

Operating System Version:
    "Arch Linux" (64 bit)
    Kernel Name:  Linux
    Kernel Version:  5.9.8-arch1-1
    X Server Vendor:  The X.Org Foundation
    X Server Release:  12009000
    X Window Manager:  GNOME Shell
    Steam Runtime Version:  <Runtime disabled>

Video Card:
    Driver:  X.Org AMD Radeon RX 5600 XT (NAVI10, DRM 3.39.0, 5.9.8-arch1-1, LLVM 11.0.0)
    Driver Version:  4.6 (Compatibility Profile) Mesa 20.2.2
    OpenGL Version: 4.6
kisak-valve commented 3 years ago

Hello @nstgc, this sounds like a more general Steam shader pre-caching issue instead of Fossilize itself. Is there heavy disk I/O while it tells you 0%? Please reproduce the situation, then gather ~/.local/share/Steam/logs/shader_log.txt and attach it as a gist or as a file.

nstgc commented 3 years ago

For some reason Steam decided my shaders needed updating today despite nothing having updated between now and the last time I ran Steam. Now Age of Wonders: Planetfall is stuck at 0% and has been for over 20 minutes.

Below is all the shader log for today. https://gist.github.com/nstgc/3cff3d9e475c666592968e786b7fb69f

nstgc commented 3 years ago

Oh, sorry for not completely answering the question. Yes, there is a significant amount of hard drive activity which started when Steam loaded.

I tried starting Warframe (which downloaded 3.8GB of shaders it would seem), but it would not start. I expected it to do a "preparing shaders" thing, but instead it just tries to start for several minutes before giving up without error. I tried loading it a few times before giving up and exiting Steam... however according to HTop, Steam is still running. Also, the HDD is still very active.

I just killed Steam and the HDD is now much quieter.

kisak-valve commented 3 years ago

What I expect is happening here is that Steam is determining what is old content in the shader cache in a clean up pass. Unfortunately, mesa's shader caching mechanism has each shader in a separate file and this pass can take an extraordinary long time to complete with mesa drivers, but it will eventually complete if you let it. Don't be surprised if it takes several hours due to the hundreds of thousands of shaders involved.

This is not a bug, but there definitely is room for improvement.

Redbatman89 commented 3 years ago

I have this issue too, though I think its driver related. On Nvidia driver 440.100 the vulkan shaders took only ten to fifteen minutes to fully process all of my games. Now they are longer almost 2hrs on 455.38

kisak-valve commented 3 years ago

Hello @Redbatman89, what you've described doesn't match the issue reported here. Also, this issue expected to only affect mesa drivers.

Redbatman89 commented 3 years ago

Hello @Redbatman89, what you've described doesn't match the issue reported here. Also, this issue expected to only affect mesa drivers.

Well thing is that it's happening to Nvidia Drivers too. I noticed when POP OS updated the Nvidia drivers from 440.100 to 455.28 and 455.38. Shaders should not take that long to process especially on Nvidia Drivers. Also Fossilize Replay will still run in background even after shaders finish. Look at this post it happened to me as well.

https://github.com/ValveSoftware/Fossilize/issues/84

nstgc commented 3 years ago

For what it's worth, I had this happen again today with Mass Effect. It was stuck at 0% for several hours, but has since finished.

half-duplex commented 3 years ago

I've had the same problem. Steam consumes nearly 100% of disk i/o and makes quite a bit of noise grinding the hdd. "Room for improvement" is a significant understatement, there are at least two behaviors here that should not have shipped. "Room for improvement" would be if it was slow but indicated its status and correctly paused/stopped when I tried to quit steam or launch a game.

It also seems to crash something when I try to quit steam while this task is running. I sent the dumps to support, who didn't care.

Quitting

Expected: Steam exits completely, background tasks stop, grinding and i/o load stop. Observed:

If I kill -9 everything left then start steam again it sometimes restarts the task immediately, making the next part particularly infuriating:

Launching games

Expected: The process progresses, finishes within 30 seconds, and the game launches. Clicking "Skip" skips shader processing and launches the game. Observed: It stays at 0% for hours, whether or not "Skip" was clicked, preventing me from accessing my purchased content.

usernamecopied31 commented 3 weeks ago

Something I noticed this morning when I tried to start the game was it wanted to reprocess ALL the shaders again. Unsure why this needs to be done daily unsure if maybe something in the backend of the game or game engine or something with the shaders is changing every day. None less makes it very frustrating trying to get into the game. Thankfully compared to the first time it only took about 35 minutes compared to 2.5HRS it took the first time to complete it.

For some reason now the game doesn't want to start and just keeps processing the shaders. The below picture shows the CPU load and virtually zero load on the Storage drive while it's doing this. Unsure what the issue is now as the game worked fine all day yesterday after I let it complete the Shaders.

Vulkan Shader CPU MAX

System Information: Operating System: Linux Mint 22 Cinnamon Cinnamon Version: 6.2.9 Linux Kernal: 6.8.0-45-generic Processor: Intel Core i9-9900k @ 3.60GHz x8 Memory: 64GiB Hard Drives: 8761.5GB Graphics Card: Nvidia GeForce RTX 2080 Ti Display Server: X11