ValveSoftware / csgo-osx-linux

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

CS2 VRAM leak #3498

Open BlueGoliath opened 7 months ago

BlueGoliath commented 7 months ago

CS2 has a major VRAM leak, resulting in various texture pop-in issues and performance issues. Screenshot below was taken while doing 1080p low settings.

vram

itouchdennis commented 7 months ago

I feel the same way, on most times I "feel" the framerate lowering on a long match on inferno. I ended up lowering many video settings, it feels like its gone now, not sure if its caused by a specific setting on med/high or if I just have now more time to play until the leak reached my limits.

mackatozis commented 7 months ago

Could you include your System Information and some steps to reproduce as per the instructions in the GitHub issue template? Providing this information is crucial for the developers to accurately reproduce and address the problem you're experiencing.

itouchdennis commented 7 months ago

Your system information

My system informations: https://gist.github.com/itouchdennis/b3bfa12c843fe1d71d99ff274cc4285d

Please describe your issue in as much detail as possible:

Playing CS2 on linux with high settings brings game to stuttering after a while of play, huge FPS drops from around 250 to 60, little stuttering, most noticeable after a long match on inferno (most after around 18 Rounds) but also sometimes on other maps after a while of playing.

MSAA x2 (or csmaa2 - does not really matter) Shadow: high Texture: high Filtering: 4x Shader Detail: high Particle Detail: high Ambient Occlusion On (or disabled, does not seems to matter much) HDR: Quality FidelityFX: Disabled

(Resolution: 3440x1440 - but it should not matter that much, maybe just will speed the process up)

Setting these settings to low will reduce the framedrops: Texture: low Particle: low Ambient Occlusion: Disabled

Does not happen on windows for me.

Steps for reproducing this issue:

  1. Start game
  2. Graphic settings as above
  3. Play some Premier (MM would work also I guess) usually FPS are above 220 - 280 - even on inferno, but after a while the game stutters, most noticeable when holding an AWP or Scout, framerate drops below 180 and will dip often lower, sometimes fps lagspikes to 80 FPS, going back to 180, which feels really weird and not smooth
  4. Restarting the game and steam will not help - lowering some settings will help
jali-peno commented 7 months ago

pretty much exactly the last message, but my machines video card (nvidia rtx 3050ti mobile) has only 4gb of vram which significantly hinders my long term playability. im already using around 3.5gbvram on launching to the menu alone, which may be related or might not.

KenTheWhaleGoddess commented 7 months ago

Sniper Symptom demonstration - https://github.com/ValveSoftware/csgo-osx-linux/issues/3339

itouchdennis commented 7 months ago

Sniper Symptom demonstration - #3339

Might or might not be related. This issue seems like to also happens without a sniper, had it these days on inferno when some molotows and smokes where around. Having a sniper with FPS issues feels just more strange, and it was like the "turn msaa to csmaa2" issue, if the games starts stuttering and having not stable FPS zooming in the first time on the e.g. AWP will let the FPS drop from 180 to 60-80 FPS the first time, it seems like this kind of shader animation is been cached for a while, its not happening the second time scoping in, but waiting some seconds, running around the map and then scope again in, it makes the FPS drop down below 100 again, which feels very weird.

Solution for my last 10 matches where to lower the settings I mentioned above, since then I do not have any trouble and I don't see any huge differences (Besides the highly accurate shadow ambient occlusion brings into the game, thats a small - point for me here)

stolkovandrew commented 7 months ago

Related: #3352, #3294. Both are about high (er than intended?) video memory usage

BlueGoliath commented 7 months ago

The stuttering issue when scoping in is likely because the game is traversing the PCIe bus into system memory. I can see spikes upto 71% that lines up with the stutters, anyway.

So @kisak-valve you said Valve is supporting Linux. Where's the support?

mackatozis commented 7 months ago

So @kisak-valve you said Valve is supporting Linux. Where's the support?

It's crucial to clarify that kisak_valve focus on labeling and refining GitHub issues. They're not involved in game development.

As for the issue, they will address the issue once they find a solution. Not all problems can be solved overnight.

KenTheWhaleGoddess commented 7 months ago

Anecdotally heard that this symptom is demonstrating in Windows as well.

Another Windows user documentation - https://github.com/ValveSoftware/csgo-osx-linux/issues/3339#issuecomment-1758766161

CatalinPuscoci commented 7 months ago

Can confirm the issue on my side, I've been playing deathmatch for 10 minutes and this is the situation (this is endlessly spammed btw) image image after the 10 minutes the console is not very usable since there's just spam of the "out of memory messages"

For reference here's the game after just loading in the same deathmatch map image

The second game I play has weird texturing issues where they'll just pop in and out and the third already starts having frame pacing issues

KenTheWhaleGoddess commented 6 months ago

I saw the same logs as @CatalinPuscoci

Here is my paste - https://gist.github.com/KenTheWhaleGoddess/c44fffc865999c9eb59633fd8057635a

sbarj commented 6 months ago

My machine is:

The first rounds the game works flawlessly, everything is so smooth but the more time I keep the game open, the more stuttering and random framerate drop I get. Doesn't matter the map I'm playing, happens on every one.

I can set all the settings to the max (with 4x MSAA) but textures on Low and it will remove almost all framedrops. There's something wrong with textures management.

On Windows everything works perfectly.

BlueGoliath commented 6 months ago

Is this getting fixed or not?

CatalinPuscoci commented 6 months ago

Is this getting fixed or not?

Latest update seems to offer a better experience, but I still get "out of memory" spam. It's not constant though. Something is better about it.

gregor3000 commented 6 months ago

agreed, this is not consistent anymore. sometimes it lags at other times it does not at all.

jali-peno commented 6 months ago

game runs ever so slightly better for me, but im still capping out vram usage.

also my gpu utilisation is WAY down with this last update

KenTheWhaleGoddess commented 6 months ago

Can anything be done to reduce VRAM usage? I feel like 1080/1080i should be able to handle cs at low resolutions ?

cjvth commented 6 months ago

Probably connected with #3310 For me VRAM leak doesn't happen anymore. Video memory now frees properly after exiting to menu. Textures' resolutions are always high resolution. But my problem may be different from the one @itouchdennis described, since I could fix everything with restarting CS2

KenTheWhaleGoddess commented 6 months ago

After installing new RAM (16gb -> 48gb) this issue's most prominent symptoms significantly decreased.

CatalinPuscoci commented 6 months ago

After installing new RAM (16gb -> 48gb) this issue's most prominent symptoms significantly decreased.

Mine was the "parallel way along", I upgraded the GPU and it seems to stop eating VRAM after like 12-14GB

ilievi187 commented 6 months ago

After installing new RAM (16gb -> 48gb) this issue's most prominent symptoms significantly decreased.

Mine was the "parallel way along", I upgraded the GPU and it seems to stop eating VRAM after like 12-14GB

its steel happend .... after couple of rounds somthimes in begining

mikkorantalainen commented 5 months ago

If you have only 8 GB VRAM and you're interested in worst latency spikes (as you should, IMO), you really cannot max settings, especially the texture. This game seems to use 9–10 GB VRAM with maxed out settings and you really really do not want to run out of VRAM for max performance.

ilievi187 commented 5 months ago

I am playing on low settings , after 20 mins VRAM is maxed out and models are RED.

On Sun, 3 Dec 2023 at 12:16, Mikko Rantalainen @.***> wrote:

If you have only 8 GB VRAM and you're interested in worst latency spikes (as you should, IMO), you really cannot max settings, especially the texture. This game seems to use 9–10 GB VRAM with maxed out settings and you really really do not want to run out of VRAM for max performance.

— Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/csgo-osx-linux/issues/3498#issuecomment-1837433550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWIPNBGRBNZYOVX4S7LVQA3YHRGO7AVCNFSM6AAAAAA6CZ6FS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGQZTGNJVGA . You are receiving this because you commented.Message ID: @.***>

ZeroYamaoka commented 5 months ago

Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/3498#issuecomment-1837478082

Yeah in my case its happens when i buy weapons on half of secound model is red and game send to me lack of vram memory

ZeroYamaoka commented 4 months ago

20231231105006_1 After few matches on Casual the vram was so overloaded that textures didnt load correcly

DanielHuelsmann commented 4 months ago

Sorry for being a bit off-topic, but what programs do you use to view VRAM in-game? I look at the VRAM from the CPU-X application on another monitor. I have a graphic card with 8GB of VRAM, and it used to overflow when playing 2 or 3 games.

cjvth commented 4 months ago

@DanielHuelsmann Mangohud

SolsticeSpectrum commented 4 months ago

@BlueGoliath Seems to be fixed for me with latest update, can you confirm as well?

BlueGoliath commented 4 months ago

It hasn't been fixed.

Overall usage:

overall

Process usage:

process

martin-djakovic commented 4 months ago

Just here to say this problem happens to me as well.

Debian 12, RTX 4060 Ti 8GB (driver version 525), Ryzen 7 5700X, 16GB DDR4 memory. Playing at 1440p, high settings. When just entering a match the VRAM usage is about 3GB, but after playing for a bit it goes up to 7GB out of my total 8GB of VRAM. Severe stuttering, sometimes textures will become black and start flickering.

Note that these issues only occur after a bit of time playing, and usually in the first match the game runs fine. For example if I just play on one map (e.g. deathmatch on Dust II), the issues never occur even after ~30mins playing. Issues are more pronounced on certain maps than others. I found Inferno and Nuke to be particularly bad in this regard.

Tried to play with driver version 545, which got rid of the visual glitches, but stuttering was more severe and would occur immediately when joining a game.

slhddn commented 3 months ago

Same here on Windows. @sbarj mentioned: "The first rounds the game works flawlessly, everything is so smooth but the more time I keep the game open, the more stuttering and random framerate drop I get. Doesn't matter the map I'm playing, happens on every one."

My FPS is around 450-500 once I start a game, DM/MM/Faceit, all the same. Then it drops to 200-350. There is a big diff and it affects the gameplay. No matter what settings I use. Sometimes lagging/freezing.

My setup: Ryzen 7950x RTX 3080Ti 64GB DDR5 Ram Avg Temp in Game ~60-70 C degrees

stunnop commented 3 months ago

I have been getting the AWP scoping stutter issue for some time now on windows 11.

Logging vram usage with amd's software, it does seem to steadily increase throughout a match until it hits max(8gb). Measures that decrease vram usage (ex : texture settings) delay the issue but after enough time it reappears. image ... image

Disabling shader cache helps, maybe because that also reduces vram usage? (I don't know for sure).

ZeroYamaoka commented 3 months ago

Looks like they fixed leak problem after Arms Race update i didnt got any problems

BlueGoliath commented 3 months ago

No they did not.

BlueGoliath commented 3 months ago

cs1

The plateau on the middle/right is Inferno where stuttering was felt and texture pop-in was seen. The left was Overpass where stuttering was felt.

Anyway, Valve needs to start paying me for having to double-check their work every update. This is ridiculous.

gregor3000 commented 3 months ago

memory leak is now present in inventory screen as well as later on main menu screen. it causes textures to downgrade in quality until it can no longer render it. console is now flodded with vram full messages. Italy background on main menu after running out of vram: 20240208181222_1nomorevram_resized

my console was updating so fast i could not get any text to show on screenshot. but another player managed to capture it. i believe it is same message as when you scope with sniper and low textures load with significant lag.

game started to lag the longer we played, the worse the lag. finally while i could exit at the end of match another player had such big lag that they barely got out of the game. we are talking screen stills kind of lag here on an older Ryzen 7 with 16 GB ram and nvidia GTX1650

ZeroYamaoka commented 3 months ago

Hmm weird i was testing inferno and Tera and i think they did something to make render to NOT reach the maximum Vram but yes there still is the leak but not so noticeable on 8 Gigs of vram soo i think they doing something but still needs lot of improvements

In my case its hold on around 7 GB and when its reach 7.2 it automaticaly goes to 6.8 GB

UPDATE: I figured out that now Vram leak can happend in lobby its easy to reproduce you need to open some cases and the game get lack of Vram

20240210214546_1

BlueGoliath commented 3 months ago

Great. Can we stop claiming the issues are fixed with every update?

And @kisak-valve, you work for Valve. Why can't you ask internally if any work to fix this has been done? Why do I have to waste time validating if a new update fixes problems? Your company has already stolen CS:GO from my Steam account and refuses to fix performance issues. Can you at least check internally before adding "needs retest"?

CatalinPuscoci commented 3 months ago

@BlueGoliath I think the issue is big enough that you'd see it in the patch notes if it got solved. But I may be wrong, so I suppose it's safer to mark as "needs retest" every patch

BlueGoliath commented 3 months ago

Before someone says anything: no.

Disco-Robot commented 3 months ago

Same issue, vram goes nuts and after a while my fps just go to the gutter and my computer freezes/crashes.

System Info

Computer Information:
Manufacturer: HP
Model: 8A3F
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 5 5600H with Radeon Graphics
CPU Family: 0x19
CPU Model: 0x50
CPU Stepping: 0x0
CPU Type: 0x0
Speed: 4280 MHz
12 logical processors
6 physical processors
Hyper-threading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
SSE4a: Supported
SSE41: Supported
SSE42: Supported
AES: Supported
AVX: Supported
AVX2: Supported
AVX512F: Unsupported
AVX512PF: Unsupported
AVX512ER: Unsupported
AVX512CD: Unsupported
AVX512VNNI: Unsupported
SHA: Supported
CMPXCHG16B: Supported
LAHF/SAHF: Supported
PrefetchW: Unsupported
Operating System Version:
"Arch Linux" (64 bit)
Kernel Name: Linux
Kernel Version: 6.7.5-arch1-1
X Server Vendor: The X.Org Foundation
X Server Release: 12302004
X Window Manager: wlroots wm
Steam Runtime Version: steam-runtime_0.20231127.68515
Video Card:
Driver: AMD AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.57, 6.7.5-arch1-1)
Driver Version: 4.6 (Compatibility Profile) Mesa 24.0.1-arch1.1
OpenGL Version: 4.6
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 144 Hz
VendorID: 0x1002
DeviceID: 0x1638
Revision Not Detected
Number of Monitors: 1
Number of Logical Video Cards: 1
Primary Display Resolution: 1920 x 1080
Desktop Resolution: 1920 x 1080
Primary Display Size: 13.39" x 7.48" (15.31" diag), 34.0cm x 19.0cm (38.9cm diag)
Primary VRAM: 512 MB
Sound card:
Audio device: ATI R6xx HDMI
Memory:
RAM: 7271 Mb
VR Hardware:
VR Headset: None detected
Miscellaneous:
UI Language: English
LANG: en_US.UTF-8
Total Hard Disk Space Available: 487872 MB
Largest Free Hard Disk Block: 336916 MB
Storage:
Number of SSDs: 1
SSD sizes: 512G
Number of HDDs: 0
Number of removable drives: 0

How to reproduce Get into deathmatch game and in 1-2 matches the system goes to crap.

Logs I obtained

Sorry could create a gist of the mangohub thingy.

mangohub.csv radeontop.txt

ilievi187 commented 2 months ago

Hello guys , same problem persist. Tested with 6600XT latest mesa 24+ and zen kernel on arch. All the same after a while game just start to lag and its using all of the vram avaible.

Paradist commented 2 months ago

Same problem on Ubuntu 22.04

ZeroYamaoka commented 2 months ago

https://github.com/ValveSoftware/csgo-osx-linux/issues/3642#issuecomment-1976509045 I think its worthy to mention here

gabaozin commented 2 months ago

Hello,

My laptop is the lenovo Legion with a Geforce RTX 3060, 16Gb of RAM, CPU 12th Gen Intel(R) Core(TM) i7-12700H.

OS is Deepin 23, linux.

On low config I start the game with 70-100fps stuttering, and after less than 5 minutes it goes to 1fps, the computer freezes or runs at 1% speed, you click something and have to wait for 5 minutes for it to happen.

RAM goes to 100% with CS2 using between 7 and 8Gb.

It feels to me that the game is not using the correct GPU. I can´t think of other reasons..

EDIT: I improved my perfomance a lot just by doing this:

$ sudo apt update

$ sudo apt install nvidia-detect nvidia-driver

Now I'm playing with settings very-high at 70-100 fps.

ilievi187 commented 2 months ago

SAME THING

On Sat, 16 Mar 2024 at 21:57, Gabriel Queiroz @.***> wrote:

Hello,

My laptop is the lenovo Legion with a Geforce RTX 3060, 16Gb of RAM, CPU 12th Gen Intel(R) Core(TM) i7-12700H.

OS is Deepin 23, linux.

On low config I start the game with 70-100fps stuttering, and after less then 5 minutes it goes to 1fps, the computer freezes or runs at 1% speed, you click something and have to wait for 5 minutes for it to happen.

RAM goes to 100% with CS2 using between 7 and 8Gb.

It feels to me that the game is not using the correct GPU. I can´t think of other reasons..

— Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/csgo-osx-linux/issues/3498#issuecomment-2002108416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWIPNBBU33B6X5UK5J6IQWLYYSP33AVCNFSM6AAAAAA6CZ6FS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSGEYDQNBRGY . You are receiving this because you commented.Message ID: @.***>

BlueGoliath commented 2 months ago

Valve isn't going to fix this. Stop.

ZeroYamaoka commented 1 month ago

Any news ?

ilievi187 commented 1 month ago

Hello recetly i've upgraded my gpu to 7900xt , i've played and i notice some hinching like droping to 200 and below fps and i am wondering is the game actually shader caching somthing or is the same vram leack. I will test doday with some monitoring soft to check it out what is happening. To be sure Also the game is really strange feeling like when i am straifing is very slow comparing to windows .