ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.19k stars 173 forks source link

Vulkan games launched through steam have the performance drop after 40 minutes #7505

Closed eepykate closed 3 years ago

eepykate commented 3 years ago

Your system information

Please describe your issue in as much detail as possible:

Whenever I launch a vulkan game through steam the performance drops massively after around 40 minutes

Games I've tested: Mirror's Edge (DXVK), Dishonored (DXVK), Shadow Of Mordor (Native, Vulkan Beta)

I have a GOG version of Superliminal which this didn't happen to, so I started to suspect steam being the issue, but I was also optimistic that nvidia fixed their drivers.

So I tried reinstalling Mirror's Edge through steam, and the same problem happens, then I found a cracked exe file, launched it directly with proton and I didn't experience a sudden performance drop. Admittedly I only played for 52 minutes, but in the past, 45 minutes has been the upper end of "fine" performance.

I didn't test adding Superliminal as a non-steam game and seeing if the performance drops.

Steps for reproducing this issue:

  1. Open steam
  2. Launch a vulkan game
  3. Play for around 40 minutes
kisak-valve commented 3 years ago

Hello @6gk, in general we're tracking issues with games run with Proton in the Proton issue tracker. Let's use this issue report to focus on Shadow of Mordor. It may be worthwhile to also mention this issue to Feral Interactive, since they did the Linux port of the game.

Can you keep an eye on PCIe bandwidth utilization in nVidia's X settings utility and when the game starts under-performing, does that also become a high percentage? I suspect that the video card is running out of vram, and when that happens, then the video driver can fallback to using system ram with a severe performance penalty.

eepykate commented 3 years ago

@kisak-valve Thanks for the fast reply.

I have used nvtop to check the GPU/VRAM usage of Shadow Of Mordor in the past, and the VRAM didn't appear to be maxing out, however I think the GPU usage did do a drop, I cannot recall this information with 100% certainty so take this with a grain of salt.

I will do some more testing (including launching superliminal through steam) and try remember to get screenshots of relevant info this time. I know for a fact that it wasn't overheating, since when the drop happened the temperature was around the same as most of the other time playing.

eepykate commented 3 years ago

Adding Superliminal as a non-steam game, even though it didn't display as "playing", the screenshot button didn't work, and the steam overlay didn't show, it did make the performance drop after 40 minutes. (Yesterday when I wasn't using steam it worked for 1h20m at which point I manually exited, i didn't experience any performance issues)

I didn't get as many screenshots during play as I wanted to (I did a typo which made the auto screenshot loop not work), but the VRAM usage was up to 75% at least 6 minutes before the performance drop. The temp was around 68 Celsius every time I looked at it, for both the cpu and gpu.

novideographic

(Shadow of Mordor is still downloading, I'll update on that later)

eepykate commented 3 years ago

I think it's worth mentioning that I've had this issue for a while, and have made a reddit post (warning, contradictory & confusing, read summary below instead) in the past. It's only now that I feel like I have enough info to feel like a bug report could be useful.

Summary of the reddit post is basically I narrowed it down to vulkan and of found out that:

kisak-valve commented 3 years ago

Blind guess, does setting the game's launch options to LD_PRELOAD="" %command% have an effect?

eepykate commented 3 years ago

Good question, I'll give it a shot.

eepykate commented 3 years ago

@kisak-valve Wow.. That actually worked. Thank you so much! (Was playing for 1h9m without any issues)

Should this issue be closed now that a workaround has been found, or stay open for further investigation so the workaround isn't needed?

Of course, don't hesitate to ask if you need any more info.

2020-12-04T14:25:53+10:00

(performance was fine for the most part, the gpu spikes were cutscenes/window switching/pausing)

483 screenshots (221M), that was.

kisak-valve commented 3 years ago

That workaround hints that there's an issue in the Steam Overlay. Avoiding it doesn't make the issue any less valid.

kisak-valve commented 3 years ago

Looking at your system information /home/mirror/opt/apps/.steam/debian-installation is an abnormal install location and whatever modification that was done to set that up appears to be incomplete and causes

ERROR: [Loader Message] Code 0 : /home/mirror/.steam/debian-installation/ubuntu12_64/steamoverlayvulkanlayer.so: cannot open shared object file: No such file or directory
ERROR: [Loader Message] Code 0 : /home/mirror/.steam/debian-installation/ubuntu12_32/steamoverlayvulkanlayer.so: cannot open shared object file: No such file or directory

Note the lack of /opt/apps in the path.

Maybe look in the library_path of ~/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json and steamoverlay_x86_64.json.

eepykate commented 3 years ago

Alright. I assumed this was a type of "at the mercy of the drivers" issue since I've never seen anyone have an issue similar to this, so it wouldn't be that easy to debug.

Also, I'm pretty sure (but again, not 100%, memory is kinda fuzzy) that at one point around the time of the reddit post I had the steam overlay checkbox disabled and it still happened.

eepykate commented 3 years ago

Ooh, now that is interesting. Very interesting.

I just change my HOME variable on steam launch (HOME=$HOME/opt/apps steam) since I dislike having dotfiles in my home directory.

That being an issue didn't even cross my mind.

Maybe look in the library_path of ~/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json and steamoverlay_x86_64.json.

Yep, all 4 json files in that directory (Using XDG_DATA_HOME instead) seem to be pointing towards /home/mirror/.steam

I cannot thank you enough for all this, seriously.

Edit: I'll have a look at if changing where that file points affects anything or if moving .steam back to home affects it tomorrow. If that was the issue I will have mixed feelings. The solution would have been obvious and the fault of mine, and would have explained why nobody else had that issue, but I'd feel retroactively stupid for the past few months. I mean it's worth it but ouch

eepykate commented 3 years ago

@kisak-valve That was some good investigating. I changed the path in all 4 files in xdg_data/vulkan/implicit_layer.d, and it appears to be fixed. That also explains why in the past the overlay on vulkan didn't even work in the past, which I thought nothing of.

Thanks and sorry for any trouble I caused. Glad this was just an (admittedly stupid) issue specific to me rather than an extremely obscure bug.