ValveSoftware / csgo-osx-linux

Counter-Strike: Global Offensive
http://counter-strike.net
775 stars 69 forks source link

[Linux] Severe impact of players/bots on performance #3350

Open Keplyx opened 12 months ago

Keplyx commented 12 months ago

Your system information

Please describe your issue in as much detail as possible:

The more players/bots in a game, the more fps drops. I can understand if it drops a little, but here the impact is way too severe while not even stressing the GPU/CPU to their max.

Here are screenshots from mangohud showing the fps on inferno CT spawn, with the low settings present, while not moving, with bot_stop true and gradually adding bots. As you can see fps go from ~130 without bots to ~50 with 15 (full deathmatch lobby). And this is without anything moving in a local map with bots. If you add in the mix real players moving and shooting this gets even worse.

Notice how the CPU/GPU usage does not even go up.

0 bots 5 bots 10 bots 15 bots
Screenshot_20230929_194705 Screenshot_20230929_194801 Screenshot_20230929_194828 Screenshot_20230929_194903

Don't mind the long frame freeze in the 16 bots graph, the game was simple alt+tabbed.

Steps for reproducing this issue:

  1. Start any map in local
  2. Kick all bots
  3. Measure the FPS
  4. Add more bots
  5. Measure the FPS
  6. Repeat
Keplyx commented 12 months ago

Also tried on dust_2 with high settings preset (compared to inferno on low in main post). I stood in ct spawn corner looking at the ground still with bot_stop 1. I've also enabled more information in mangohud.

In this setup the game reaches around 90% GPU usage for about 120 fps while looking at the ground. But the more players/bots join, the lower the usage and the FPS get. It goes as low as 60% GPU and 75 fps with 15 bots.

What I could not clearly see in the previous test is that the GPU usage actually decreases a lot. The game seems to stop using the GPU, it is not even throttling anymore while the game should ask for more power.

Here are some screenshots for comparison

0 bots 5 bots 10 bots 15 bots
Screenshot_20230930_120555 Screenshot_20230930_120622 Screenshot_20230930_120651 Screenshot_20230930_120719
henrym11106 commented 11 months ago

What's happening is that all the bots run on a single thread, and if that thread gets too busy the engine has to wait for it, effectively becoming CPU-bound without maxing out even one thread while also reducing load on the rest of the CPU and GPU.

polluxau commented 11 months ago

What's happening is that all the bots run on a single thread, and if that thread gets too busy the engine has to wait for it, effectively becoming CPU-bound without maxing out even one thread while also reducing load on the rest of the CPU and GPU.

i see, wonder when this will get changed as i hate starting off with amazing fps in deathmatch and by the end i can barely reach 70fps with the frame timing all messed up aswell

474420502 commented 11 months ago

What's happening is that all the bots run on a single thread, and if that thread gets too busy the engine has to wait for it, effectively becoming CPU-bound without maxing out even one thread while also reducing load on the rest of the CPU and GPU.

When there are more and more complex elements in the scene, such as dropped guns, bloodstains, changing water surfaces, etc., the frame rate starts to drop. Even reducing the number of character models also leads to a low frame rate.

474420502 commented 11 months ago

When there are more and more complex elements in the scene, such as dropped guns, bloodstains, changing water surfaces, explosions causing scene alterations, bullet traces, etc., the frame rate starts to decrease. Even reducing the number of character models also leads to a low frame rate. Moreover, this issue persists and gets progressively worse as the number of rounds increases, causing the game to become increasingly laggy. This could be due to some data within the scene not being cleared, resulting in rendering during each round.

polluxau commented 11 months ago

When there are more and more complex elements in the scene, such as dropped guns, bloodstains, changing water surfaces, explosions causing scene alterations, bullet traces, etc., the frame rate starts to decrease. Even reducing the number of character models also leads to a low frame rate. Moreover, this issue persists and gets progressively worse as the number of rounds increases, causing the game to become increasingly laggy. This could be due to some data within the scene not being cleared, resulting in rendering during each round.

Yep I noticed this last night when playing competitive, by the end my frame timing was horrible and the fps was all the way down to around 70fps, started at 160

474420502 commented 11 months ago

When there are more and more complex elements in the scene, such as dropped guns, bloodstains, changing water surfaces, explosions causing scene alterations, bullet traces, etc., the frame rate starts to decrease. Even reducing the number of character models also leads to a low frame rate. Moreover, this issue persists and gets progressively worse as the number of rounds increases, causing the game to become increasingly laggy. This could be due to some data within the scene not being cleared, resulting in rendering during each round.

Yep I noticed this last night when playing competitive, by the end my frame timing was horrible and the fps was all the way down to around 70fps, started at 160

I have already updated to the latest Linux drivers, but the issue remains unresolved. I switched to Windows to play CS2, and initially, I was able to maintain a frame rate of 250 FPS. However, as the number of rounds and item usage increased, the performance became extremely poor. When there are more complex elements in the scene, such as dropped guns, bloodstains, changing water surfaces, scene alterations caused by explosions, and bullet traces, the frame rate starts to decline. Even reducing the number of character models results in a drop in frame rate. This problem persists over time and worsens, causing more lag with each round. It appears that some data within the scene is not being cleared, leading to rendering in each round. This issue is not limited to Linux systems; Windows experiences the same problem. Even with a GeForce RTX 3070, the frame rate on Windows can drop to 120 FPS, which is highly unsatisfactory.

Keplyx commented 11 months ago

What's happening is that all the bots run on a single thread, and if that thread gets too busy the engine has to wait for it, effectively becoming CPU-bound without maxing out even one thread while also reducing load on the rest of the CPU and GPU.

The issue is not only with bots, but with players in general. I played online and in some maps the game can even reach as low as 20fps on my system, while it never goes below 80fps when playing alone.

474420502 commented 11 months ago

What's happening is that all the bots run on a single thread, and if that thread gets too busy the engine has to wait for it, effectively becoming CPU-bound without maxing out even one thread while also reducing load on the rest of the CPU and GPU.

The issue is not only with bots, but with players in general. I played online and in some maps the game can even reach as low as 20fps on my system, while it never goes below 80fps when playing alone.

Windows and Linux are the same. All models, including firearms, bullet traces, and water flow changes, have an impact. In many cases, playing multiple rounds will decrease the FPS by half. Yesterday, it started at 250 FPS and decreased by 100 FPS after playing 12 rounds in the same scene.

SniperAssault2011 commented 11 months ago

I'd have to agree with this. The more characters there are in the game, the more fps decreases. This isn't limited to Linux alone. I use Windows, the problem still persists. GPU isn't fully utilized and CPU utilization remains at about 30-50%. Also, seems the CPU threads aren't all fully utilized. It's an optimization issue.

ProjectSynchro commented 7 months ago

This issue is pretty bad with the latest update, on Shoots the framerate can drop as low as the mid 30s on a system with an RX 7900XTX, after only a few minutes of play, as there are players dying constantly. When the water is disturbed, it gets even worse.

Meanwhile on Baggage, the issue is still present but far less significant, most likely due to the lack of water on that map.

On Windows on the same system, the issue is negligible compared to the Linux client.

polluxau commented 7 months ago

This issue is pretty bad with the latest update, on Shoots the framerate can drop as low as the mid 30s on a system with an RX 7900XTX, after only a few minutes of play, as there are players dying constantly. When the water is disturbed, it gets even worse.

Meanwhile on Baggage, the issue is still present but far less significant, most likely due to the lack of water on that map.

On Windows on the same system, the issue is negligible compared to the Linux client.

still confuses me how this hasnt been fixed, why cant they just use dxvk? no point in using something if they arent gonna fix core issues with vulkan on linux

ProjectSynchro commented 7 months ago

I wonder why they aren't using dxvk-native, perhaps there's some tech debt from their work on getting the Vulkan renderer working in the first place..

I will say, outside of Arms Race the framerate and framepacing in the game feels a lot better, even with MSAA enabled (which would result in sub 100fps performance previously)

ProjectSynchro commented 7 months ago

On a related note, I'd be curious how bad performance gets on Deck in Arms Race, the issue should be even worse on there...

ProjectSynchro commented 7 months ago

There have been a few patches since I last commented, some have listed "performance improvements" in the changenotes, but there has not been any noticeable changes to performance issues in this case.

Regardless of the graphics preset used (Low, Medium High, etc.), performance gets worse as matches go on.

On maps like Ancient, it gets so bad, that at some points, getting kills in T spawn (in water) is near impossible with players strafing in water.

Is there some way users could help debug what causes this?

System Information: https://gist.github.com/ProjectSynchro/f0d4e4f102ca29c71a683ea49dd4df7e

Keplyx commented 3 months ago

Any update on this? This is the only game behaving this way and I have reinstalled my system so its probably not a driver issue.

Since reporting this last September I have not seen any update improving this. Can we expect a fix, or should we simply give up on the game?

The screenshots in the main post show a minimum of 50fps on my system, but that's while everything is standing still. In a real game it varies between 30 and 60 randomly, with the hardware still barely used.

On my end I think I'll just stop playing until the situation improves. CS2 is not a game you can play at 30fps while everyone else is at 150+.