Closed an0nfunc closed 4 months ago
Try the -nojoy
launch parameter
In CSGO, adding LD_PRELOAD="/usr/lib64/libSDL2-2.0.so.0" SDL_VIDEODRIVER=wayland
as a launch option to force it to run as a wayland window fixed all stutters/jitters on my end (In the past for CSGO, not CS2). Could be a XWayland issue?
Try the
-nojoy
launch parameter
I have that one already.
In CSGO, adding
LD_PRELOAD="/usr/lib64/libSDL2-2.0.so.0" SDL_VIDEODRIVER=wayland
as a launch option to force it to run as a wayland window fixed all stutters/jitters on my end. Could be a XWayland issue?
I'll try this, give me a second.
EDIT: As noted by @alou-S, this does not work.
In CSGO, adding
LD_PRELOAD="/usr/lib64/libSDL2-2.0.so.0" SDL_VIDEODRIVER=wayland
as a launch option to force it to run as a wayland window fixed all stutters/jitters on my end. Could be a XWayland issue?
CS2 and Source 2 uses SDL3 this won't work.
@an0nfunc Could you give the replies for glxinfo -B
@alou-S glxinfo -B
: https://gist.github.com/an0nfunc/5d77bbb5b37d929b52855e45619282e0
@an0nfunc Do you have a separate dedicated GPU or CS2 run on the iGPU?
In CSGO, adding
LD_PRELOAD="/usr/lib64/libSDL2-2.0.so.0" SDL_VIDEODRIVER=wayland
as a launch option to force it to run as a wayland window fixed all stutters/jitters on my end. Could be a XWayland issue?CS2 and Source 2 uses SDL3 this won't work.
@an0nfunc Could you give the replies for
glxinfo -B
I wrote "in CSGO"... Anyways, maybe there's something similar for sdl3?
@an0nfunc Do you have a separate dedicated GPU or CS2 run on the iGPU?
As you can see in my sys info, the 3800X does not posses an igp.
Erm my bad so you use a Vega 10 GPU ehehe. Pardon my ignorance. I'll try debugging directly on sway, I don't seem to have any issues on Kwin Wayland (KDE) with the latest mesa-git drivers.
Erm my bad so you use a Vega 10 GPU ehehe. Pardon my ignorance. I'll try debugging directly on sway, I don't seem to have any issues on Kwin Wayland (KDE) with the latest mesa-git drivers.
Should I try mesa-git
?
edit: Give me a sec, compiling...
You could attempt, If you are using Arch derivative distros you can get mesa-tkg-git straight from Chaotic AUR. Its pre-compiled.
Mesa is compiled quickly enough, just takes a few minutes. I'll report back.
EDIT: Still happens on mesa 23.3.0_devel.178293.65afc8bebf4.d41d8cd-1
.
Try disable Steam Overlay. Used to fix a similar issue when using dxvk on CS:GO
Also happens with Steam Overlay disabled. I noticed it's much more intense after visiting advanced video options once. (unrelated to the overlay, just an observation)
Try FSR Ultra Quality, it fixed stuttering for me and others.
I'm on Debian SId + mesa experimental + KDE + Wayland, game is running smooth as butter. All stock settings. 5600X + 6900 XT.
Just noticed that these stutters correspond with log messages in the ingame-console. Must have been tired yesterday to not notice.
CSwapChainBase::QueuePresentAndWait() looped for 21 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 1 ) after 0.255553 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 22 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 2 ) after 0.252701 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 21 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 1 ) after 0.252569 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 22 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 2 ) after 0.252716 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 21 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 1 ) after 0.255026 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 22 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 2 ) after 0.257787 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 21 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 1 ) after 0.256348 seconds, error = VK_TIMEOUT
CSwapChainBase::QueuePresentAndWait() looped for 22 iterations without a present event.
[RenderSystem] FrameSync() - bailing out of vkWaitForFences( fenceCount = 2 ) after 0.251057 seconds, error = VK_TIMEOUT
I cannot reproduce this under sway with a 5700xt. no stutter or vulkan related error messages.
As I commented here: https://github.com/ValveSoftware/csgo-osx-linux/issues/3307#issuecomment-1739680927
For me lowering the graphics and disabling MSAA and FSR worked. Especially MSAA. I'm using Fedora Linux with AMD Mesa drivers.
Reduced stutter so much.
Downgrading to mesa 23.0.3
seems to fix this. Not sure if the problem is on mesa or CS2's side.
EDIT: I'm currently bisecting mesa to find out what commit we are dealing with.
Upstream mesa issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9902
I am consistently having 60 fps in cs2, but not on Xorg. Is it related?
For a simpler solution than switching to Xorg, running steam and CS2 in fullscreen gamescope gives a much higher consistent framerate (on KDE Wayland).
For a simpler solution than switching to Xorg, running steam and CS2 in fullscreen gamescope gives a much higher consistent framerate (on KDE Wayland).
Swag thanks for sharing
This seems to be gone for me on linux lts (6.1.61).
This seems to be gone for me on linux lts (6.1.61).
I just tried this on 6.1 because Xorg was crashing and the stutter is still there and my GPU is maxed out. No clue what's going on there.
CS2 Choppy on Wayland / Stutters
Issue transferred from https://github.com/ValveSoftware/csgo-osx-linux/issues/3542. @sparkie3 posted on 2023-11-07T15:51:58:
Steam
-> Help
-> System Information
) in a gist: CS2 is very choppy on Wayland. It is similar to have the GPU on low power settings when playing, however I have manually set the power profile to the highest and verified via nvtop that the GPU power settings are at the highest level while playing. The game will smooth out if vsync is disabled, but the filtering also makes the game unplayable. I've tried multiple kernels, and tried 6.1 as another bug report suggested. The game is unplayable as it sits due to the choppy rendering.
Here is the console output: https://gist.github.com/sparkie3/99d49fb4ec49d4cfe53d10dd3b42f914
Gamescope helps a bit, until it enters a state that is even worse and unplayable. X11 is perfectly smooth.
For me it correlates with package loss / choke. It starts smoothish and stutters once there are network imperfections. After some time it recovers a little, but it keeps being stuttery. I don't know if it's caused by it, or vice verse.. or at all connected.
Using a higher refresh rate monitor and freesync helps with this. There are still stutters but not quite as bad. I'm using the 6.7 dev kernels.
For me personally it worked fine during October/November and then at some point in December it started stuttering and was unable to keep up stable FPS. GPU usage was ~70% and CPU usage much lower than that.
Today Steam downloaded shader cache and then did some shader compilation, and now again it works fine without any stuttering and having stable FPS.
FPS on Linux seems lower than on Windows 10 but then again I have to play with variable refresh rate to not have forced v-sync, so I am limiting to 140fps anyway, which also allows to set everything on recommended high settings (1440p, 4x MSAA, high, high, 4x anisotropic filtering, FSR off). Without limiting FPS I get 200+ FPS on de_dust2. I also tried it on xorg and I get similar FPS there.
So having tried out different mesa and xwayland versions I concluded that it probably had something to do with shader cache and not mesa/xwayland itself.
Running CS2 on: Arch Linux, currently kernel v6.6.9, Ryzen 7 5800X, Radeon RX 6800 XT, Gnome Wayland with mutter VRR patches.
Playing with VRR at 140FPS feels good on Linux, was able to rank up and play at purple ranks without issues. I hope the performance doesn't degrade again any time soon. And looking forward to getting native wayland support for CS2 without xwayland.
The upstream mesa issue was resolved, so I think this can be closed?
Closing per the last comment.
What is the solution for this problem?
Use a recent kernel essentially
Your system information
Please describe your issue in as much detail as possible:
Stutter under Wayland (sway) + AMDGPU. This does not happen with X11 (i3).
As soon as the game runs a few seconds, there are severe stutters down to 1 fps every few seconds. Seems to be getting more frequent if the game runs for a while.
Log messages that seem to relate to this issue:
Steps for reproducing this issue: