How do I solve this steep frame rate drop when gaming?

Anything related to gaming on Linux Mint including game discussion or questions concerning Steam or Wine.
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
linuxlife
Level 1
Level 1
Posts: 2
Joined: Thu Jun 01, 2023 1:42 am

How do I solve this steep frame rate drop when gaming?

Post by linuxlife »

Relevant specs from neofetch:

OS = Linux Mint 21.1 x86_64 / Host = H310M H 2.0 / Kernel = 5.15.0-72-generic / DE = Xfce 4.16 / CPU = Intel i5-8400 (6) @ 4.000GHz / GPU = NVIDIA GeForce GTX 1050 Ti / Memory = 2381MiB / 15944MiB

Footage of the issue with mangohud (top-left): https://youtu.be/7pjmCjEqaTc

I have had this issue across a few linux distros, some would cause a system-wide stutter and others would have drops in frame rate such as in the video. The one thing these cases had in common was that I would always observe the CPU usage going up as it occurred. These drops in performance have always happened at intervals and are consistent throughout all gameplay, lasting around 20 to 30 seconds, then operating normally for the same length of time.

With mangohud enabled on my game I saw that the CPU usage went up as the GPU went down. The weird thing is that when I first installed this OS, the problem seemed to have disappeared and games were running perfectly, now it's back. This makes me unsure if this is really hardware issue or software related.

This happens with every game I play now, be it on Steam or a different launcher, using proton / wine or a game native to linux. Interestingly, when playing the game Deep Rock Galactic and observing the task manager, the CPU usage went from 20% to 60% for the Steam app instead of the game itself. I'm not sure what that means.

I have already tried changing the driver version. I've used the nvidia drivers 530, 515 and 470, same problem on each one. I have also tried changing the shader pre-cache settings on Steam.

I actually had another 1050 Ti GPU from an older computer. I put it in my computer and it ran a bit worse than my newer one but the frame rate problem still persisted in exactly the same way (drops from 70 FPS to 10). I also removed the GPU completely and ran Minecraft on integrated graphics, the problem persisted still. I don't get this issue when using Windows 10.

What is going on with my Linux, how can I find out what the cause is? I can share more information if it is needed.
Last edited by LockBot on Fri Dec 01, 2023 11:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Teadrinker
Level 3
Level 3
Posts: 112
Joined: Fri Mar 03, 2023 8:52 am

Re: How do I solve this steep frame rate drop when gaming?

Post by Teadrinker »

Hello!
It may be possible your CPU is not on its "performance mode". To ensure it is, launch the game with this command (steam launch options):

Code: Select all

gamemoderun %command%
Then, alt-tab to a terminal and check whether gamemode is truly working:

Code: Select all

gamemoded -t
User avatar
MiZoG
Level 8
Level 8
Posts: 2371
Joined: Fri Jan 26, 2018 8:30 pm
Location: Athens, Greece

Re: How do I solve this steep frame rate drop when gaming?

Post by MiZoG »

My system is very similar to yours though slightly worse:
LM 21.1 Cinnamon, kernel 5.15.x
Intel i5-7500, gtx 1050ti (525.x.x driver) 16 gigs of ddr4 but only 2133 MT/s,
system loads from an ssd but games are in my home partition on a mechanical disk!

I didn't go for the native Linux build I doubt it has received any maintenance lately.
Latest windows version of the game, Proton 7.0.6 (not the latest - but reliable)

Game defaults to "medium". I only unchecked VSync and ran the in-game performance test. No gamemode.

Image

Now a test with the settings I would certainly use to play the game. "High" preset + Low antialiasing (default is zero) + VSync. Gamemode active.

Image

In both tests lots of processes (Firefox, Thunderbird, Telegram, Steam etc) were running in the background.
Actual gaming is very comfortable on high settings without micro-stutter and fps never ever fell lower than 40fps.

So if this plays fine for you on Windows on the same machine, what are you doing wrong with your Linux installation(s)?
There must be something else, cannot be gtx 1050ti or Linux Mint itself.
linuxlife
Level 1
Level 1
Posts: 2
Joined: Thu Jun 01, 2023 1:42 am

Solution: How do I solve this steep frame rate drop when gaming?

Post by linuxlife »

I have discovered the common denominator: Linux updates. More precisely, updating the Linux kernel.

See, every time I install a new app through the terminal, I am advised to update my system first, just so there won't be any dependency issues later on. Without really thinking about it, I install all the updates, and every once in a while, that comes with a new kernel version.

Well, after changing my kernel version around for a bit, I have been able to make the problems stop completely with a few specific ones. Below, I will specify issues I have been able to observe with each and every one I tested.

kernel 5.15.0-56-generic, this came installed with the OS by default. The frame rate for gaming is not very optimized, but the sudden steep frame drop and audio stuttering did not occur on this version.

kernel 5.15.0-69-generic, this version was more optimized than the previous one and had negligible frame rate issues. I consider this to be one of the best version of this kernel.

kernel 5.15.0-72-generic, here is where the big issues began. Starting in this version, my CPU usage was elevated when gaming and sometimes even when watching videos. My GPU usage would drop drastically resulting in frames dipping from 100+ to as low as 12.

kernel 5.15.0-73-generic, it gets even worse. In this version the stuttering was system-wide and unbearable. It affected every single game I ran, no matter the graphics. By far the weirdest symptom was the fact that in this version my monitor wouldn't even turn on when booting, and would only do so when rebooting.

kernel 5.19.0-43, this version of this kernel had the same issues as the 5.15.0-72, almost exactly. In this particular case, my frames were high into the 100 range, but would only drop to 30 or slightly below.

Finally, kernel 5.15.0-25-generic is the one I use. The frame rate is well optimized and the usage of CPU and GPU is normal. I'm able to run games at even higher settings than I was used to. Stuttering occasionally happens when launching a game and switching between workspaces, but once the game is up everything works normally again.

I don't entirely understand why exactly the kernel has this impact on my system. My research has determined that perhaps how the tasks are handled by the CPU between these different versions is what causes the lag. After running numerous tests and thoroughly examining the results, I can safely say that this was the definitive solution of the issue, in my case.
motoryzen
Level 10
Level 10
Posts: 3481
Joined: Sun Dec 08, 2019 12:25 am

Re: How do I solve this steep frame rate drop when gaming?

Post by motoryzen »

CPU = Intel i5-8400
Perhaps a newer kernel in the 6 series would help alittle.

sudo apt install linux-kernel-22.04c -y

Given how fairly modern your CPU is ( yes I know..for most games cpu peformance is more like 25% of the whole meal deal and gpu is 75%, still can matter given stuttering or framerate tanking)
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
ThaCrip
Level 5
Level 5
Posts: 988
Joined: Sat Dec 07, 2019 12:13 pm

Re: How do I solve this steep frame rate drop when gaming?

Post by ThaCrip »

I am using Mint 21.1-Xfce on a i5-3550 with a 1050 Ti 4GB and I don't have any obvious issues. I am playing nearly all of my games (totally offline) through Lutris v0.5.12 (v0.5.13 is the newest but there are regressions in this as at least two of my games are shot) paired with GloriousEggroll's "lutris-GE-Proton7-28-x86_64" etc.

currently I am using NVIDIA driver v525.89 and 5.15.0-69 kernel. only reason I am still on those older versions and not something newer is I have not rebooted in almost 95 days as my current system uptime is 94d 9h+ (which is my 2nd highest ever. but in about 12 days ill have a new personal best ;)).
MainPC: i5-3550 (undervolted by -0.120v (CPU runs 12c cooler) /w stock i3-2120 hs/fan) | 1050 Ti 4GB | 16GB (2x 8GB) DDR3 1600Mhz RAM | Backups: AMD E-300 CPU (8GB RAM) / Athlon X2 3600+ CPU (@2.3GHz@1.35v) (4GB RAM) | All /w Mint 21.x-Xfce
Locked

Return to “Gaming”