ValveSoftware / csgo-osx-linux

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

Distinct lag when zooming in a sniper rifle #3339

Closed gregor3000 closed 6 months ago

gregor3000 commented 1 year ago

Your system information

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.

When zooming in a lag occurs. This happens in MM, DM, practice session. The strange thing is it is not always present. Sometimes the zoom inn works fine sometimes it lags significantly. It seems the lag is only visual. If i click zoom in and fire it will hit and record a zoomed in hit even if i short into dark screen.

Steps for reproducing this issue:

  1. Zoom in a sniper rifle
  2. It is not always reproducable but it occurs in about half of the cases when i click zoom in.

i tested on a similar PC but with slightly stronger CPU and result is the same. only sometimes there is a substantial lag when i click zoom in. and other times there is none.

i left all GPU settings as they were default which is mostly high. i set the video to full screen as this should turn off any Plasma special effects.

i did not notice other major performance issues. But so far i tested a few practice maps, an MM game and a casual game.

deanrih commented 1 year ago

I can confirm, all sniper scope causes substantial frame freeze/lag spike when scoped in, but AR like AUG and SSG/SG(?) doesnt, also it seems that whenever this "lag" occur, the "scope texture" seems on it's lowest resolution, e.g pixelated, and then become "normal", and for quick subsequent scope doesn't trigger this "spike", that is until you forgot to scope in for 1~3 seconds and the next time you scope in again, the spike will occur alongside with the low resolution scope texture, it feels like some kind of texture streaming or something.

My setup: Manjaro (Arch Linux) Intel i3-8100 NVIDIA RTX 2060 6GB 4K Monitor (I have to play at 4K because using 1080 resolution causes mouse skip/sensitivity issue)

gregor3000 commented 1 year ago

i forgot about the textures. in my case they seem low res when this happens and then get loaded in higher res. only SSG, AWP and autosniper are affected. and after some more game play it still does not happen all the time, but i can say most of the time. moving while zoomed in seems fine.

deanrih commented 1 year ago

I can confirm, all sniper scope causes substantial frame freeze/lag spike when scoped in, but AR like AUG and SSG/SG(?) doesnt, also it seems that whenever this "lag" occur, the "scope texture" seems on it's lowest resolution, e.g pixelated, and then become "normal", and for quick subsequent scope doesn't trigger this "spike", that is until you forgot to scope in for 1~3 seconds and the next time you scope in again, the spike will occur alongside with the low resolution scope texture, it feels like some kind of texture streaming or something.

My setup: Manjaro (Arch Linux) Intel i3-8100 NVIDIA RTX 2060 6GB 4K Monitor (I have to play at 4K because using 1080 resolution causes mouse skip/sensitivity issue)

I think I found the issue, at least in my setup, my quality was set to either high or medium, and at that setting the scope causes significant lag spike and having low res for a moment before going full res texture scope, I suspect that happened because my VRAM is used up 100%, so I believe CS2 trying to stream the scope texture, but since the VRAM is full, it releases some other resource, which causes the lag, and then load the scope texture, on low setting however, it doesn't occur because my VRAM hovering around ~3GB

deanrih commented 1 year ago

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

NOPE, SCRATCH that, this morning (local timezone) I play CS2 and keep in mind my setting now is Low, the scope lag spike still persist, but not as severe as on medium settings, but significant enough that it is impossible to get a kill through a scoped sniper and probably getting killed instead. And yes, the "low res scope" still occurs when the lag spike happened.

Caliel666 commented 1 year ago

the vulkan implementation has awful VRAM utilization #3294 #3352, combine that with the vram spike scoping does causes the stutter and other vram issues in the game, i'm having a terrible time with 8GB of vram, i can't imagine other people that have less

deanrih commented 1 year ago

the vulkan implementation has awful VRAM utilization #3294 #3352, combine that with the vram spike scoping does causes the stutter and other vram issues in the game, i'm having a terrible time with 8GB of vram, i can't imagine other people that have less

I only have OK-ish experience on Low, and even that my VRAM usage is hovering around 60~70%, which is surprising because Dota 2's implementation of Vulkan is fine and I played it 4K Max without FSR and VSYNC, but CS2 I have to go Low and even that I still experience Scope Freeze, and I can't go 1080p because of #3342

UNIm95 commented 1 year ago

the vulkan implementation has awful VRAM utilization #3294 #3352, combine that with the vram spike scoping does causes the stutter and other vram issues in the game, i'm having a terrible time with 8GB of vram, i can't imagine other people that have less

I only have OK-ish experience on Low, and even that my VRAM usage is hovering around 60~70%, which is surprising because Dota 2's implementation of Vulkan is fine and I played it 4K Max without FSR and VSYNC, but CS2 I have to go Low and even that I still experience Scope Freeze, and I can't go 1080p because of #3342

Try to set 1080p resolution on display before starting game.
It will work, however your mouse sensitivity would be changed.

Caliel666 commented 1 year ago

Try to set 1080p resolution on display before starting game. It will work, however your mouse sensitivity would be changed.

can't speak for everyone else but i would if i could, however, probably due to multiple monitors not only the sensitivity changes but the mouse also gets stuck and fullscreen mode is basically broken

KenTheWhaleGoddess commented 1 year ago

+1 experience with

Nvidia 535, Linux Mint 64 bit Kernel 6.2.1

KenTheWhaleGoddess commented 1 year ago

This is one of the most game-impacting issues for me (lag when scope sniper rifles). The texture/graphics, etc I see as less game-impacting, just quality of life that I know will get sorted out over time.

deanrih commented 1 year ago

I don't know whether this is a relevant information or can help Valve or not, but in my curiosity, I try to keeping an eye on GPU Memory usage using NVTOP and while scoping in, it takes roughly 700MiB, while scoped in, then that ~700MiB usage gone, (from ~5.1GiB to ~5.8GiB back to ~5.1GiB) here's the screenshot of the NVTOP

image

Area selected by white rounded rectangle is the moment I use sniper scope, after that is when I'm no longer scoping.

The area selected by yellow-ish rounded rectangle is the moment I alt-tabbed out of CS2 to take the screenshot, in case somebody asking what's the dip in the GPU usage.

Khalahari commented 1 year ago

Same here for me. 4060 8gb + ryzen 9 + 16gb ddr5 + 2560x1440 165hz qhd.

gregor3000 commented 1 year ago

i did some more test. i don't know if this is helpful. but on practice the issue appears less.

Two games in practice and two games in competitive.

practice - i loaded with bots and then played around with sniping. maps were anubis and nuke. for about 8 rounds on Anubis there were no issues, no lags nothing. i tried shooting watter., zooming in watter, zooming into bots running against me, zooming into bots running past me. then on 9th round i got the first lag, then it became more frequent. but still not as much as i noticed when playing on server.

then i played nuke. lag appeared sooner (5th or 6th round) and was quite persistent when aiming form heaven towards red/secret. no so much inside.

then i exited the game and relaunched it. i played mirage and office in competitive. on mirage the issue appeared fast (second time i zoomed into a wall). especially if a skinned agent ran by while i zoomed in. again once you zoom in there is no issue. on office it held a bit longer, but then also was quite consistent from 4th time i zoomed in. not always but i would say in about 90 % of the time.

in both competitive games i apologised to the team.

when i was lagging a lot i decided to switch to SG / AUG (depending on side. and there is absolutely no lag there. in fact zooming in on those rifles is rather fast.

i wish i could do proper tests with 10 men team or some community server, where we could really record in some way to pinpoint the occasion where this happens. however, (and this is not really scientific) it seems to me it is happeniong more often with agent skins present and when there is also additional screen movement present in scoped in area. again only in sniper rifles on on SG/AUG. once you scope in it works as expected there is no lag, no matter if they run, peek with or without agent skin...

rlabrecque commented 1 year ago

FWIW this problem isn't linux specific, I am experiencing the same thing on Windows with an 8GB RTX2070Ti, latest drivers. Turning down textures/models and anything that increases GPU memory drastically helped thanks to this thread!

compumike commented 1 year ago

I also confirm @deanrih 's comment about nvtop showing a large immediate spike (~700 MB) in VRAM usage when scoping in with AWP/Scout, which goes away when unscoped. Is this expected?

(NVIDIA GeForce RTX 2060 6GB, 535.113.01, Linux 6.5.4, Pop!_OS. All "Advanced Video" settings already at their lowest.)

When this VRAM usage spike bumps against the 100% VRAM level, it turns into a ~half second rendering freeze on scoping.

For me, closing other applications (browser, etc) before launching CS2 freed enough VRAM memory that this now only happens sometimes, instead of always. But still a problem when it happens.

masondaniels commented 12 months ago

I have the same issue, scoping with the awp/ssg causes a significant lag spike. There is not really a place for me to report windows bugs, but this affects windows as well.

KenTheWhaleGoddess commented 12 months ago

@masondaniels that's actually very important, its hinting that this isnt an issue with Linux's build. I think a big symptom is spikes in VRAM use?

deanrih commented 12 months ago

@masondaniels that's actually very important, its hinting that this isnt an issue with Linux's build. I think a big symptom is spikes in VRAM use?

Which mean it could be CS2's Vulkan implementation that causes this, that is if @masondaniels also uses Vulkan (I don't know if Windows can use other than Vulkan, CMIIW)

AreYouConfused commented 11 months ago

I get this same issue on my 3gb gtx 1060 with the console output

[RenderSystem] vmaAllocateMemory failed for DEVICE_LOCAL memory indicating video memory is full, trying again in system memory as a fallback.

And then 1-2 seconds after unscoping I get another lag spike (no console output) and then zooming causes the lag and console print again.

gregor3000 commented 11 months ago

this is no longer always reproducable. sometimes it would work as expected other timers there is still a lag. skipping shader precaching made it work correctly on one map (office, practice), but the issue reappeared when i loaded another map (mirage, practice). Then next day MM on mirage no issue, then i loaded practice map nuke for grenade throw practice and it reappeared. it is no longer consistent.

compumike commented 10 months ago

This is still happening for me with the November 20, 2023 CS2 patch. Significant pauses when zooming in with the AWP or scout.

When there is no freeze (because other application VRAM use is low enough?), nvtop shows a ~700 MB spike in VRAM usage when scoping in, which is released a few seconds after unscope.

When there is a freeze (because other application VRAM use is too high, I suppose), the GPU utilization stalls which is visible in the nvtop blue line:

nvtop

(These periods of blue line GPU% drops on the right half of the graph correspond to times between shots on the AWP while I was spectating someone.)

When this happens, there is also output to the console, TEXTURESTREAMING: Extremely low memory:

console

NVIDIA driver 545.29.02, NVIDIA GeForce RTX 2060. Thank you.

gregor3000 commented 10 months ago

if you preload shaders it is better for some time but it gets worse as you play. in addition to that smoke is gone on occasion. you can see right through it while scoped. it is like it's not even there. luckily i was testing against bots. at first i didn't even notice it. bit yes, just as textures get worse when zoom in and then better so does the smoke dissapear and then when you unscope it reappears. but only after some time after memory is emptied & reloaded it seems.

asheriif commented 9 months ago

Is there any plan to address this? It's kind of a game breaking issue. I can't use snipers at all.

compumike commented 8 months ago

Still present on 1/22/2024 version.

AT14C commented 8 months ago

Still present on the 2/7/2024 version

izeroo commented 7 months ago

~Still present on 2/15/2024 version. On RTX 2060 with Ryzen 4600H with 1280x960 with lowest setting, this is unimaginable and unacceptable.~ Fixed

compumike commented 7 months ago

🎉 OMG... it is just fixed for me! On the 2024-02-15 build. Says Feb 15 16:38:55 in the bottom left corner.

No more scope lag on AWP or SSG.

No more spike in nvtop GPU MEM usage.

Smooth and working! 😄

Can anyone else confirm?

Release notes: https://store.steampowered.com/news/app/730/view/6856237235656946987

[ MISC ] Fixed sniper scope performance hitch and adjusted visual treatment.

gregor3000 commented 7 months ago

This one is fixed for me. i went 2 practice maps and there were no longer lags when zooming in or out.

masondaniels commented 7 months ago

Fixed on windows! There is an initial spike when scoping for the first time on my machine. But after that, there is no lag when scoping again. Even across games. I can play the game now! Thank you!

deanrih commented 7 months ago

So far I have no experienced the lag when scoping, not even on the first time scoping in, seems like it's fixed

Manjaro Linux (Arch)
Kernel 6.7.4-2
X11
Intel Core i3-8100
NVIDIA GeForce RTX 2060
kisak-valve commented 6 months ago

Closing as fixed in the 2024-02-15 Counter-Strike 2 update.