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

[CS2] FPS Drops after a few rounds of playing #3845

Open
Dazukodesu opened this issue Oct 3, 2024 · 44 comments
Open

[CS2] FPS Drops after a few rounds of playing #3845

Dazukodesu opened this issue Oct 3, 2024 · 44 comments

Comments

@Dazukodesu
Copy link

Dazukodesu commented Oct 3, 2024

https://gist.github.com/Dazukodesu/26cf6d9747c1e2ada57c4b1a83a62cab)
OS: EndeavourOS Linux x86_64
Kernel: 6.10.10-arch1-1
DE: Hyprland
CPU: 13th Gen Intel i7-13700K (24) @ 5.300GHz
GPU: NVIDIA GeForce RTX 4070
GPU: Intel Raptor Lake-S GT1 [UHD Graphics 770]
RAM: 32GB

Please describe your issue in as much detail as possible:

Describe what you expected should happen and what did happen. Please link any large pastes as a Github Gist.

Steps for reproducing this issue:

  1. Enter a game in the competitive game mode on any map.
  2. Play 3-4 rounds.
  3. FPS Drops from a range of 200-400 to 80-115

https://cdn.discordapp.com/attachments/690648583082606645/1291442499658715247/VID_20241003_124634.mp4?ex=67001d0d&is=66fecb8d&hm=75e3eed2c291aa05c44b0eddf888bfc01e1a68eaf362531b80ee0ecdc272c6bd&

https://cdn.discordapp.com/attachments/690648583082606645/1291442500124414034/VID_20241003_124614.mp4?ex=67001d0d&is=66fecb8d&hm=9d271bd448c383045fd85ed19e33347396478e8ca0b5377597b30666bab41aff&

Launch options:
gamescope -w 1280 -h 960 -S stretch -f -e -r 144.0 --force-grab-cursor --adaptive-sync --immediate-flips --mangoapp %command%

@Zonyia
Copy link

Zonyia commented Oct 3, 2024

Experiencing frame drops after the recent update after playing for a bit too.

@Dazukodesu Dazukodesu closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
@Dazukodesu
Copy link
Author

Dazukodesu commented Oct 3, 2024

this has been happening since before update

@Dazukodesu Dazukodesu reopened this Oct 3, 2024
@itouchdennis
Copy link

itouchdennis commented Oct 4, 2024

Replying to #3845 (comment)

Just out of curiosity, are you able on Hyprland with NVIDIA to get tearing working?
I tried everything and CS feels horrible on Hyprland when I uncapped the FPS / I have more Frames as my monitor has HZ.

It seems like I cannot get my setup ready for the tearing validations (3070 ti - 12600k, 6.10 Kernel EndeavourOS).
The only way I can play the game on Hyprland for me was to set my max FPS fixed to my displays HZ rate.

If you have set up your system and working tearing, I would love to know what you set up :-D

(yes I have modset enabled and all these hyprland nvidia variables from the documentation on + I am on the newest git self compiled version - tried others but nothing changed. Hyprland maintainer just said "if hyprctl monitors doesnt show solitary 1, its not an hyprland issue" - welp)

@burd1
Copy link

burd1 commented Oct 5, 2024

Same issue on Pop! OS 22.04 after the new update, fps dips to mid 50's or 60's. My hardware is more than capable just like yours.

@Dazukodesu
Copy link
Author

Dazukodesu commented Oct 6, 2024

Replying to #3845 (comment)

i have my vsync off

@koreanfan
Copy link

I always play at low preset with disabled fidelity_fx. Recently valve broke cs2 on linux system (game crash at menu when press tab, when alt+tabbing, drop players, massive fps drop). After few weeks they fix it. But again they broke game with new big patch patch. Even at 1024x768 i got now 90-160 fps instead of 280-320fps. At 1920x1080 now i got shitty average 85fps with double increased frame time and its total unplayable at this resolution. They broke game almost with every patch. Qualified developers first test the patch, and if there are no problems with it, it can be used for the official release. Also, I don't want to waste my CPU, GPU, RAM, SSD, LAN resources on any skins and stickers. Make an optimal performance mode that only uses standard models when turned on.

@firashacker
Copy link

i had this issue 5 months ago and i came back to game to try it 3 days ago and this shit is still there,
i get 400 fps first match then after a while its only 180 fps , even in the main menu where i cap fps on 144 it drops to 100 and can't rise back after a while

@firashacker
Copy link

firashacker commented Oct 9, 2024

i recorded when it started dropping frames it occures suddenly and it makes the game unplayable

out2.mp4

idk what my cursor doing in there

  • i used ffmpeg to crop and trim the video maybe the encoder captured my curser during reincoding :(

@Dwyriel
Copy link

Dwyriel commented Oct 10, 2024

Probably related, not sure:
After the latest wave of updates (since early October), after a few matches (it builds up slowly each round) every now and then I get jitters and low FPS (goes from 200+ to 60-80), this gets progressively worse the more I play.
I didn't do any in-depth analysis but just having htop and nvtop open on a second window and playing casual matches I could see cs2 using more and more ram, but never releasing it. Joining the first match it would be using around 25% (out of 16gbs, or around 4gb), at the end it usually is around 33% to 38% (depends on match length/total rounds). second match starts at around 30 to 33%, and goes up to 50%~ at the end of it. this keeps building up, making the game more and more unplayable until the whole system "crashes" (or at least gets so slow that I can't even switch to a TTY to kill cs2).

@Dazukodesu
Copy link
Author

So its a memory leak issue?

@itouchdennis
Copy link

itouchdennis commented Oct 15, 2024

Could be a problem in EGL (nvidia related)
NVIDIA/egl-wayland#126 (comment)

There is also a workaround for nvidia users:

create the path
/etc/nvidia/nvidia-application-profiles-rc.d
create the file 50-limit-free-buffer-pool-in-wayland-compositors.json

Content might be look something like:
(I will try it now, dont know 100% if the match pattern for cs2 will work)
https://pastebin.com/tvMiWKrv

@Dwyriel
Copy link

Dwyriel commented Oct 15, 2024

@Dazukodesu it's possible that the memory leak is the cause but it could be something else. There's definitely a memory leak going on though, at least on my end and on casual matches.

Just played 3 consecutive self hosted casual matches with bots, cs2 RAM usage started at 33% and never went above 36%, rebooted the game and played 2 casual matches on valve servers, and by the end of the second it was at 45%. VRAM for both of those went up until around 8.9/10 GBs and stayed there. Haven't played a competitive match yet to test so can't comment on that end. If I had to guess I'd say it's potentially related to networking or skins.

ps: I'm on X11 + KDE with a Ryzen 5900x & RTX 3080. No wayland here.

@Dazukodesu
Copy link
Author

Yeah this happens on both x11 and wayland. Tho after a recent update today the game now instantly crashes

@Dazukodesu
Copy link
Author

Dazukodesu commented Oct 15, 2024

Replying to #3845 (comment)

how do i do this

@firashacker
Copy link

firashacker commented Oct 15, 2024

Replying to #3845 (comment)

i use amd radeon rx6600 and i still have similar fps lose after some time

it starts at around 340 fps and suddenly it can't do more than 180 with very clear hangs and frame drops

@burd1
Copy link

burd1 commented Oct 15, 2024

Yeah this happens on both x11 and wayland. Tho after a recent update today the game now instantly crashes

Same, but mine worked for 3-5s before crashing

@itouchdennis
Copy link

itouchdennis commented Oct 16, 2024

Replying to #3845 (comment)

how do i do this

Not sure if its working, but yesterday games worked bit better without hitting my vram limit of 8 GB
(but it was only 2 games... mostly I got issues after 4)

create the path
$ sudo mkdir -p /etc/nvidia/nvidia-application-profiles-rc.d
create the file
$ sudo touch /etc/nvidia/nvidia-application-profiles-rc.d/50-limit-free-buffer-pool-in-wayland-compositors.json

Edit the file and paste this content in:
https://pastebin.com/tvMiWKrv

& Reboot

@mildly-useful
Copy link

mildly-useful commented Oct 17, 2024

This happened on my PC ever since like... more than half a year ago (can't remember when I started playing CS2). And since it's a lower end PC, it's very noticeable/impactful. I have to restart my game/PC after some matches, otherwise the FPS would suffer. GPU is GTX 1650 4GB, and I have 16 GB of RAM.

@luminoucid
Copy link

luminoucid commented Oct 20, 2024

Replying to #3845 (comment)

hey itouchdennis,
did you add this also in you hyprland.conf? This fixed it for me. :)
(Also on EndeavourOS + 4070ti)

https://wiki.hyprland.org/Configuring/Tearing/

`general {
allow_tearing = true
}

windowrulev2 = immediate, class:^(cs2)$`

Also make sure that cs is running in fullscreen mode.
(I added bind = $mainMod, F, fullscreen to double check)

@Dazukodesu
Copy link
Author

So i tried screenrecording it today. And i noticed sometimes my weapon gets stuck inspecting. And after i shot a bullet the stuttering started. I am going to test it again soon

@Dazukodesu
Copy link
Author

alr that is not the cause

@Dazukodesu
Copy link
Author

[](https://youtu.be/b1MuRsDgMFo)
github wont let me upload video so i used an old channel of mine to upload

@sweiglbosker
Copy link

I am also having this issue (arch linux, X11, rtx 4080s, proprietary drivers). One interesting thing that I have noticed is that the fps count shwon by cl_showfps 1 is stable at ~300, but the game feels like it is running at 30fps. While the issue sometimes appears exactly when the round ends, it sometimes happens mid or start of round as well.

@Dazukodesu
Copy link
Author

image
its almost like the game stops using my cpu

@Dwyriel
Copy link

Dwyriel commented Oct 25, 2024

@Dazukodesu IF your issue is related to the memory leak this kind of thing will happen after memory footprint for the game gets too big, the kernel will half the process so it can reallocate and rearrange memory and you'll have some micro freezes and/or massively decreased performance for a short while. (I don't 100% understand how this works so don't quote me on this, but this is what I have been experiencing myself)

Would you be able to pay attention to how much mem the game is using throughout your sessions? having htop open on a second monitor should tell you. In case you don't have a second monitor you can use a tool like asciinema to record the terminal output.

@firashacker
Copy link

this have been fixed for me after the latest updates its good now , i believe this was related to the memory leak issue which possibly have been fixed also during the latest updates

@burd1
Copy link

burd1 commented Oct 31, 2024

this have been fixed for me after the latest updates its good now , i believe this was related to the memory leak issue which possibly have been fixed also during the latest updates

Its better for me aswell, but i did have heavy fps drops on 2/5 of my launches, seems like its only partially fixed?

@sweiglbosker
Copy link

fixed here as well

@burd1
Copy link

burd1 commented Oct 31, 2024

Just played vertigo in premier and the fps was dropping hard to the 60's with 11800H & RTX 3070

@sweiglbosker
Copy link

to be clear, the performance is still absolutely abysmal given my hardware and software setup. But, the random fps drop that would require me to restart the client is fixed. (i imagine running through proton would provide > 1.5x the performance of the native cs2 build)

@firashacker
Copy link

i have radeon rx6600 and the performance is very good for me now its almost same as windows i hope it stays like this
i get 300 - 400 fps in most maps and even where there is a water

  • i use arch linux with latest mesa updates

i hope valve keeps the game like it is and improve it, and not break it in future updates

  • maybe other performance issues related to nvidia cards

@firashacker
Copy link

firashacker commented Oct 31, 2024

Replying to #3845 (comment)

i forgot to mention i put these lines in my /etc/rc.local file

  • idk if it make difference just in case
#!/bin/bash
echo 1 >  /sys/class/drm/card0/device/pp_power_profile_mode
echo "high" > /sys/class/drm/card0/device/power_dpm_force_performance_level

exit 0

@sweiglbosker
Copy link

sweiglbosker commented Nov 1, 2024

Replying to #3845 (comment)

can I ask what cpu you are running?

@firashacker
Copy link

firashacker commented Nov 5, 2024

Replying to #3845 (comment)

can I ask what cpu you are running?

core i7 12700f

  • game uses 20% of my cpu
  • the shell rc commands above not related to cpu its gpu power managment

@sweiglbosker
Copy link

fyi: this issue has returned again for me since the 2nd most recent update. no high vram or ram usage,cl_showfps counter reads 400-500, but game plays ~20-30 fps until i restart. tends to happen after/at round end, no fix found yet.

@dineshdevkota001
Copy link

Similar issue. Drops from about 70-80 fps to about 30 fps and really choppy. Happens at about round end. Goes away after a restart.
Using gnome. The game renders seemingly normally when i am in gnome overview/activities screen i.e. focus is not on game. When i am fullscreen in game it feels choppy.

@firashacker
Copy link

firashacker commented Dec 7, 2024

the game is fixed for me after latest updates

but this issue still there when i try to run game stretched using gamescope

USING THESE LAUNCH OPTIONS
obs-vkcapture gamemoderun gamescope -w 1280 -h 1024 -S stretch -r 0 -F fsr -f -e --force-grab-cursor --adaptive-sync --immediate-flips --expose-wayland -- mangohud %command% -exec autoexec.cfg

  • after some time the game suddenly ( not gradually ) preform terribly and the frame time line goes like
    ms: ------/\/\/\/\/\/\/\/\/\/

@firashacker
Copy link

firashacker commented Dec 7, 2024

Replying to #3845 (comment)

same thing like this the game be smooth then frame drops triggered midgame

@firashacker
Copy link

this is clearly cs2 + gamescope bug

@ogmkp
Copy link

ogmkp commented Dec 19, 2024

Same problem here, on a GTX 970 with 4 Gb of VRAM, after 3 matches on Dust 2 with great smoothness, the game stutters and goes from 3.6 Gb to 3.9 Gb of VRAM. The game becomes unplayable and headache-inducing, with fluctuating image jumps, and has to be restarted.
Exactly like this:
#3845 (comment)

I'm using Xorg with no desktop compositor to make sure there are no layers of synchronization to avoid tearing.
No launch options, no gamescope.
DDR and GDDR are meant to be used, with control.
Crazy that theres no Vulkan CS2 git repo to report issues.

#3687 #3642 #3498

@naeq
Copy link

naeq commented Jan 5, 2025

If you experience stutter after about 30 mins of gameplay, like in this video: #3845 (comment), you need to add this two lines to ~/.profile:

export LD_PRELOAD=""
unset LD_PRELOAD

then logout and login again.
Also, add this command to game launch:

LD_PRELOAD=""

steam launch options example:

LD_PRELOAD="" gamemoderun mangohud %command%

It's a DXVK/VKD3D bug:
doitsujin/dxvk#4436
ValveSoftware/steam-for-linux#11446
ValveSoftware/gamescope#163

@ogmkp
Copy link

ogmkp commented Jan 5, 2025

After your comment, I tried LD_PRELOAD=“”, I didn't have the problem for 1h30.
So I tried without LD_PRELOAD=“”, and I didn't have the problem for an hour.
I haven't played since my December 19 comment, there have been CS2 updates since then.
I play with the native version of CS2 for linux.

In any case, I'm disgusted after all these years, this game is full of cheaters, so I almost don't play it anymore.
Thanks for the proposal, I'll test it again if the problem returns and if I really want to play it.

@Dazukodesu
Copy link
Author

this is clearly cs2 + gamescope bug

Its mangohud

@Dazukodesu
Copy link
Author

I figured it out i am going to play without it today just to be sure

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

No branches or pull requests