ValveSoftware / csgo-osx-linux

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

can no longer run cs2 under wayland with the latest update 4/10/2023 #3402

Closed polluxau closed 1 year ago

polluxau 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.

Steps for reproducing this issue:

  1. install cs2
  2. try to launch cs2 under wayland kwin on the latest kde plasma desktop
  3. closes after a wayland shortcut comes up for a few seconds

⚠️⚠️WE ADVICE USERS TO USE THIS AS A LAST RESORT BEFORE TRYING EVERYTHING ELSE TO GET CS2 WORKING⚠️⚠️

⚠️⚠️WHEN THIS IS FIXED, REMOVE THESE LAUNCH COMMANDS TO RUN CS PROPERLY UNDER WAYLAND ⚠️⚠️

For Wayland to work use this environment variable

SDL_VIDEO_DRIVER=x11 %command%

Or this one aswell

WAYLAND_DISPLAY= %command%

This will force sdl into thinking that cs2 or dota 2 is in x11

If you're using flatpak steam just disable Wayland socket in flatseal

polluxau commented 1 year ago

i was playing just before under wayland then after the newest update i can longer launch it under wayland, x11 works fine

tbergman99 commented 1 year ago

I have the same issues aswell. Just went from wayland to x11 and it works. I was playing on wayland right before the update

lou-perret commented 1 year ago

Same for me. Didn't try on X11, but I was playing fine, stopped the game, installed the update, and it doesn't work anymore.

All I see is

/games/SteamLibrary/steamapps/common/Counter-Strike Global Offensive/game/cs2.sh: line 115: 8973 Segmentation fault (core dumped) ${STEAM_RUNTIME_PREFIX} ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"

EDIT: I do have zenity: symbol lookup error: /lib/x86_64-linux-gnu/libgtk-3.so.0: undefined symbol: pango_font_family_get_face as well

vaxerski commented 1 year ago

I believe this is the real problem:

zenity: symbol lookup error: /lib/x86_64-linux-gnu/libgtk-3.so.0: undefined symbol: pango_font_family_get_face
gegnep commented 1 year ago

Same, running on up-to-date arch system using Hyprland (wayland compositor), havent tried in X11. get this error symbol lookup error: /lib/x86\_64-linux-gnu/libgtk-3.so.0: undefined symbol: pango\_font\_family\_get\_face

droyd9 commented 1 year ago

same for me, updated the game, and then it's gone

gerelef commented 1 year ago

Same in Wayland GNOME, Fedora 37

Zer0-One commented 1 year ago

[ 1302.313677] dota2[23761]: segfault at 0 ip 00007f9e78a33d1b sp 00007fff2771aef0 error 4 in libc.so.6[7f9e78a10000+158000] likely on CPU 15 (core 15, socket 0)

[ 1429.728651] cs2[25965]: segfault at 0 ip 00007fd3ea3c1d1b sp 00007ffc86658810 error 4 in libc.so.6[7fd3ea39e000+158000] likely on CPU 11 (core 11, socket 0)

Segfault occurs for both dota2 and cs2, so it's probably an engine update that broke things.

gegnep commented 1 year ago

found a temp fix, unsetting the WAYLAND_DISPLAY env variable lets the game launch. example, my launch options that worked: WAYLAND_DISPLAY= %command% -vulkan -nojoy -language textmod

vaxerski commented 1 year ago

right. That works. Odd that SDL_VIDEODRIVER=x11 does not. Did valve try to hardcode wayland support and fail? lol

polluxau commented 1 year ago

found a temp fix, unsetting the WAYLAND_DISPLAY env variable lets the game launch. example, my launch options that worked: WAYLAND_DISPLAY= %command% -vulkan -nojoy -language textmod

yep now it works, thank you.

my launch command at the moment is this KWIN_DRM_NO_AMS=1 WAYLAND_DISPLAY= %command%

love the linux community

Etaash-mathamsetty commented 1 year ago

right. That works. Odd that SDL_VIDEODRIVER=x11 does not. Did valve try to hardcode wayland support and fail? lol

SDL_VIDEODRIVER is the old variable, SDL_VIDEO_DRIVER=x11 works and yes they seem to try to default to wayland now I guess

polluxau commented 1 year ago

right. That works. Odd that SDL_VIDEODRIVER=x11 does not. Did valve try to hardcode wayland support and fail? lol

SDL_VIDEODRIVER is the old variable, SDL_VIDEO_DRIVER=x11 works and yes they seem to try to default to wayland now I guess

At least they're trying 😂

rcannizzaro commented 1 year ago

Also had this issue and the fix above works.

antipsychotics commented 1 year ago

SDL3 defaults to wayland unless the application requests otherwise Also the undefined symbol: pango_font_family_get_face is weird because my libgtk-3.so.0 has that symbol

alou-S commented 1 year ago

@pollux56 Edit in the temporary workaround SDL_VIDEO_DRIVER=x11 to your original post. This will help people who come here newly.

Valve probably accidentally enabled Wayland on the SDL build and the game won't start anymore since it doesn't have proper Wayland support.

polluxau commented 1 year ago

@pollux56 Edit in the temporary workaround SDL_VIDEO_DRIVER=x11 to your original post. This will help people who come here newly.

Valve probably accidentally enabled Wayland on the SDL build and the game won't start anymore.

Is the SDL_VIDEO_DRIVER=x11 a fix for running it under Wayland as well or is it for x11?

alou-S commented 1 year ago

@pollux56 Edit in the temporary workaround SDL_VIDEO_DRIVER=x11 to your original post. This will help people who come here newly. Valve probably accidentally enabled Wayland on the SDL build and the game won't start anymore.

Is the SDL_VIDEO_DRIVER=x11 a fix for running it under Wayland as well?

Yes SDL_VIDEO_DRIVER=x11 forces SDL to use the x11 driver instead of the wayland driver.

WAYLAND_DISPLAY= unsets the the parameter fooling SDL into thinking that its a x11 system hence starting with the x11 video driver.

Only one of either envar's are required. The first one preferably.

wizardlink commented 1 year ago

@kisak-valve, can we get a beta branch for CS2 and DOTA 2? We are having pushes every day to both lately, earlier we had another SDL bug with audio and now with video. I would absolutely use the beta and report in the appropriate channels when a problem arises, but having this on the stable releases is just frustrating.

sameer commented 1 year ago

Valve probably accidentally enabled Wayland on the SDL build and the game won't start anymore since it doesn't have proper Wayland support.

That sounds right, I compiled SDL3 with Wayland support & replaced it the other day and got the same exact error.

polluxau commented 1 year ago

@kisak-valve, can we get a beta branch for CS2 and DOTA 2? We are having pushes every day to both lately, earlier we had another SDL bug with audio and now with video. I would absolutely use the beta and report in the appropriate channels when a problem arises, but having this on the stable releases is just frustrating.

Agreed it is kinda frustrating how they push updates without doing much testing(not saying they don't because they do a decent amount of testing) I think everyone here would gladly use a beta branch and report bugs for valve

Etaash-mathamsetty commented 1 year ago

Funnily enough, this is actually a bug in the steam runtime, not cs2 itself. The steam runtime doesn't ship its own version of zenity, on most systems the zenity that is shipped is too new for the libraries that the runtime uses

dreamyukii commented 1 year ago

for flathub steam, disabling wayland socket using flatseal works too

polluxau commented 1 year ago

for flathub steam, disabling wayland socket using flatseal works too

I'll add that to the original issue, thanks 👍

ckx commented 1 year ago

WAYLAND_DISPLAY= %command% fixed it for me, but SDL_VIDEO_DRIVER=x11 doesn't. I know it's not directly related to this issue, but for me running CS2 through Proton broke at the same time as the Linux client.

Also STRONGLY recommend a beta branch, the stability rollercoaster isn't a good one. Imagine getting blasted by 4 of your mates over voice chat while they reluctantly play Deathmatch, waiting for you to hopelessly trace system calls...

(Fedora 38 / Plasma Wayland / 6950 XT)

nahla-nee commented 1 year ago

Can confirm that this is happening too. Fedora 38, gnome wayland, open source amd drivers, running a RX 6700 XT. Adding SDL_VIDEO_DRIVER=x11 fixed it for me.

Seriously Valve this is embarrassing. This is the platform you've been pushing for years. It powers your steam deck. You can't even be bothered to check that your biggest game, the biggest game on all of steam right now, actually even launches?

polluxau commented 1 year ago

Can confirm that this is happening too. Fedora 38, gnome wayland, open source amd drivers, running a RX 6700 XT. Adding SDL_VIDEO_DRIVER=x11 fixed it for me.

Seriously Valve this is embarrassing. This is the platform you've been pushing for years. It powers your steam deck. You can't even be bothered to check that your biggest game, the biggest game on all of steam right now, actually even launches?

Someone did a boo boo 😅

nahla-nee commented 1 year ago

for flathub steam, disabling wayland socket using flatseal works too

I'll add that to the original issue, thanks 👍

While this is obviously up to you, I think it would be better to add a note advising against this option, as this would cause the entirety of steam to use X11. This should be a last resort, and marked as such, not just one of the options. Non tech savvy users could stumble on this thread in search of why their game stopped working, especially now when there's more less experienced users using linux than ever.

polluxau commented 1 year ago

for flathub steam, disabling wayland socket using flatseal works too

I'll add that to the original issue, thanks 👍

While this is obviously up to you, I think it would be better to add a note advising against this option, as this would cause the entirety of steam to use X11. This should be a last resort, and marked as such, not just one of the options. Non tech savvy users could stumble on this thread in search of why their game stopped working, especially now when there's more less experienced users using linux than ever.

I agree, added a warning

andrewk10 commented 1 year ago

I agree with the sentiments on how this shouldn't have made its way into stable. If I'm reading into this correctly, merely launching the game on a default Steam Deck would result in a crash too. Testing internally should have picked up on this before the update was shipped.

polluxau commented 1 year ago

I agree with the sentiments on how this shouldn't have made its way into stable. If I'm reading into this correctly, merely launching the game on a default Steam Deck would result in a crash too. Testing internally should have picked up on this before the update was shipped.

They are probs rushing these updates out ngl Which is NOT healthy Please do testing before hand, thank you valve

riodevelop commented 1 year ago

What helped me was adding "WAYLAND_DISPLAY= %command% -vulkan -nojoy" in CS2 game options. This started after installing the amdgpu-pro driver (before that it was just amdgpu, an open driver), so maybe that is the problem.

polluxau commented 1 year ago

What helped me was adding "WAYLAND_DISPLAY= %command% -vulkan -nojoy" in CS2 game options. This started after installing the amdgpu-pro driver (before that it was just amdgpu, an open driver), so maybe that is the problem.

I do not think so, I haven't installed the pro driver on this distro and I was playing CS a couple minutes before the 1.8gb update came out, right after it wouldn't launch under Wayland but yes WAYLAND_DISPLAY= does indeed work

ghost commented 1 year ago

What helped me was adding "WAYLAND_DISPLAY= %command% -vulkan -nojoy" in CS2 game options. This started after installing the amdgpu-pro driver (before that it was just amdgpu, an open driver), so maybe that is the problem.

-vulkan is not needed anymore since CS2 is a vulkan application only (Just like DOTA 2 on linux)

JacKeTUs commented 1 year ago

This started after installing the amdgpu-pro driver

Getting this issue on Mesa 23.2.0 (RADV) as well. Dota 2 affected too.

It's just wayland support was not compiled into libsdl, shipped in the update, according to developer: https://github.com/ValveSoftware/Dota-2/issues/2522#issuecomment-1748053123

Rosentti commented 1 year ago

Hmm. Also can't replace the game's SDL3 or LD_PRELOAD the system one without the game refusing to start, even with SDL_VIDEO_DRIVER=x11.

Vaimer9 commented 1 year ago

found a temp fix, unsetting the WAYLAND_DISPLAY env variable lets the game launch. example, my launch options that worked: WAYLAND_DISPLAY= %command% -vulkan -nojoy -language textmod

This works but im only able to see the labels everywhere, can't really explain it here's the image. image

lou-perret commented 1 year ago

@Vaimer9 Remove the -language textmod

you can also remove -vulkan, doesn't do anything on Linux.

You can keep -nojoy, it removes gamepad support, but it's not necessary

Vaimer9 commented 1 year ago

@Vaimer9 Remove the -language textmod

Thanks that works!!

fanyx commented 1 year ago

I have a different segfault in dmesg:

[Thu Oct  5 20:45:54 2023] cs2[11007]: segfault at 78 ip 00007fcb13f2c9a8 sp 00007ffc4a839ac0 error 6 in libpangocairo-1.0.so.0.4600.2[7fcb13f2a000+7000] likely on CPU 0 (core 0, socket 0)
[Thu Oct  5 20:45:54 2023] Code: ff ff 41 56 41 55 4d 89 cd 41 54 49 89 cc 55 4c 89 c5 53 48 89 fb 48 83 ec 40 64 48 8b 04 25 28 00 00 00 4889 44 24 38 31 c0 <48> 89 37 49 89 e6 89 57 24 bf 68 00 00 00 e8 35 dc ff ff 8b 7b 24

this time, pango/cairo seem to break

Xinayder commented 1 year ago

Got the same problem after latest updates. Segfault in dmesg:

[   51.052426] cs2[3269]: segfault at 0 ip 00007f0f9be698b5 sp 00007ffeebcbf750 error 4 in libc.so.6[7f0f9be44000+15a000] likely on CPU 9 (core 4, socket 0)
[   51.052438] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18
[   58.775575] cs2[3663]: segfault at 0 ip 00007f74c9a698b5 sp 00007fffb78cd240 error 4 in libc.so.6[7f74c9a44000+15a000] likely on CPU 10 (core 5, socket 0)
[   58.775587] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18
[  146.890130] cs2[4106]: segfault at 0 ip 00007fc62f4698b5 sp 00007ffd6d5da000 error 4 in libc.so.6[7fc62f444000+15a000] likely on CPU 3 (core 4, socket 0)
[  146.890144] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18
[  158.852975] cs2[4357]: segfault at 0 ip 00007f31d99358b5 sp 00007ffc26dd46f0 error 4 in libc.so.6[7f31d9910000+15a000] likely on CPU 2 (core 2, socket 0)
[  158.852989] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18
[  188.915647] dota2[4637]: segfault at 0 ip 00007fee5116d8b5 sp 00007ffc5a8ac9b0 error 4 in libc.so.6[7fee51148000+15a000] likely on CPU 6 (core 0, socket 0)
[  188.915659] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18
[  402.410758] dota2[5708]: segfault at 0 ip 00007f757b78d8b5 sp 00007ffebad3d620 error 4 in libc.so.6[7f757b768000+15a000] likely on CPU 10 (core 5, socket 0)
[  402.410770] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18

Installed versions:

Package (9)                       Old Version  New Version  Net Change

multilib/lib32-libva-mesa-driver  1:23.2.1-1   1:23.2.1-1     0.00 MiB
multilib/lib32-mesa               1:23.2.1-1   1:23.2.1-1     0.00 MiB
multilib/lib32-mesa-vdpau         1:23.2.1-1   1:23.2.1-1     0.00 MiB
multilib/lib32-vulkan-radeon      1:23.2.1-1   1:23.2.1-1     0.00 MiB
extra/libva-mesa-driver           1:23.2.1-1   1:23.2.1-1     0.00 MiB
extra/mesa                        1:23.2.1-1   1:23.2.1-1     0.00 MiB
extra/mesa-vdpau                  1:23.2.1-1   1:23.2.1-1     0.00 MiB
extra/vulkan-radeon               1:23.2.1-1   1:23.2.1-1     0.00 MiB
extra/xf86-video-amdgpu           23.0.0-1     23.0.0-1       0.00 MiB
romario74 commented 1 year ago

I get the same libc6.so errors now: [ 3452.909075] Code: ec 28 49 8b 41 08 48 89 74 24 08 44 89 44 24 18 85 c9 0f 85 05 03 00 00 83 ff 01 0f 84 74 01 00 00 83 ff 24 0f 87 6b 01 00 00 <49> 0f be 14 24 49 8b 49 68 4c 89 e3 48 89 d0 f6 44 51 01 20 74 18 [ 3525.378603] cs2[42832]: segfault at 0 ip 00007f14024758b5 sp 00007ffded5f0000 error 4 in libc.so.6[7f1402450000+15a000] likely on CPU 12 (core 6, socket 0)

romario74 commented 1 year ago

Installing the https://wiki.archlinux.org/title/AMDGPU_PRO driver solves it. Now the game starts.

Etaash-mathamsetty commented 1 year ago

Installing the wiki.archlinux.org/title/AMDGPU_PRO driver solves it. Now the game starts.

please do not use the amd pro drivers, they ruin the performance and set themselves as the default driver

polluxau commented 1 year ago

Installing the wiki.archlinux.org/title/AMDGPU_PRO driver solves it. Now the game starts.

please do not use the amd pro drivers, they ruin the performance and set themselves as the default driver

I was about to say the same thing lol

Please use amdgpu driver as this driver is the official one used in Linux for gaming

Spacefish commented 1 year ago

This is what i get when using wayland SDL driver.. I am using the 3.0 (sniper) Linux Runtime Beta. 2023-10-04

Fontconfig error: Cannot load default config file

(process:11029): GLib-GObject-WARNING **: 00:41:19.843: specified class size for type 'PangoCairoFcFont' is smaller than the parent type's 'PangoFcFont' class size

(process:11029): GLib-GObject-CRITICAL **: 00:41:19.843: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
/data/SteamLibrary/steamapps/common/Counter-Strike Global Offensive/game/cs2.sh: line 115: 11029 Trace/breakpoint trap   (core dumped) ${STEAM_RUNTIME_PREFIX} ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
robertswiecki commented 1 year ago

Segfault is a red herring here - there's a bug in libsdl3 where a return value from fgets is not checked for NULL, and passed to strtol, which causes segfault, here: https://github.com/libsdl-org/SDL/blob/f30392da5bd51da3fb8b74eab3f9193d0194ee2a/src/video/wayland/SDL_waylandmessagebox.c#L96

But this procedure is just trying to display message (at least in my case)

CreateSwapChain(): FailedToCreate VkSurfaceKHR

I never played with wayland/vulkan APIs, so not sure how to debug it, but all in all, removing the cause of segfault didn't help much in my case

Etaash-mathamsetty commented 1 year ago

Segfault is a red herring here - there's a bug in libsdl3 where a return value from fgets is not checked for NULL, and passed to strtol, which causes segfault, here: https://github.com/libsdl-org/SDL/blob/f30392da5bd51da3fb8b74eab3f9193d0194ee2a/src/video/wayland/SDL_waylandmessagebox.c#L96

But this procedure is just trying to display message (at least in my case)

CreateSwapChain(): FailedToCreate VkSurfaceKHR

I never played with wayland/vulkan APIs, so not sure how to debug it, but all in all, removing the cause of segfault didn't help much in my case

Could you create a PR on the sdl repo to fix this. (The first issue) If you can't then I'll do it, I know what ur talking about and how to fix it :)

robertswiecki commented 1 year ago

If you can't then I'll do it

Plz go ahead, my interest is rather in debugging/making-it-work than in upstreaming the patch :).

FWIW, with csgo there was a problem with xinput (both in Xorg, and in Xwayland) with support for 8kHz mice (laggy, data dropped), and wayland was fine, so I have an interest in making it work.

Etaash-mathamsetty commented 1 year ago

If you can't then I'll do it

Plz go ahead, my interest is rather in debugging/making-it-work than in upstreaming the patch :).

FWIW, with csgo there was a problem with xinput (both in Xorg, and in Xwayland) with support for 8kHz mice (laggy, data dropped), and wayland was fine, so I have an interest in making it work.

I made the PR, could you check if it's correct? I am pretty confident it is, but I might be wrong