ValveSoftware / csgo-osx-linux

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

Massive FPS drop if vram goes to system ram and <= 1 GB vram video cards #1206

Open jyte opened 8 years ago

jyte commented 8 years ago

The problem is pretty hard to describe, and seems to occure totally randomly. The game start, and is playable, I usually run between 90 and 150 FPS. And at some point, which is still quite quickly (no more than 3 rounds if lucky, 10s after joining if not so lucky), FPS drops to around 10.

I use ubuntu 16.04 with Unity as a DE. Pretty much stock install except I added a PPA to try a more recent video driver. More info on setup here

Elements I noticed / tried:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 370.28                 Driver Version: 370.28                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 560 Ti  Off  | 0000:01:00.0     N/A |                  N/A |
| 47%   48C    P0    N/A /  N/A |    858MiB /   960MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0                  Not Supported                                         |
+-----------------------------------------------------------------------------+

Game is currently unusable.

Tele42 commented 8 years ago

Hello @jyte, fwiw, your symptoms sound like you are maxing out your vram.

When a vram allocation fails, the video driver kicks the entire vram allocation to system ram, or make a magic decision on what goes to the system ram. So, if the game is making large course-grained allocations, then there can be a fair amount of free vram while still using system ram mapped to the video card. Your best bet is to switch to a lightweight DE which needs less vram than Unity and see if the framerate drop happens less often or at a later round.

It may be interesting to monitor PCIe link utilization in nvidia-settings during the normal and degraded performance scenarios, but at the same time, the large framerate difference may obscure any insight. Another thing to try out is if enabling/disabling multitcore rendering improves the framerate once it becomes degraded.

I have a feeling that the cache of gun models and skins is what is pushing you past 1GB but we'll need to wait for a Valve dev to see if they want to handle this scenario. Macs with 1GB of vram or less may also be affected.

jyte commented 8 years ago

Thank you for the quick response. 1st of all. For real ?! 1Go of VRAM isn't enough for CSGO ?! And it's not even 4k...

Beside that, the "PCIe Bandwidth Utilization" sky rocket when the bug appears, it seems to be around 10% when the problem isn't there. I have no clue what that mean, maybe you can tell me.

I would agree on the lack of VRAM, I lowered the resolution and put some settings to minimal (like texture details that i think should impact vram usage). I didn't had any issue for the little time I played, nor during overwatch review. However, I have that screeshot (taken while alt+tab during the bug). Bug was happening (see high % of pcie bandwith utilization), but VRAM was clearly not full, and far from it. But maybe that's normal, you tell me :-)

nvidia-settings

And other weirdness to me is that starting a game on low settings is ok, but changing settings from high to low once the bug has triggered, won't change a thing, despite reloading the game.

On a side note, if indeed it is due to the lack of VRAM, any tips to keep it "low" ? Is it possible to disable skin in CSGO ? Or which settings impact the more VRAM usage ?

The game was running fine with that very setup (weeks/months ago). I reinstalled ubuntu last weekend and now the game is unsuable. With the exact same graphical settings...

Tele42 commented 8 years ago

Very high PCIe utilization is confirmation that part of the hot path of the game's render pipeline is getting bumped to system ram. Beyond the previous suggestion to free up more vram system-wide, I do not have any more specific adjustments that you can try.

ghost commented 8 years ago

Hi, I think I have the same issue, but didn't narrow it down so as you did. Basically, I have GTX 650 Ti right now and consider upgrading my GPU, but it wouldn't make sense if it's purely bad Valve programming practice. I play on Gentoo Linux, xmonad, nvidia-smi shows 53MiB vram usage when all aplications are off. I currently have nvidia-drivers 375.10 but the same stuff went on with 370.xx, 367.xx etc., so I'm likely to rule out the drivers (they are already too new for this GPU if anything). Now, about the actual gameplay - on low settings, everything is fine, I got like 300fps in menus, always over 120 during gameplay in full HD. I don't run any background processes other than firefox during the game and swapping is disabled (I have 32GB of RAM, never use more than a half), since I hate dying from OS lags. I manipulated with video settings and basically even the smallest deviation from low settings ultimately causes the game to drop down to 5fps or so. It happens instantly if I switch all settings to high, or even in 15 minutes on something lower. I specifically noted once that after picking up some fancy weapon skin from the ground I've got instant framerate drop. I didn't do any profiling at the time, nor collected any logs, since it wouldn't help. Currently I don't play the game since too many cheaters are in the official matchmaking. But all your description seems to match my case too. I also observed that switching video settings (no matter if from low to high or vice versa) during a match causes a 30-40% framerate decrease and it doesn't occur if I make a switch from the main menu or restart the game afterwards. Perhaps that's another issue but I'm not eager to report it. I was actually considering cooling issue or nvidia's power saving mode, since the main issue is somewhat corelated to GPU temperature, but neither monitoring the temperature or switching nvidia-settings's "PowerMizer" to "Prefer Maximum Performance" gave any interesting result. I wonder if there is any vram-quota mechanism on Linux, perhaps BIOS settings might have something to do with that. The same GPU seems to work well on windows client with maximum settings enabled though. Oh, and one more thing, enabling multicore rendering in game seems to bee the fastest way to achieve performance drop. I thought it's related to heating but now I think it's poor code quality, as always in this project (I personally reported 4 segfaults from this and other account). To sum up, I confirm the bug and suggest the OP to test the same hardware with Windows client to rule out hardware issues.

evil-genius9000 commented 8 years ago

I believe I am also suffering from this issue.

arvvoni commented 7 years ago

me too here. my VRAM is only 384 MB. Will increasing it give me more trouble?