Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
polluxau opened this issue Oct 4, 2023 · 71 comments
Closed

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

polluxau opened this issue Oct 4, 2023 · 71 comments
Labels

Comments

@polluxau
Copy link

polluxau commented Oct 4, 2023

Your system information

  • System information from steam (Steam -> Help -> System Information) in a gist:
  • Have you checked for system updates?: [Yes/No]

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 polluxau changed the title can no longer open cs2 under wayland with the latest update 5/10/2023 can no longer run cs2 under wayland with the latest update 5/10/2023 Oct 4, 2023
@polluxau
Copy link
Author

polluxau commented Oct 4, 2023

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

@polluxau polluxau closed this as completed Oct 4, 2023
@polluxau polluxau reopened this Oct 4, 2023
@tbergman99
Copy link

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

@polluxau polluxau changed the title can no longer run cs2 under wayland with the latest update 5/10/2023 can no longer run cs2 under wayland with the latest update 4/10/2023 Oct 4, 2023
@lou-perret
Copy link

lou-perret commented Oct 4, 2023

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
Copy link

vaxerski commented Oct 4, 2023

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
Copy link

gegnep commented Oct 4, 2023

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
Copy link

droyd9 commented Oct 4, 2023

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

@gerelef
Copy link

gerelef commented Oct 4, 2023

Same in Wayland GNOME, Fedora 37

@Zer0-One
Copy link

Zer0-One commented Oct 4, 2023

[ 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
Copy link

gegnep commented Oct 4, 2023

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
Copy link

vaxerski commented Oct 4, 2023

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

@polluxau
Copy link
Author

polluxau commented Oct 4, 2023

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
Copy link

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
Copy link
Author

polluxau commented Oct 4, 2023

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
Copy link

Also had this issue and the fix above works.

@antipsychotics
Copy link

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
Copy link

alou-S commented Oct 5, 2023

@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
Copy link
Author

polluxau commented Oct 5, 2023

@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
Copy link

alou-S commented Oct 5, 2023

@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
Copy link

@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
Copy link

sameer commented Oct 5, 2023

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
Copy link
Author

polluxau commented Oct 5, 2023

@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
Copy link

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

@sekalengrengginang
Copy link

for flathub steam, disabling wayland socket using flatseal works too

@Etaash-mathamsetty
Copy link

Etaash-mathamsetty commented Oct 6, 2023

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: libsdl-org/SDL@f30392d/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

with the fix, the segfault moved to segfault at 0 ip 00007ffa51377646 sp 00007fff7683f4b0 error 6 in libtier0.so[7ffa512bf000+2f3000] likely on CPU 11 (core 3, socket 0)
rather than libc6

@robertswiecki
Copy link

robertswiecki commented Oct 6, 2023

I made the PR, could you check if it's correct?

It solves the immediate problem, though IMO either run_zenity() should fail, or fgets() should succeed.

Edit: ok, I see it in strace, zenity fails with exit_code=127 if it doesn't have access to some libs, which are not there in the pressure-vessel namespace of steamrt. And run_zenity() fails only with exit_code>129 (execve error here). Looking at the code, it "should probably" check if zenity returned 0 or not, as that's what zenity --version should return, but I didn't check what other callers to run_zenity expect.

14709 writev(2, [{iov_base="zenity", iov_len=6}, {iov_base=": ", iov_len=2}, {iov_base="symbol lookup error", iov_len=19}, {iov_base=": ", iov_len=2}, {iov_base="/lib/x86_64-linux-gnu/libgtk-3.so.0", iov_len=35}, {iov_base=": ", io
v_len=2}, {iov_base="undefined symbol: pango_font_family_get_face", iov_len=44}, {iov_base="", iov_len=0}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 10 <unfinished ...>
14709 <... writev resumed>)             = 111
14709 exit_group(127 <unfinished ...>

@danvilar
Copy link

danvilar commented Oct 6, 2023

I just updated the game, and it is working on wayland again.

@polluxau
Copy link
Author

polluxau commented Oct 6, 2023

I just updated the game, and it is working on wayland again.

Yep same here

@polluxau
Copy link
Author

polluxau commented Oct 6, 2023

I just updated the game, and it is working on wayland again.

Yep same here

I shall close this if no one else has similar issues

@Cruleo
Copy link

Cruleo commented Oct 6, 2023

Can verify that it works again. Can also confirm that SDL_VIDEO_DRIVER=wayland does not crash the game anymore though, possibly ignored?

@rojanDinc
Copy link

rojanDinc commented Oct 6, 2023

So with this new update we don't have to specify X11 as video driver anymore as cs2 is using (prefering) X11 over wayland. Ref: https://www.counter-strike.net/news/updates

@robertswiecki
Copy link

robertswiecki commented Oct 6, 2023

More likely 'ignoring' wayland :). With

SDL_VIDEO_DRIVER=wayland DISPLAY=

it doesn't work. We need something like SDL_VIDEO_DRIVER_FOR_REAL now :)

@polluxau
Copy link
Author

polluxau commented Oct 6, 2023

More likely 'ignoring' wayland :). With

SDL_VIDEO_DRIVER=wayland DISPLAY=

it doesn't work.

so cs2 is still running in x11 under wayland we just dont have to use the launch command anymore?
welp not closing this till wayland is enabled by default for wayland (no cheating valve)

@rojanDinc
Copy link

Before this update I was able to run 4:3 ratio with 144hz now with X11 it only supports up to 75hz :/

@robertswiecki
Copy link

so cs2 is still running in x11 under wayland we just dont have to use
the launch command anymore?

Yup, it forces x11 in cs2.sh

# Remove when Source 2 supports Wayland
export SDL_VIDEO_DRIVER=x11

@polluxau
Copy link
Author

polluxau commented Oct 6, 2023

More likely 'ignoring' wayland :). With
SDL_VIDEO_DRIVER=wayland DISPLAY=
it doesn't work.

so cs2 is still running in x11 under wayland we just dont have to use the launch command anymore?

so cs2 is still running in x11 under wayland we just dont have to use
the launch command anymore?

Yup, it forces x11 in cs2.sh

# Remove when Source 2 supports Wayland
export SDL_VIDEO_DRIVER=x11

guess its just temporary for now

@vaxerski
Copy link

vaxerski commented Oct 7, 2023

I'd still close this issue, as it's about being unable to run cs2, which is now fixed, and open another one for native Wayland support.

@MichaelDeets
Copy link

MichaelDeets commented Oct 8, 2023

Replying to #3402 (comment)

This was an issue with the libsdl2 library CS:GO shipped. It was fixed with the git version of libsdl2 (provided in official releases since). You just had to preload the libsdl2 git version, and 8KHz would run perfect. You can read more about it here.

Before the libsdl2 update, I would just use m_rawinput "0", which had its own issues, but was just about "usable".

Replying to #3402 (comment)

Why was this disliked? It was a snippet directly from cs2.sh, which I'd assume would take priority over envvars in the launch options, meaning SDL_VIDEO_DRIVER=wayland in the launch options would start CS2 but it was actually using SDL_VIDEO_DRIVER=x11

The comment I'm replying to is completely correct.

@Etaash-mathamsetty
Copy link

Etaash-mathamsetty commented Oct 8, 2023

Replying to #3402 (comment)

FYI ... CS2 uses SDL3 not SDL2. The raw input stuff you are talking about likely doesn't apply, since it has probably been long fixed

@MichaelDeets
Copy link

MichaelDeets commented Oct 8, 2023

Replying to #3402 (comment)

FYI ... I was replying to someone talking about CS:GO, even said "CS:GO" in my comment, and linked to a git issue for CS:GO.

@aarshparashar
Copy link

aarshparashar commented Oct 13, 2023

Replying to #3402 (comment)

FYI ... CS2 uses SDL3 not SDL2. The raw input stuff you are talking about likely doesn't apply, since it has probably been long fixed

SDL3? Really? How do you know? Btw is it still possible to run it natively with Wayland? Can someone guide me?

@pseudophia
Copy link

My system: Ubuntu 20.04 & Quadro T1000 Mobile Card.

I had an issue where the shaders did not work properly so the game was all bright and white: image https://ibb.co/gdH7cYS

I solved this by installing: https://developer.nvidia.com/vulkan-driver

and to install it I needed to disable Nouveau: https://docs.nvidia.com/ai-enterprise/deployment-guide-vmware/0.1.0/nouveau.html

Then I added -vulkan -autoconfig to the launch options in steam/cs2

WARNING: Because the VCard I have is not really used for gaming, the fan went off like crazy. I believe that it is recommended to have at least 6GB VRAM but in my case I had 4VRAM.

@robertswiecki
Copy link

robertswiecki commented Oct 21, 2023

Replying to #3402 (comment)

FYI ... CS2 uses SDL3 not SDL2. The raw input stuff you are talking about likely doesn't apply, since it has probably been long fixed

SDL3? Really? How do you know? Btw is it still possible to run it natively with Wayland? Can someone guide me?

I don't think so - I tried compiling my own SDL3, enabling all relevant options, but it still doesn't work. I suspect that either

a). support for wayland in SDL3 is not yet fully complete
b). there're some hard-coded X11isms inside CS2 Linux code

@spazziale
Copy link

Yup, it forces x11 in cs2.sh

# Remove when Source 2 supports Wayland
export SDL_VIDEO_DRIVER=x11

Can it be removed manually or will anticheat ban me?

@robertswiecki
Copy link

robertswiecki commented Jan 11, 2024

Replying to #3402 (comment)

Unlikely ban - bans are rather for known bad behavior (based on analysis of loaded libraries and such).

But it simply doesn't seem to work (vulkan surface creation problems) - I didn't play with it much but it's not as easy as with CSGO where it was possible to LD_PRELOAD sth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests