Skip to content

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

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

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

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

darix opened this issue Nov 11, 2024 · 161 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)

@rfberaldo
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.

@pheki
Copy link

pheki commented Mar 16, 2025

Replying to #11446 (comment)

I assume you have the overlay disabled on Steam. Have you tried either:

  1. ENABLING the overlay by going into Steam -> Settings -> In Game and checking Enable the Steam Overlay while in-game, or
  2. Adding the following to OW2's launch options: LD_PRELOAD="" %COMMAND%

@waywardfrantz
Copy link

Replying to #11446 (comment)

I assume you have the overlay disabled on Steam. Have you tried either:

1. ENABLING the overlay by going into `Steam -> Settings -> In Game` and checking `Enable the Steam Overlay` while in-game, or

2. Adding the following to OW2's launch options: `LD_PRELOAD="" %COMMAND%`

The LD_preload workaround seems to be working for me, going to test it more later but got past the half hour mark with it.

The overlay I had turned off a while ago, think it helped performance. Turning "Nvidia reflex" to "enabled" but not boost seemed to have the biggest impact on making the game "feel" correct for me.

And before enabled "ld_preload", the game did feel 99% perfect. It would just fill its pants after half an hour or so (seems to fill quicker the higher your texture quality is too, had like 2 hours on lowest settings and half an hour on medium).

@pheki
Copy link

pheki commented Mar 17, 2025

(seems to fill quicker the higher your texture quality is too, had like 2 hours on lowest settings and half an hour on medium)

See the analysis at #11446 (comment). In theory, the time it takes is related to how many inputs (mouse movement, key presses) you make.

@BloodyIron
Copy link

I've been getting the "Processing SDL events took" spam in my console recently after about 1.5hrs+ of CS2. I have to quit and reload the game so far as I am unsure of a proper fix.

@forsureitsme
Copy link

forsureitsme commented Mar 24, 2025

I'm also having this issue when running Trackmania when opening with gamescope. Using the LD_PRELOAD workaround is not an option, because my controller (an generic dinput) does not work with it, so I'm tied up to using the subpar windowed fullscreen without gamescope (which does fill all the screen btw). The -e flag also did nothing for me.

@izibane
Copy link

izibane commented Mar 27, 2025

I'm having this issue on CS2, suddenly starts lagging, SDL events took 50.1ms everytime, every 30 minutes of playing or so

@8Vinso8
Copy link

8Vinso8 commented Apr 2, 2025

Every game lags after lags after 20 minutes if overlay is enabled, and if i enable it the main steam window doesnt open after some time playing

@neon-grim
Copy link

From my understanding, disabling the overlay should be a workaround to this issue. What I noticed is that if I enable the overlay, play a game until the lag spikes appear, exit the game and disable the overlay in steam settings and then start the game again, the stutters still appear after around 30-40min of play.

I experienced this while playing marvel rivals and black ops 3 zombie mode. I've added the LD_PRELOAD env var to my launch options and this seems to have fixed the issue for those games. The weird part is that I expected for the issue to disappear just by disabling the overlay.

Here is my hardware spec:

  • CPU: 7800X3D
  • GPU: 7900XTX
  • Compositor: Hyprland 0.48.1
  • Kernel: 6.14.0
  • Mesa: 25.1.0-dev Mesa-Git
  • Proton: Experimental and GE Proton 27
  • Steam: Beta and Stable

@nelsam
Copy link

nelsam commented Apr 9, 2025

From my understanding, disabling the overlay should be a workaround to this issue. What I noticed is that if I enable the overlay, play a game until the lag spikes appear, exit the game and disable the overlay in steam settings and then start the game again, the stutters still appear after around 30-40min of play.

No, loading the .so causes the stutters. Just disabling the overlay isn't enough, you have to prevent the game from loading the steam overlay .so file. The issue description has a link to the workaround, but just in case those steps are hard to follow:

  1. Right click on the game you want to fix
  2. Go to Properties
  3. Under Launch Options, type: LD_PRELOAD="" %command%

As far as I know, you have to do this for every game you want to play without stutters.

@luisalvarado
Copy link

Thank you so much for the workaround, I posted at https://forums.developer.nvidia.com/t/570-release-feedback-discussion/321956/493 this same message and they brought me here

Using this latest driver with the 5090, after 45 minutes of playtime or more, I think all games but will limit to the ones I saw the same issue in: incredible stuttering lag.

After about 45 minutes to an hour games like goat simulator 3,
god of war (1 and 2),
gta 5 enhanced,
kingdom come 2,
the finals,
marvel rivals,
borderlands 3
and cs2.

All of these games you can’t play them longer than 45 to an hour straight now before a sudden stuttering attack happens. The timing is always consistent (45 to 60 minutes).

@NTpspE
Copy link

NTpspE commented Apr 13, 2025

I've been having this issue as well, and it's rather hard to search for online! I thought it was just related to Unreal Engine games (as that's what I've been playing when I noticed it) and was going down endless trails of forum posts trying various things out.

I think the easiest option for me is just to re-enable the overlay, but the LD_PRELOAD fix also works as well.

@LunarPidgeon
Copy link

Im having almost exactly the same issue, happening at the 37 minute mark very consistently. the LD_PRELOAD=" " has not worked for me unfortunately, neither has disabling steam overlay or steam recording. I get this in both wayland and X11.

@d3nd3
Copy link

d3nd3 commented Apr 14, 2025 via email

@sourkyle
Copy link

glad i found this thread, shemelody you are a saint! i get like 240 fps with frame acceleration playing marvel rivals. but routinely after about 30-45 minutes of playing the game, it stutters beyond belief. seems apart from the command fix, relaunching the game stabilizes it for a brief time, before happening again.

@weznagwama
Copy link

I think this is also related to the version of proton running.

The suggested workaround of LD_PRELOAD worked fine for a week or so, however this week Proton-GE 26 just broke down completely, I could only play 2-5mins before FPS would drop to <10.

I tried 25,24,23,22 with no luck. I reverted further back to Proton-GE 14 and that works fine.

@viocar
Copy link

viocar commented Apr 16, 2025

I think this is also related to the version of proton running.

The suggested workaround of LD_PRELOAD worked fine for a week or so, however this week Proton-GE 26 just broke down completely, I could only play 2-5mins before FPS would drop to <10.

I tried 25,24,23,22 with no luck. I reverted further back to Proton-GE 14 and that works fine.

The workaround still works for me. It sounds like you're describing a different problem.

@weznagwama
Copy link

I think this is also related to the version of proton running.
The suggested workaround of LD_PRELOAD worked fine for a week or so, however this week Proton-GE 26 just broke down completely, I could only play 2-5mins before FPS would drop to <10.
I tried 25,24,23,22 with no luck. I reverted further back to Proton-GE 14 and that works fine.

The workaround still works for me. It sounds like you're describing a different problem.

Is there a way I can 100% verify this is my problem and not something else or a red herring?

@luisalvarado
Copy link

I can confirm having the overlay does nothing on a 4060, 4090 or 5090 using either Ubuntu 24.04 or 25.04. But adding

LD_PRELOAD="" %command%

To the launcher options does in fact work. At least the games tested were Goat Simulator for more than 2 hours, Kingdom Come 2 (Almost 3 hours) and all Spiderman 1, Miles Moralres and Spiderman 2.

Is this a steam issue, proton issue or driver issue?

@diniamo
Copy link

diniamo commented Apr 19, 2025

Steam issue. Scroll up, there are some pretty detailed explanations.

@tehmasterer
Copy link

I'm pretty sure this is the same issue I am having, and the timeline makes sense.

Late last year I was playing Fallout 76 without issue, but then after they released a big update, it soon became unplayable. After 20-40 minutes of gameplay, the fps dropped to sub-20, and it was a stutter-y mess that never recovered. I attributed this to the update and to FO76 being poorly optimized in the first place. I have tried to play it multiple times since then, but the problem persists.

Fast-forward to a few weeks ago, when I installed the Witcher 3 (DX11). The game was fine for about half an hour, then right on schedule, the fps tanked. I enabled MangoHud with the frame time graph and could see the game flatline. Before performance completely tanked, the fps was not consistent, and the game stuttered often.

For a comparison, I tried playing these games on two completely different systems:

  1. Fedora 40 with an NVIDIA GPU on Wayland KDE
  2. Ubuntu 22.04 with an AMD GPU on Wayland GNOME

The results were the same. Neither game is playable after a certain amount of time.

These performance issues do not happen in every game. Fallout 76 and The Witcher 3 have issues, but Metro Exodus, Prey (2017), DOOM (2016), Civilization VI, and Batman: Arkham Knight were fine.

LD_PRELOAD="" %command% seems to have solved my issues in the Witcher 3. I played 4 hours tonight on Fedora and the game ran great! I will have to go back and test Fallout 76.

@dNifle
Copy link

dNifle commented Apr 27, 2025

I just had this issue in Expedition 33 yesterday. Was playing it fine for many hours in previous sessions but then I enabled mangohud in gamescope, played around with the game settings to get few more fps and a few minutes later I had the frame time spikes.
LD_PRELOAD="" caused other issues for me, so I replaced gameoverlayrenderer.so with an older version instead, which seems to have done the trick. The overlay is glitching out, but at least the game works fine. Maybe there is a version that works but doesn't have the bug, but I can't find a list of official versions.

@luisalvarado
Copy link

I just had this issue in Expedition 33 yesterday. Was playing it fine for many hours in previous sessions but then I enabled mangohud in gamescope, played around with the game settings to get few more fps and a few minutes later I had the frame time spikes. LD_PRELOAD="" caused other issues for me, so I replaced gameoverlayrenderer.so with an older version instead, which seems to have done the trick. The overlay is glitching out, but at least the game works fine. Maybe there is a version that works but doesn't have the bug, but I can't find a list of official versions.

Oh my could this be blaming nvidia drivers but it was steam all along.

@github2452
Copy link

having the same issue when I try to play L4D2 (Linux native version)
LD_PRELOAD="" solves it but it heavily decreases performance

@nezia1
Copy link

nezia1 commented May 3, 2025

Replying to #11446 (comment)

They have 0 clue about the issue you're having. This does sound like the exact same issue (i.e. the memory time bomb)

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