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 · 44 comments
Open

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

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

@ztancrell
Copy link

ztancrell commented Nov 25, 2024

I got this problem on Fedora KDE (Wayland NVIDIA). I notice that in the console when the stuttering happens, I get this message: [InputSystem] Processing SDL events took 50.1ms, spammed in the console.

Edit: This was for Counter Strike 2. Forgot to mention the game.

@SheMelody
Copy link

We can probably try to add VK_LAYER_VALVE_steam_overlay_64 (or the 32-bit version depending on the game) to the VK_LOADER_LAYERS_ENABLE variable.

LD_PRELOAD="" VK_LOADER_LAYERS_ENABLE=VK_LAYER_VALVE_steam_overlay_64 %COMMAND%

Haven't tried this, but it would be interesting if this doesn't cause the issue. Note: untested, and will only work with Vulkan / DXVK / VKD3D, and not with OpenGL / WineD3D.

@OneWiseKnight
Copy link

OneWiseKnight commented Nov 26, 2024

I just want to add in, when I was having the cursor lag after 40 mins in game couple weeks ago it was present in both Steam and Lutris. So may want to test your current version of proton inside Lutris and see if it happens as well to narrow down the issue.

@remybin
Copy link

remybin commented Nov 30, 2024

I had a similar issue with Dead by daylight where it starts lagging around after 30-40 minutes after I start playing. Adding LD_PRELOAD="" didn't do anything for me. However, I noticed that when I enabled the steam overlay(with steam recording still disabled) the lag no longer happened.

@viocar
Copy link

viocar commented Dec 3, 2024

Did you add LD_PRELOAD="" or LD_PRELOAD="" %COMMAND%? You may need the %COMMAND% part for it to actually work.

@remybin
Copy link

remybin commented Dec 4, 2024

Interestingly enough when I add LD_PRELOAD="" %COMMAND% Dead by Daylight will crash for me. I'm fine with just having the overlay enabled.

After looking at some older issues mentioned here (#2901) seems like this is an old issue and apparently the only known fixes are enabling overlay or adding the LD_PRELOAD flag.

Hopefully nobody with this issue needs to have the overlay disabled along with having the LD_PRELOAD flag solution not work for them...

@AphidGit
Copy link

AphidGit commented Dec 7, 2024

Happens in unity games as well, by the way. Slipways and Against the Storm are both affected.

Interesting thing: During the lagspike frames, the game will not pick up any mouse or keyboard input; meaning, if you use short taps or clicks they can get lost. That makes trying to play anything reasonably quickly a big problem.

@tylerebowers
Copy link

For me it seems to only lag with input (after ~30mins), so FPS is fine until I press/hold a key or move my mouse.

@netborg-afps
Copy link

netborg-afps commented Dec 10, 2024

So far, this happened for me with every game with the exception of Slay the Spire, which is an OpenGL game.
Happens as well with Path of Exile 2 on its Vulkan renderer.

@viocar
Copy link

viocar commented Dec 10, 2024 via email

@netborg-afps
Copy link

netborg-afps commented Dec 10, 2024

Yes, I just wanted to note that no workaround is needed for Slay the Spire - the only game I encountered so far which isn't affected by this bug.

@ShikharArvind
Copy link

ShikharArvind commented Dec 10, 2024

I had a similar issue with Dead by daylight where it starts lagging around after 30-40 minutes after I start playing. Adding LD_PRELOAD="" didn't do anything for me. However, I noticed that when I enabled the steam overlay(with steam recording still disabled) the lag no longer happened.

  • Initially I had steam overlay disabled for The Witcher 3 and started seeing this issue.
  • The LD_PRELOAD="" workaround fixed the issue for me on The Witcher 3.
  • I also tried enabling the steam overlay and disabling steam recording. This also fixes the issue for me.
  • When I do try to record something, the fps drops drastically in game (even after the recording has stopped).

@rscm
Copy link

rscm commented Dec 13, 2024

with LD_PRELOAD="" the controller doesn't work

OS: Fedora 41Silverblue
Controller: PS5 Dualsense (I tried emulating it as Xbox 360 with xboxdrv and the same)
Steam (flatpak):

Steam Beta Branch:  Stable Client
Steam Version:  1733265492
Steam Client Build Date:  Mon, Dec 2 18:26 UTC -04:00
Steam Web Build Date:  Mon, Dec 2 18:20 UTC -04:00
Steam API Version:  SteamClient021
-------------------------------------------------------------
Command: cat /etc/os-release
NAME="Freedesktop SDK"
VERSION="24.08 (Flatpak runtime)"
VERSION_ID=24.08
ID=org.freedesktop.platform
PRETTY_NAME="Freedesktop SDK 24.08 (Flatpak runtime)"
BUG_REPORT_URL=https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues

-------------------------------------------------------------
Command: lspci -tv
-[0000:00]-+-00.0  Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex
           +-00.2  Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne IOMMU
           +-01.0  Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
           +-01.1-[01]--+-00.0  NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile]
           |            +-00.1  NVIDIA Corporation TU106 High Definition Audio Controller
           |            +-00.2  NVIDIA Corporation TU106 USB 3.1 Host Controller
           |            \-00.3  NVIDIA Corporation TU106 USB Type-C UCSI Controller
           +-01.2-[02]----00.0  Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983
           +-02.0  Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
           +-02.1-[03]----00.0  Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller
           +-02.2-[04]----00.0  Intel Corporation Wi-Fi 6 AX200
           +-08.0  Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
           +-08.1-[05]--+-00.0  Advanced Micro Devices, Inc. [AMD/ATI] Renoir [Radeon RX Vega 6 (Ryzen 4000/5000 Mobile Series)]
           |            +-00.2  Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor
           |            +-00.3  Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1
           |            +-00.4  Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1
           |            +-00.5  Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor
           |            \-00.6  Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller
           +-08.2-[06]--+-00.0  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
           |            \-00.1  Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode]
           +-14.0  Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller
           +-14.3  Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge
           +-18.0  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 0
           +-18.1  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 1
           +-18.2  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 2
           +-18.3  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 3
           +-18.4  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 4
           +-18.5  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 5
           +-18.6  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 6
           \-18.7  Advanced Micro Devices, Inc. [AMD] Renoir Device 24: Function 7

-------------------------------------------------------------
Command: lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 480M
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 10000M
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 002: Dev 006, If 0, Class=[unknown], Driver=snd-usb-audio, 480M
    |__ Port 002: Dev 006, If 1, Class=[unknown], Driver=snd-usb-audio, 480M
    |__ Port 002: Dev 006, If 2, Class=[unknown], Driver=snd-usb-audio, 480M
    |__ Port 002: Dev 006, If 3, Class=[unknown], Driver=usbhid, 480M
    |__ Port 003: Dev 003, If 0, Class=[unknown], Driver=uvcvideo, 480M
    |__ Port 003: Dev 003, If 1, Class=[unknown], Driver=uvcvideo, 480M
    |__ Port 004: Dev 004, If 0, Class=[unknown], Driver=usbhid, 12M
    |__ Port 004: Dev 004, If 1, Class=[unknown], Driver=usbhid, 12M
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 10000M
/:  Bus 005.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 001: Dev 002, If 0, Class=[unknown], Driver=hub/2p, 480M
        |__ Port 001: Dev 004, If 0, Class=[unknown], Driver=usbhid, 12M
        |__ Port 001: Dev 004, If 1, Class=[unknown], Driver=usbhid, 12M
        |__ Port 001: Dev 004, If 2, Class=[unknown], Driver=usbhid, 12M
    |__ Port 003: Dev 003, If 0, Class=[unknown], Driver=btusb, 12M
    |__ Port 003: Dev 003, If 1, Class=[unknown], Driver=btusb, 12M
    |__ Port 004: Dev 005, If 0, Class=[unknown], Driver=usbhid, 12M
/:  Bus 006.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    |__ Port 001: Dev 002, If 0, Class=[unknown], Driver=hub/2p, 5000M

@OneWiseKnight
Copy link

For those having the mouse studder after 40 mins, have you tested to play the game in Lutris? The reason I mention this because couple weeks ago, when the issue began to happen I was able to reproduce the studder in Lutris as well. In Lutris I pointed to the game .exe, and used different Wine versions for testing. The solution at the time was to not use the latest git compile of DXVK but instead use the release version which fixed the 40 min lag.

@GrabbenD
Copy link

GrabbenD commented Dec 14, 2024

The solution at the time was to not use the latest git compile of DXVK but instead use the release version which fixed the 40 min lag.

Sounds like a regression if latest DXVK-git suffers from mouse stutters

Have you tried to git bisect?

@netborg-afps
Copy link

For those having the mouse studder after 40 mins, have you tested to play the game in Lutris? The reason I mention this because couple weeks ago, when the issue began to happen I was able to reproduce the studder in Lutris as well. In Lutris I pointed to the game .exe, and used different Wine versions for testing. The solution at the time was to not use the latest git compile of DXVK but instead use the release version which fixed the 40 min lag.

I don't think that's the case as I needed to put the workaround in place even though I was running my custom dxvk mod based on 2.4. The bug got introduced by a Steam update, not by some dxvk version.

@jeisom
Copy link

jeisom commented Dec 14, 2024

For those having the mouse studder after 40 mins, have you tested to play the game in Lutris? The reason I mention this because couple weeks ago, when the issue began to happen I was able to reproduce the studder in Lutris as well. In Lutris I pointed to the game .exe, and used different Wine versions for testing. The solution at the time was to not use the latest git compile of DXVK but instead use the release version which fixed the 40 min lag.

I don't think these are the same stutter bugs. After I did the work around in FarCry5 the clockwork 27 minute stutter disappeared. I did experience a different stutter after an extended play, but the frametimes and frametime graph were totally different and took a lot longer to trigger.

@OneWiseKnight
Copy link

OneWiseKnight commented Dec 14, 2024

The solution at the time was to not use the latest git compile of DXVK but instead use the release version which fixed the 40 min lag.

Sounds like a regression if latest DXVK-git suffers from mouse stutters

Have you tried to git bisect?

I didn't know of the feature at the time sorry. Actually slight correction, I can't say it was a git version anymore because I am not sure what Lutris had for settings when I reproduced the lag time bomb. More than that I can't tell you more because the TKG-Proton versions I had I deleted, but Lutris I may have the Wine versions so I will do some testing to see if I can produce the time lag bomb as I did. Sorry for the confusion.

@innersp4ce
Copy link

I've had issues Satisfactory, see report at the Proton repo: Proton #8313. Thought it was a polling rate issue of the mouse at first mentioned on the respective arch wiki page.

Tested Satisfactory pol rate at 500 Hz, the issue came back after >60 minutes instead of >30 minutes consistently.
Tested Path of Exile 2 pol rate at 500 Hz, the issue arose after >30 minutes consistently.

What actually did work was setting the launch options for both games LD_PRELOAD=" ". Both games ran consistent as can be expected for my system.

Tested Satisfactory pol rate 1000 Hz, issue not observed after a continuous >120 minute session.
Tested Path of Exile 2 pol rate 1000 Hz, issue not observed after a continuous >240 minute session. (Woops, jup that long.)

What I interpret is that the old Wine bug is not what causes it, or it's very inconsistent (hence not solved after 5 years.)

Thank you for providing a workaround SheMelody ❤️ 👍

@tangosox
Copy link

tangosox commented Dec 18, 2024

I'm having the problem in overwatch 2 through steam even with LD_PRELOAD="" %COMMAND% in GE-Proton-9-21 and a few other 9.x i tried.
I'm currently testing geproton-8-26 and it hasn't happened yet. Found an old post saying the problem was in the 9 series and wanted to give it a shot. Edit: To give more info though, a few days ago I did install dxvk 2.5.1 and I don't remember now if it started then but it might have. I also installed 565 nvidia drivers a week ago. I wasn't play every day so I don't know when the problem started. Interesting that someone else mentioned dxvk versions though. Up until now though 2 hours later the problem doesn't occur with geproton 8.26 and 8.32. Still would like to run the latest versions and pinpoint where the problem is.

@Recipient4626
Copy link

For those having the mouse studder after 40 mins, have you tested to play the game in Lutris? The reason I mention this because couple weeks ago, when the issue began to happen I was able to reproduce the studder in Lutris as well. In Lutris I pointed to the game .exe, and used different Wine versions for testing. The solution at the time was to not use the latest git compile of DXVK but instead use the release version which fixed the 40 min lag.

I do, I just found out that it's a different problem that coincidentally began to happen at around the same time.
When such stutters happen, I can see [drm] Fence fallback timer expired on (gfx|comp) blah blah in journalctl, and I find out that it only happens on KDE Wayland, not at all on Hyprland and Sway, and totally independent of whether Steam is running in the background or not. Updating / tweaking various BIOS settings and kernel parameters didn't solve the problem on KDE.

Since KDE is run on iGPU (7800X3D) on my system (but games are on 7900XTX), the timer expired problem might have something to do with how KDE handles iGPU rendering or drm.

Maybe give Hyprland and Sway a try.

@MrFoxPro
Copy link

I've experienced this issue in Dota 2. It starts randomly after some time in game. LD_PRELOAD="" %command% in Steam launch options fixed it.

@diniamo
Copy link

diniamo commented Dec 19, 2024

Obligatory useless comment: the quotes are unnecessary, simply do LD_PRELOAD= %command% instead.

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