csgo-osx-linux icon indicating copy to clipboard operation
csgo-osx-linux copied to clipboard

Constant microstutters in Vulkan after a while of playing the game. (**Not related to dxvk state cache generation**)

Open alou-S opened this issue 2 years ago • 193 comments

Your system information

OS: Arch Linux x86_64 Kernel: 5.15.8-228-tkg-pds CPU: Intel i3 540 (4) @ 3.067GHz GPU: NVIDIA GeForce GT 710 Memory: 4GB

Please describe your issue in as much detail as possible:

The game stutters after a certain amount of time playing it. These stutters are mostly constant when in a match. When in the menu the stutters only happen during input events. (Moving/Clicking Mouse, Pressing button on keyboard).

  • The stutters happen consistently when in a match (with our without input events)
  • Not related to dxvk state cache generation (the thing the other issue is about)

The stutters can be fixed by simply restarting the game.

Video of the Problem : https://cdn.discordapp.com/attachments/828263278542716938/922863969247584276/Menu_Stutter.mp4

Steps for reproducing this issue:

  1. Start CS:GO with -vulkan startup flag
  2. Play Game.
  3. Keep playing game for a while.
  4. Experience constant stuttering.

alou-S avatar Dec 21 '21 14:12 alou-S

Hello @alou-S, this issue is already being tracked at #2891. Closing as a duplicate.

kisak-valve avatar Dec 21 '21 15:12 kisak-valve

@kisak-valve This is not related to the original issue. Most of the complaints on the original issue are caused by generation of dxvk state cache. Its common behaviour for games using dxvk to stutter while the pipelines are compiled and cached.

This issues is after complete compilation of the state caches. The game doesn't stutter normally until something triggers it and the consistent stutters start.

alou-S avatar Dec 21 '21 15:12 alou-S

I'm not convinced this is a distinctly separate issue from #2891, but I'll give you the benefit of the doubt.

kisak-valve avatar Dec 21 '21 15:12 kisak-valve

I have been experiencing this as well. The issue is very different from the initial, random frame drops that occur from the cache generation. After a few minutes on the map these go away from me and the game runs incredibly well. However, after about half an hour in game, the frame rate experiences regular drops, in perfect timing. it feels like 2-3 spikes per second. This can only be fixed by restarting the game, and will be fine for a while longer until the same issue occurs.

lionblaze55 avatar Dec 21 '21 16:12 lionblaze55

I've experienced something similar. After around 20-30 minutes of smooth gameplay, it causes my game to lag uncontrollably until a restart. I also experience "normal" stutters that I would assume was caching; though this is different as it is constant and doesn't stop until the game is forcefully closed/restarted.

Don't see any errors in console (starting Steam from terminal), and I tried using RADV_DEBUG hang but I don't see any output.

MichaelDeets avatar Dec 22 '21 09:12 MichaelDeets

Can confirm with RX 6900XT and mesa git.

After a while (~20 minutes? didn't measure) of playing arms race it becomes basically a slideshow, very suddenly with no apparent cause.

system_info.txt

A few seconds of frame time data after it starts happening: output.txt csgo_slideshow

Captured by running csgo with VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay VK_LAYER_MESA_OVERLAY_CONFIG=output_file=/tmp/output.txt,control=mesa_overlay,fps_sampling_period=0 %command%

Then after the issue started:

mesa-overlay-control.py start-capture
mesa-overlay-control.py stop-capture

gnuplot: plot '/tmp/output.txt' using 0:4 with lines, 16600 with lines

ChristophHaag avatar Dec 22 '21 14:12 ChristophHaag

Did not realize there was a separate thread for the FPS stuttering. See below for the post I made on #2891 (https://github.com/ValveSoftware/csgo-osx-linux/issues/2891#issuecomment-1000976337)

Installed Arch Linux with KDE Plasma but still having the stuttering issue after a while of gameplay.

At first it was stuttering while it cached the shaders, but after that finished, it became very smooth until after a couple rounds of DM when it dropped down to 60fps and was very choppy.

Got this error in console:

image

Resource materials/panorama/images/icons/equipment/world.svg failed to load. 0: Reinitialized 4 predictable entities

Manually typed the above because copy and paste isn't working for some reason. Screenshot from clipboard.

System Info: https://gist.github.com/RyanBlakeIT/818fc7a5c23e0b3e32d9067dc10a0155

RyanBlakeIT avatar Dec 25 '21 21:12 RyanBlakeIT

@kisak-valve Anything else you or your team needs to triage this issue? I'm on vacation this week so I have some time to assist in the diagnosis of this issue.

RyanBlakeIT avatar Dec 29 '21 01:12 RyanBlakeIT

Hello @RyanBlakeIT, friendly note that I'm a moderator for Valve's issue trackers on Github, and not a Valve developer myself. We'd need to hear from a CS:GO dev if they want specific information to help them look into this issue further.

kisak-valve avatar Dec 29 '21 01:12 kisak-valve

@kisak-valve Okay, I thought maybe you were also an interface to the development team (as a 'go-between'). My apologies if I wrongly ass-u-me-d. :-(

RyanBlakeIT avatar Dec 29 '21 01:12 RyanBlakeIT

Same issue, works perfectly fine some rounds and then the stutters just comes in like a face slap.

With net_graph 3 I see frame variance of 20+ ms. Tried to limit fps using fps_max 0 => 244 the same variance will occur no matter what.

Before the issue kicks in I have stable FPS without any issues. Noticed that as soon as I bring up the developer console "fixes" the stutter somewhat. (variance drops to 0.5 ms)

6900xt AMD 5900x Steamsysteminfo

CommanderAlchemy avatar Jan 06 '22 13:01 CommanderAlchemy

Vulkan fps boost gone after a while

Issue transferred from https://github.com/ValveSoftware/csgo-osx-linux/issues/2910. @x0r13 posted on 2021-12-30T23:49:03:

Your system information

https://gist.github.com/x0r13/29f662b707727215480c0f483b46b0c4

After trying out the new -vulkan I got a very noticeable fps boost from around 100fps to ~170fps. I played a few matches, and everything was fine (after the stutter from shader creation is gone). Yesterday, the fps boost was gone, and it was back as vulkan wasn't used. I was back at ~100fps, but vulkan was shown in windowed mode, so I guess it was in fact used (also, shaders were being created).

I completely removed steam and all games, reinstalled steam and csgo and tried again. FPS were good again, so I was happy. Today, the same as yesterday happened. FPS are back at 100fps. I deleted the shader cache, and they were re-created, but FPS are still bad.

Any idea what the problem is? Also, is there at least a way to somehow reset steam/csgo without uninstalling everything?


@x0r13 commented on 2021-12-31T02:10:30:

Little update, since this is really weird. I was playing a match (with my low 100fps) when suddenly everything started lagging like crazy. FPS shown where around 100-120 but it felt like 5fps. So I ALT + F4 out of the game and reconnected, and I'm back at 200fps+ ? I tried everything before, but nothing worked.

But that weird lagging happened in two other games as well, out of nowhere it's a slideshow and I have to completely close the game and reconnect.

EDIT: Another thing I noticed: When that lagging happens during a game, and I press ESC to bring up the menu, the fps are instantly back to normal, butter-smooth. As soon as I return to the game, it's lagging again.


@ilievi187 commented on 2022-01-03T20:43:00:

maybe someone from your team or oponents using other kind of software :)


@x0r13 commented on 2022-01-04T23:07:54:

Why would anything another player might have on his client side affect mine? To me it looks like the FPS cannot be correctly synced anymore


@CommanderAlchemy commented on 2022-01-06T13:39:48:

@x0r13 Could this issue be related? https://github.com/ValveSoftware/csgo-osx-linux/issues/2901 Does it stutter for you or is it smooth just fps gone?

Feels like this is the same issue


@x0r13 commented on 2022-01-06T22:28:09:

@CommanderAlchemy No, I haven't experienced stutter in the main menu (but I have limited fps in menu to 60 anyway). My problem is simply that my fps are instead of ~170 all of a sudden 90-110. I can't find a cause for this. Restarting my PC or re-installing steam does not help. Also deleting the shader cache does not help.

Yesterday, the fps were good again (I do not know why) and I was able to play 5 matches without any problems. Today it's back to low fps again.

The other problem I mentioned was extreme lagging/stuttering during a game, which was only in gameplay, and went away when bringing up the menu via ESC key. As soon as I returned to the game it stuttered again. This was reproducible every time I brought up menu and exited it. I had to restart the game to get rid of it. This issue happened four times so far. It appears all of a sudden during game, but I have no way to reproduce it. Yesterday it did not happen.


@lionblaze55 commented on 2022-01-10T20:32:53:

@kisak-valve apologies for the ping (I am sure you are busy) but when you have the chance I think we can close this as a duplicate of #2901. Word for word same issue it seems. @x0r13 if you can close the issue yourself and/or re-post on the aforementioned ticket, that would be great!

kisak-valve avatar Jan 10 '22 21:01 kisak-valve

Okay so after the recent update I have watched a live match for like 40 minutes. The micro stutter behavior didn't seem to start in said 40 minutes. I will play the game for a hour or two when I get some free time to do so and make sure that the problem is gone.

I would like others to confirm if the problem is gone from their end. @lionblaze55 @ChristophHaag @MichaelDeets @RyanBlakeIT

alou-S avatar Jan 18 '22 08:01 alou-S

Okay so after the recent update I have watched a live match for like 40 minutes. The micro stutter behavior didn't seem to start in said 40 minutes. I will play the game for a hour or two when I get some free time to do so and make sure that the problem is gone.

I would like others to confirm if the problem is gone from their end. @lionblaze55 @ChristophHaag @MichaelDeets @RyanBlakeIT

I will play a few games today and see. It would usually lag out 1 or 2 times per full 30 round game, so I will try playing a couple matches without restarting.

EDIT: as @ChristophHaag said, it still happens.

MichaelDeets avatar Jan 18 '22 11:01 MichaelDeets

Still happening

ChristophHaag avatar Jan 18 '22 13:01 ChristophHaag

I have been experiencing this as well. The issue is very different from the initial, random frame drops that occur from the cache generation. After a few minutes on the map these go away from me and the game runs incredibly well. However, after about half an hour in game, the frame rate experiences regular drops, in perfect timing. it feels like 2-3 spikes per second. This can only be fixed by restarting the game, and will be fine for a while longer until the same issue occurs.

So my problems of freezes from 10-20 seconds are "cache generation" on Vulkan? Will it ever be fixed? How to speedup cache generation then?

niereklamuj avatar Jan 19 '22 06:01 niereklamuj

There is also a beta NVIDIA driver available with hundreds of vulkan fixes. https://www.nvidia.com/download/driverResults.aspx/184911/en-us

and please __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 just put this in your /etc/environment and reboot.

You can also try __GL_THREADED_OPTIMIZATIONS=0

romanstingler avatar Jan 21 '22 18:01 romanstingler

There is also a beta NVIDIA driver available with hundreds of vulkan fixes. https://www.nvidia.com/download/driverResults.aspx/184911/en-us

and please __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 just put this in your /etc/environment and reboot.

You can also try __GL_THREADED_OPTIMIZATIONS=0

For CS:GO specific environment variables, I'd recommend adding them to csgo.sh

No need to restart between changes with this method. The environment variables will be applied to CS:GO only. There are a couple environment variables there by default anyway.

It's unlikely to be fixed in driver updates. I'm not even using nVidia and I still get the issue.

MichaelDeets avatar Jan 22 '22 13:01 MichaelDeets

Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/2901#issuecomment-1018768067 https://github.com/ValveSoftware/csgo-osx-linux/issues/2901#issuecomment-1019256655

You can set them as launch options too in steam for this game. Also i cannot see why __GL would affect Vulkan ?

And same for me I'm running AMD w/ radv

CommanderAlchemy avatar Jan 24 '22 11:01 CommanderAlchemy

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

Yeah, nvidia-only OpenGL environment variables wont do anything for Vulkan.

I quite like using csgo.sh if I need to add more than a couple environment variables, as changing the launch options in Steam isn't the easiest. You can also add launch options inside of csgo.sh (which I do instead of using Steam's properties menu) like this:

https://i.imgur.com/PnWKvcu.png

Also, while this is useless for me, the options will persist between accounts when using csgo.sh. When I do change accounts, I often forget to set launch options.

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

https://download.nvidia.com/XFree86/Linux-x86_64/410.66/README/openglenvvariables.html

As shown in the link, these are for OpenGL (hence the '__GL' prefix).

MichaelDeets avatar Jan 24 '22 12:01 MichaelDeets

Okay so good news is that I don't face the microstutters after a while anymore. Bad news is that the game crashes every 30 to 40 minutes now.

So basically the microstutters are replaced with crashes.

alou-S avatar Jan 26 '22 06:01 alou-S

Okay so good news is that I don't face the microstutters after a while anymore. Bad news is that the game crashes every 30 to 40 minutes now.

So basically the microstutters are replaced with crashes.

Maybe not the same thing but at least now you get a trace on the crash, do create a new issue for it.

CommanderAlchemy avatar Jan 28 '22 05:01 CommanderAlchemy

No crash here, but the issue is still happening on 2/1/2022

ChristophHaag avatar Feb 04 '22 14:02 ChristophHaag

Your system information OS: Fedora 35 Kernel: 5.16.5-200.fc35.x86_64 Mesa: 21.3.5-1.fc35 CPU: Ryzen 5600X GPU: Vega 56 Memory: 32GB

Steps for reproducing this issue: I did some experiments to find some systematics. Using the following command-line and the using the symlink to libtcmalloc_minimal.so.0 workaround: DXVK_HUD=frametimes,fps MESA_GLSL_CACHE_DISABLE=1 MESA_DISK_CACHE_SINGLE_FILE=1 %command% -novid -nojoy -nohltv +fps_max 144 -tickrate 128 -vulkan

  1. It tried X11 vs Wayland session, no difference there.
  2. I timed how long it took, till the stuttering starts, the answer is ~26m30s, reproduced 3 times
  • Started the game
  • Started a "Training with Bots" session at Office with Expert Bots
  • Start the timer when loadings starts ~2-3rounds
  1. Than a bit of recoil training. And the result is roughly the same ~25m45s.

Can anyone reproduce this?

soerengrunewald avatar Feb 06 '22 20:02 soerengrunewald

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

If you want to change DXVK cache variables you should use DXVK_STATE_CACHE and DXVK_STATE_CACHE_PATH (the MESA_ variables you used wont change anything for DXVK).

I remember trying to reproduce the issue on my community server (hosted on a separate computer) and found some strange results. Once, I left my computer AFK for 6+ hours overnight and found no issues. Usually when playing on the server (2-4 total players), it would occur at least once during the game (each game would probably take about 25 minutes, which corresponds with what you experienced).

I'm going to do some actual testing (timing start of the game, when the uncontrollable lag occurs, what I was doing, etc.).

MichaelDeets avatar Feb 06 '22 23:02 MichaelDeets

@soerengrunewald OK so I can reproduce your time. Played about 1 hour on an empty server (no issues), added a bot and ~27 minutes later my game started to uncontrollably lag.

Going to do more testing and see how much I can replicate the time.

MichaelDeets avatar Feb 07 '22 00:02 MichaelDeets

@MichaelDeets: Thanks for confirming. I did a couple more tests with different dxvk-native builds, they all behave quite similar.

With the async patch it worked a bit longer. I good a big stutter around the 26m mark, but about 31m I saw the stuttering again and it felt a bit worse.

Disabling the with DXVK_STATE_CACHE=0 as well as moving DXVK_STATE_CACHE_PATH=/tmp to RAM (meaning tmpfs mount) did also not help.

I would assume that this issue is not directly DXVK related. Which is covered by your observation, that it only happens, if there are multiple players involved.

soerengrunewald avatar Feb 07 '22 17:02 soerengrunewald

I think this issue is somehow input, more specifically mouse, related.

If the stuttering occurs and I open up the in-game console (to quickly leave the game) the stuttering is gone. First I thought this is due to the fact that my console window is so large. But then I realized that the windows size does not matter. As soon as the mouse pointer leaves the console window the stuttering is back. Move mouse pointer over the console window, stutter is gone, back out stuttering is back.

Since I start the game with -nojoy, we can exclude gamepad/joystick's as source.

Correction: Also mouse movement inside the console window or typing causes stuttering. But opening the console an do nothing, lets the stutter disappear.

soerengrunewald avatar Feb 08 '22 19:02 soerengrunewald

I think this is related to https://github.com/doitsujin/dxvk/issues/2371. The frametime chart on the screenshot looks exactly the same. And the description matches the observations.

soerengrunewald avatar Feb 08 '22 21:02 soerengrunewald

Yeah, I can confirm that each stuttering occurs after quite a specific game time. Didn't time it but it felt like 30 mins an then the stutter began irreleant of what I was doing at the time in game. Unfortunately -vulkan made the game performance much smoother so I had to bear with the quit/restart routine every 30 mins atm.

GreatBigWhiteWorld avatar Feb 10 '22 04:02 GreatBigWhiteWorld