Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lag spikes after 25-40 minutes of playing on linux #11446

Open
darix opened this issue Nov 11, 2024 · 68 comments
Open

lag spikes after 25-40 minutes of playing on linux #11446

darix opened this issue Nov 11, 2024 · 68 comments
Labels

Comments

@darix
Copy link

darix commented Nov 11, 2024

A lot of details are already collected in:

doitsujin/dxvk#4436

it could be related for a LD_PRELOAD added for the "record your game" feature?

the workaround while we wait for the fix

please see this comment for all the details doitsujin/dxvk#4436 (comment)

@TerohsLab
Copy link

Can confirm the findings of that thread on KDE Tumbleweed Wayland.

It started happening around the time "record your game" rolled out for me.

@LethalManBoob

This comment was marked as off-topic.

@HeinsKetchup
Copy link

Pulling this from a reddit topic I saw where the user also had the issue, may be relevant:

"When I run 'top' in the terminal I see the game running 'engMain', when I have it focused, the %CPU will show somewhere between 300 - 400 when not moving my mouse - the game runs fine. When I touch my mouse the %CPU value plummets to about half of whatever was initially shown and the game stutters. This does not happen when the game is initially started"

@SheMelody
Copy link

SheMelody commented Nov 11, 2024

I'm the one who started this recently in the other repo issues and I can confirm that it is still happening. You can get rid of this by using LD_PRELOAD="", but you can still use LD_PRELOAD to preload your own libraries.

Can confirm the findings of that thread on KDE Tumbleweed Wayland.

It started happening around the time "record your game" rolled out for me.

Exactly.

@pkly
Copy link

pkly commented Nov 11, 2024

Also happens to me on gnome 47, Wayland, fedora 41, Nvidia 560 and 565, started happening when the game recording update came out.
Additionally I'm not sure if it's part of the same problem but with the overlay enabled doing nothing (no game recording enabled, no windows, no chat, nothing) the overlay vram usage balloons to almost 2gb reported by nvidia-smi.

@SheMelody
Copy link

SheMelody commented Nov 11, 2024

@kisak-valve I just want to add that this also happens when the overlay is turned off through the Steam UI.

(with also both game recording and steam input disabled as well, from the UI of course)

doitsujin/dxvk#4436 (comment)

@rafaberaldo
Copy link

Having the same problem, started after the Steam Game Recording update as well, enabling the overlay fixed the problem.

@MichaelDeets
Copy link

I've had this issue for years ValveSoftware/csgo-osx-linux#2901 but I only play 1-2 games, so after CS:GO moved to CS2, the issue went away.

But for years, CS:GO using DXVK native required LD_PRELOAD=""

@d3nd3
Copy link

d3nd3 commented Nov 11, 2024

gameoverlayrenderer.so most likely culprit

@SheMelody
Copy link

gameoverlayrenderer.so most likely culprit

It definitely is.

@TerohsLab
Copy link

But many of us have the steam overlay and recording feature turned off in the options. So why would it even load that?

@SheMelody
Copy link

SheMelody commented Nov 11, 2024

But many of us have the steam overlay and recording feature turned off in the options. So why would it even load that?

That's probably part of the bug. /environ shows that the library still loads even though those things are turned off. Hence why LD_PRELOAD="" fixes the issue (prevents said library from loading).

@Tridale
Copy link

Tridale commented Nov 13, 2024

While it does seem like people have helped corner the source of the issue, I figured a little more information couldn't hurt.

Note that using LD_PRELOAD as SheMelody suggests appears to have fixed my issues, will need to test further to confirm but initial tests has been very promising. A huge thank you to them as when I look further at this issue it's clear they put in a lot of legwork on trying to help pinpoint this issue.


After the steam update about a week ago, the one that apparently added in additional recording features as well as updated to runtime environments scout, soldier and sniper, both of my linux systems would have issues playing games through proton. I'd notice the odd tiny bit of jitter while playing, but after 20-50 minutes (depending on game and game settings) I'd start getting horrible framerate drops whenever I...

  • moved the mouse
  • gave input on the keyboard

The stuttering would last for about a second after the input stopped, and if the input was just a single key press that was held for a few seconds it would stop. As I had a controller connected I switched to that and the game I was playing (subnautica) ran perfectly smooth, went back to mouse and keyboard? Stuttering. This stuttering also appeared to be framerate only, as on the main menu of one of the games (Again, Subnautica) the mouse cursor would move smoothly, but the background animations would stutter like mad while I was moving the cursor once I had hit this 'time to stutter' threshold.

So whatever issue is involved with this overlay issue is also tied with mouse and keyboard input. At least on my end after some testing. What I did not do is continue using the controller for another 50 minutes or so to see if there's some sort of 'input buffer' that fills up with a specific kind of input that would cause the controller input to start lagging.

This was also exclusive to steam, as I have games that run natively on linux or I use regular WINE for that do not suffer this stuttering issue.

I'll also give additional system information on both of my systems below, the only thing that unifies the two systems is that they are linux, are AMD CPU and graphics and the three games I tested had some sort of internet traffic, though both machines run on completely different internet connections (wired/wi-fi) and ISP's.

Desktop (Tested with Subnautica with Archipelago multi-world randomizer):

  • Custom build
  • Arch Linux : KDE Plasma 6.2.3 , Wayland
  • CPU: AMD Ryzen 9 7900X 12-Core
  • Graphics: AMD Radeon RX 7900 XT

Laptop (Tested with Helldivers 2 and Mechwarrior Online):

  • Framework 16 Laptop
  • Linux Mint 22 Cinnamon (Cinnamon 6.2.9) , x11
  • CPU: AMD Ryzen 9 7940HS
  • GPU: AMD Radeon RX 7700S

Steam overlay has been entirely disabled through the Steam UI on both PC's as well.

@netborg-afps
Copy link

Yes, LD_PRELOAD="" fixes it for me as well, but do I need to put it in the launch options for every game or can I set it globally?

@SheMelody
Copy link

Yes, LD_PRELOAD="" fixes it for me as well, but do I need to put it in the launch options for every game or can I set it globally?

Do not set it globally, no.

@ndrspcfd
Copy link

I've been having the same symptoms using conty_lite.sh w/ Slackware current from the 8th Nov or so: Subnautica becomes unplayable slideshow after 1/2 hour to an hour (playing with kb/mouse).

After the LD_PRELOAD workaround this seems to have gone away. Thanks for that!

I still see "ERROR: ld.so: object '/home/pete/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored." with the workaround in place and overlay disabled for the game and then disabled globally.

Wonder if it's some byproduct of setenv changes ?

@atimeofday
Copy link

Disabling steam game recording on a per-game basis through its settings UI seems to solve this issue for me without losing other things. (Game tested: Warframe)

@phpony
Copy link

phpony commented Nov 16, 2024

If you're using gamemode you can just use this hack to temporarily hide gameoverlayrenderer.so from the game without messing with other libs:

~/.config/gamemode.ini

[custom]
start=mv ~/.steam/debian-installation/ubuntu12_64/gameoverlayrenderer.so ~/.steam/debian-installation/ubuntu12_64/gameoverlayrenderer.so.bak; mv ~/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so ~/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so.bak
end=mv ~/.steam/debian-installation/ubuntu12_64/gameoverlayrenderer.so.bak ~/.steam/debian-installation/ubuntu12_64/gameoverlayrenderer.so; mv ~/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so.bak ~/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so

UPD. No, it isn't the best approach because gamemode doesn't wait for script to exit so it's possible it'll launch the game before the lib is hidden.

@ShikharArvind
Copy link

ShikharArvind commented Nov 17, 2024

Had similar issue with The Witcher 3. After 30-50 min of smooth playing, the game stutters significantly with constant FPS drops.
Launching the game with LD_PRELOAD="" seems to have fixed the issue.

@darix
Copy link
Author

darix commented Nov 17, 2024

TBH: if all you want to add to the bug is "oh yeah i had that issue too and the solution helped me" please just click the thumbsup in the initial post in this thread. those comments do not add any more useful information to the issue.

Thank you in advance.

@MissPotato
Copy link

I want to add that doing LD_PRELOAD="" breaks the steam ingame overlay (obviously) but also doesn't completely solve the issue. Anytime steam pushes a notification, such as a friend going online, the system hangs will still happen. As well as having the full steam interface as the primary application will cause major slowdowns with a game running. Minimizing the steam window (or having it in the background) is fine.

@jpVm5jYYRE1VIKL
Copy link

jpVm5jYYRE1VIKL commented Dec 27, 2024

i also got it fixed using PROTON_USE_WINED3D=1. So most probably issue happens with overlay only for vulkan mapping. In current moment 2 way to workaround : PROTON_USE_WINED3D=1 and LD_PRELOAD

@FakeMichau
Copy link

For me the issue showed up only in a game (Helldivers 2) in which I tried to use that new recording feature. People have reported seeing the issue in path of exile 2 but I have zero issues with it, I also didn't try to record that game using this feature.
Could be totally coincidental but I didn't see this being mentioned as a potential cause.

@GrabbenD
Copy link

GrabbenD commented Dec 28, 2024

Helldivers 2

AMDGPU might experience poor GPU performance in Helldivers 2 due to MESA overriding user's power profile

Reference:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28260

Easiest way is to disable this with a environment variable:

# /etc/environment
radv_force_pstate_peak_gfx11_dgpu=false

https://gitlab.freedesktop.org/mesa/mesa/-/issues/11046#note_2381270

Alternatively, remove the offending line in /usr/share/drirc.d/00-radv-defaults.conf

<application name="Helldivers 2" executable="helldivers2.exe"> <option name="radv_force_pstate_peak_gfx11_dgpu" value="true" />

Furthermore with AMDGPU, you'd get better results with power_dpm_force_performance_level = manual and pp_power_profile_mode = 1 (3D_FULL_SCREEN) power profiles than the default, see: https://gitlab.freedesktop.org/drm/amd/-/issues/1500#note_1448388

Good luck

@samnewall
Copy link

samnewall commented Jan 5, 2025

Having a similar issue, however only with Ship Graveyard 2, Bodycam and Cyberpunk 2077 after playing for an hour. Other games such as HOI4 and GR Breakpoint run absolutely fine.

I've tried clean installs of different Pop OS Nvidia drivers, changing GPUs (Used a 2070 S before) before manually installing NVIDIA-Linux-x86_64-550.142 from Nvidia's website (Recommended driver for my 3060).

It's not a hardware issue, nor is it overheating or memory leak. At a loss right now, but will try u/spezdrinkspiss advice from this thread .

OS: Pop!_OS 22.04 LTS x86_64

Host: MS-7C56 1.0

Kernel: 6.9.3-76060903-generic

Shell: bash 5.1.16

Resolution: 3440x1440

DE: GNOME 42.9

Terminal: gnome-terminal

CPU: AMD Ryzen 7 3800X (16) @ 3.900GHz

GPU: NVIDIA GeForce RTX 3060 Lite Hash Rate

Memory: 5841MiB / 32021MiB

@thsteinmetz
Copy link

Just wanted to add a comment here and state that I turned off the steam overlay for Space Marine 2 when it came out and never turned it back on. Was experiencing this same lag/stuttering issue when playing Starcraft 2 and Heroes of the Storm around the 30 minute mark and never really connected the dots until seeing this thread. I just turned the overlay back on and played SC2 for over an hour without any issues at all.

@kantmn
Copy link

kantmn commented Jan 16, 2025

i am having this issue since oct 24, in any game and tried so many thinks, including several OS reinstalls and GPU switchs

Thanks for all the information

Reenabling the Steam Ingame Overlay solved the issue for me, although i dont use nor like it, hopefully this is getting patched.

@solenum
Copy link

solenum commented Jan 21, 2025

I was having this issue with 7 days to die with proton (native version unplayable in general), after ~45-60 minutes of gameplay the stutter would kick in.

What I figured out was that the stuttering was down to input of any kind, if I moved my mouse it would stutter every few frames, if I walk forwards, I stutter once when I press W, and then the game starts running fine while I hold W, if I tap any other key on my keyboard while holding W & walking I can produce a single stutter with each keypress.

I'm not 100% sure this issue here is the same one but I did manage to go about ~90-100 mins last night with LD_PRELOAD="" %command% and not run into the issue before I had to log off for the day, I had tried everything else prior with no luck (every possible game setting/renderer, proton version, etc). Steam overlay on or off made no difference to this issue occurring for me, it would happen regardless.

I'll hopefully play for longer today or tomorrow and verify if this does indeed fix my issue for sure or not.

@Slashic
Copy link

Slashic commented Jan 21, 2025

I went ahead and thanks to discoveries made by @alexzk1 on this DXVK issue: doitsujin/dxvk#4436

I made some tests while playing a 32bits game (Ys Memories of Celceta):

The issue seems to be the 64bits gameoverlayrenderer.so interfering with a 32bits game or 32bits one with a 64bits game (to be confirmed) and seems to only affects 32bits games.

That means:

  • 32bits gameoverlayrenderer.so inactive & 64bits gameoverlayrenderer.so active => No Steam Overlay & Stuttering after 40mins
  • 32bits gameoverlayrenderer.so inactive & 64bits gameoverlayrenderer.so inactive => No Steam Overlay & No issue
  • 32bits gameoverlayrenderer.so active & 64bits gameoverlayrenderer.so inactive => Steam Overlay & No issue

The method i used is to just chown root:root & chmod -rw 64bits gameoverlayrenderer.so file.
That way, you still have Steam overlay active and no need to use LD_PRELOAD.

Since this is still a hassle, alternatively you could use LD_PRELOAD to load the appropriate steam overlay with your game depending of its architecture need.

With something like this (tested successfully, only for 32bits games)

LD_PRELOAD="/home/USER/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so"  %command%

It effectively prevents the 64bits version of the overlay to be loaded using ubuntu12_32 libs but in case you want the 64bits version, the 32bits libs still gets loaded by the steam client itself as it remains active even after closing the game.
Maybe this still works for 64bits games, but that needs to be tested...

64bits games seems to be unaffected by this, at least in my testing (Horizon Forbidden West, Forza Horizon 4 with 1h+ of playtime without any issues)

Edit struggle ~ doesn't work as home in LD_PRELOAD path, good to know...

@kaloyan13
Copy link

Enabling Steam UI help me too. Fedora 41/Xfce with steam 1.0.0.82. Issue was appearing constantly after >30minutes of Dota 2 gameplay.

@alexzk1
Copy link

alexzk1 commented Jan 21, 2025

I guess, when this get fixed, developers should explicit ask to disable workarounds and try the fix. Like pop-up 1 time.
Because we will not see any possible fixes :/

@Dinjoralo
Copy link

Dinjoralo commented Jan 22, 2025

I have also been having this issue when playing the Kingdom Hearts 1.5+2.5 collection, since at least late December.

LD_PRELOAD="" does fix the issue for me, but the solution provided by @Slashic has also proven to work. For the Kingdom Hearts collection, I need to point LD_PRELOAD to the 64-bit overlay, meaning I set it to LD_PRELOAD="/home/USER/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so". For this, I am extremely grateful to Slashic for sharing their findings.

The Kingdom Hearts collection is a bit of a weird one, because it's split between multiple .exe's for the launcher, the different games, and some cutscene viewers, and some of those .exe's are 32-bit while most are 64-bit.

EDIT: It seems I spoke too soon... I'm still getting the bad, rhythmic stuttering after playing for long enough when only loading the 64-bit overlay. A curious issue since it's been mentioned that for some, it doesn't happen with 64-bit games.

@jarrard
Copy link

jarrard commented Jan 22, 2025

Seems like a easy fix for Mr Gaben!

@Slashic
Copy link

Slashic commented Jan 22, 2025

I have also been having this issue when playing the Kingdom Hearts 1.5+2.5 collection, since at least late December.

LD_PRELOAD="" does fix the issue for me, but the solution provided by @Slashic has also proven to work. For the Kingdom Hearts collection, I need to point LD_PRELOAD to the 64-bit overlay, meaning I set it to LD_PRELOAD="/home/USER/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so". For this, I am extremely grateful to Slashic for sharing their findings.

The Kingdom Hearts collection is a bit of a weird one, because it's split between multiple .exe's for the launcher, the different games, and some cutscene viewers, and some of those .exe's are 32-bit while most are 64-bit.

EDIT: It seems I spoke too soon... I'm still getting the bad, rhythmic stuttering after playing for long enough when only loading the 64-bit overlay. A curious issue since it's been mentioned that for some, it doesn't happen with 64-bit games.

That's interesting, that would mean it's not a 32bits/64bits game issue but more the 64bits overlay causing an issue in some games.
It could be interesting to start listing games that are affected and those that aren't in order to find what's causing the issue (game engine, DX9/11/12...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests