Steam and Wayland and Gamescope

Lately my steam works kinda wonky - resetting itself (closing/reopening). Not always being responsive at all (when trying to insert several new keys to steam in a row for example) … and then either does the resetting thing or just disappears (can be reopened from tray icon though) soo… started investigating and getting this in steam own “console” tab:

wayland: skipping init because GAMESCOPE_WAYLAND_DISPLAY is not set
Warning: wayland init failed, some functionality may be unavailable
Using udev for HIDAPI joystick device discovery
Using udev for joystick device discovery
Loaded SDL version 3.1.2-471-g6821fb2fe
GetWin32Stats: display was not open yet, good
ComputeStartupMode: found registry default startup mode: 0
Switching to desktopui (from legacy vgui mode)
GetWin32Stats: display was not open yet, good
wayland: skipping init because GAMESCOPE_WAYLAND_DISPLAY is not set
Steam Runtime Launch Service: starting steam-runtime-launcher-service
Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 206541
Failed to init SteamVR because it isn't installed
GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()GLibLog: domain:Gtk  msg:Unable to locate theme engine in module_path: "adwaita",GLibLog: domain:Gtk  msg:Unable to locate theme engine in module_path: "adwaita",local (potentially out of sync) copy of roaming config loaded - 228321 bytes.
LoadShortcuts: loading shortcuts from: /home/deemon/.local/share/Steam/userdata/35374056/config/shortcuts.vdf
roaming config store loaded successfully - 228321 bytes.
migrating temporary roaming config store
System startup time: 7.54 seconds
GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()GLibLog: domain:Gtk  msg:gtk_disable_setlocale() must be called before gtk_init()ExecCommandLine: "'/home/deemon/.local/share/Steam/ubuntu12_32/steam' '-srt-logger-opened' '-dev'"

so… problem part seems to be this in yellow:

wayland: skipping init because GAMESCOPE_WAYLAND_DISPLAY is not set
Warning: wayland init failed, some functionality may be unavailable
<snip...>
wayland: skipping init because GAMESCOPE_WAYLAND_DISPLAY is not set

How to solve? I mean obviously I need to set the environment variable GAMESCOPE_WAYLAND_DISPLAY to something, but what are even the correct options to set and where can I see them?
(already checked archwiki, wasn’t anything about GAMESCOPE_WAYLAND_DISPLAY)

Running steam with command gamescope -e -- /usr/bin/steam-runtime -dev (suggested in arch wiki) made it run much smoother and without those warnings (I guess gamescope figured it out by itself?), buut it’s like inside some “Wayland” container box outside of normal Steam client window (undesired look). And to be honest, I don’t want to run Steam itself in gamescope (because for one, the clip-board isn’t shared between Gamescope/Steam and KDE Kwin itself, so I can’t copy game keys from browser in Kwin session to Gamescope/Steam for activation and that’s definitely a party stopper), but possibly (all) games launched from Steam.

Also what’s the difference between Manjaro packets gamescope and gamescope-plus? Currently have only gamescope installed – should I replace it with -plus version?

in arch wiki under gamescope is instructions fow to launch games in gamescope one by one (command line options for game), but is there some way to make it global, so whatever I open in steam opens with the same gamescope settings (display, width, height, refreshrate, etc?) ?

I think this user posted yesterday exactly what you looking for:

1 Like

I do recall a time not so long ago where my steam was acting weird too (disappearing then coming back), but as there was nothing I did to resolve it, I can only conclude that either (a) a subsequent steam update resolved it, or (b ) that the transition from plasma 5 to plasma 6 smoothed out over time and gave steam a “better foundation” to run on.

I’ve heard of some folks trying to initialize a gamescope session/window first, then when they launch each game, they include additional launch options to redirect the game to load withing the pre-initialized gamescope window.

I don’t use that method, so if that’s what you are trying to do, I won’t be able to guide you. Nor do I launch steam in big picture (steamdeck) mode.

How I use gamescope is purely within the launcher options for each game… meaning I don’t run steam off the command line, nor do I try to get steam running under/within gamesope like you mentioned from the archwiki.

I run “Steam (Runtme)” straight off the desktop icon created when I installed it.

pacman -Qi steam
Name            : steam
Version         : 1.0.0.79-1
Description     : Valve's digital software delivery system
Architecture    : x86_64
URL             : https://steampowered.com/
Licenses        : custom
Groups          : None
Provides        : None
Depends On      : bash  desktop-file-utils  diffutils  hicolor-icon-theme  curl  dbus  freetype2  gdk-pixbuf2  ttf-font  zenity  lsb-release  nss
                  usbutils  xorg-xrandr  vulkan-icd-loader  lsof  python  xdg-user-dirs  glibc  libxcrypt  libxcrypt-compat  gcc-libs  lib32-glibc
                  lib32-libxcrypt  lib32-libxcrypt-compat  lib32-libgl  lib32-gcc-libs  lib32-libx11  lib32-libxss  lib32-alsa-plugins  lib32-libgpg-error
                  lib32-nss  lib32-vulkan-icd-loader
Optional Deps   : steam-native-runtime: steam native runtime support
                  vulkan-driver: packaged vulkan driver [installed]
                  lib32-vulkan-driver: packaged vulkan driver (32 bit) [installed]
                  lib32-libappindicator-gtk2: added tray icon functionality [installed]
                  xdg-desktop-portal-impl: improved file dialog support [installed]
                  game-devices-udev: additional rules for controllers [installed]
Required By     : None
Optional For    : None
Conflicts With  : steam-manjaro
Replaces        : steam-manjaro
Installed Size  : 3.96 MiB
Packager        : Mark Wagie <mark@manjaro.org>
Build Date      : Thu 08 Feb 2024 11:33:10 AM
Install Date    : Thu 28 Mar 2024 12:06:53 PM
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

EDIT: One thing I do recall doing differently is that I’ve noticed steam doesn’t always close each gameoverlay instance… which I figured out was causing steam to not relaunch properly after shutting down while performing a steam client update.

I’ve been using qps (filtered on “steam”; ordered by “tree”) to monitor processes, and when I find a rogue gameoverlay process still running after closing a game, I kill it manually. It would be interesting to know if you have one or more roque gameoverlay processes, and whether closing them had any effect on what you’re experiencing.

pacman -Qi qps
Name            : qps
Version         : 2.9.0-1
Description     : Qt process viewer and manager
Architecture    : x86_64
URL             : https://github.com/lxqt/qps
Licenses        : GPL
Groups          : lxqt
Provides        : None
Depends On      : hicolor-icon-theme  liblxqt  qt6-base
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 1253.86 KiB
Packager        : Chih-Hsuan Yen <yan12125@archlinux.org>
Build Date      : Mon 22 Apr 2024 01:07:19 AM
Install Date    : Wed 26 Jun 2024 10:52:01 AM
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature```

Typically the difference between gamescope and gamescope-plus has been the addition of “fixes”/patches… although I cannot tell you what those are. The main reason I installed gamescope-plaus was because its version was 3.14.24; whereas gamescope was back a couple versions @ 3.14.22.

Assuming you are using pamac-ui (aka “Add/Remove Software”) to install packages, take a look at the difference between the “Files” provided between the two.

screenshot in case it helps

1 Like

Thank you for your reply, but sadly “not yet” – maybe soon after I try to run actual games with gamescope. Right now I want to get steam itself run smoothly currently and not whine about not having something undefined and act bad.

For example I tried to launch Steam with the variable set from CLI (for testing) and …

GAMESCOPE_WAYLAND_DISPLAY="DP-1" /usr/bin/steam-runtime -dev

…it just blinked my main screen and failed with X11 popup error in my Wayland KDE
“[X11 logo] Steam - Error
wayland: init failed to connect to display
[OK]”

and then started normally, except now instead of yellow errors in it’s own “Console” tab, it has 2 red lines:
wayland: init failed to connect to display instead of previously yellow ones wayland: skipping init because GAMESCOPE_WAYLAND_DISPLAY is not set.

Since I didn’t even try to run any game, there wasn’t any leftover overlay processes – I assume there’s where they come from? So sadly no, it behaves badly without those. Hopefully future update will fix it for me also “by itself” :smiley:

But right now, clicking on “Add a game” → “Activate a Product on Steam…” 50% of time causes the steam client hang or crash+restart or crash entirely when steam itself running in gamescope window.

Im actually more than happy to run my steam games with x11 on my nvidia GPU, is there a reason why you want to run it with wayland?

Are you using a AMD or Nvidia GPU?

HDR + VRR + multimonitor setup.

AMD

I heared some rumors that Plasma 6.1 improved additional Wayland and HDR Support. Plasma 6.1 is in Manjaro unstable branch already available.

You mentioned setting environment variables… are you sure you are setting them correctly, or that you really need them?

When I launch steam, I use the steam.desktop file which executes /usr/bin/steam-runtime. I have not set any environment variables, nor have I added any arguments.

What happens if you remove/rem the variables you created and just launch steam with no additional arguments?

I’ve also heard of some folks preferring to launch steam from the terminal as they then get to see any/all error messages during it’s execution. Both steam and steam-runtime will work

Well. If you go back to first post, that’s what I was asking in the first place.
I mean I know how to set them, however I have no clue about the real values I should be setting there, because the wayland display identifier used by kwin didn’t work – it complained about it not even in yellow anymore, but in red text and ignored it once again.

Well. It does say in yellow warning text, that it’s not set and it’s ignoring it. In my book that kinda indicates, that it could be set and should be set and “maybe”, “hopefully” makes something better?
wayland: skipping init because GAMESCOPE_WAYLAND_DISPLAY is not set
Warning: wayland init failed, some functionality may be unavailable

However without it set, it does work – poorly, like I was complaining here. Hanging frequently on some tasks and even crashing. No idea if setting the value would fix anything though regarding this hanging/crashing. Just wanted to try and see.

Then again. Maybe it’s not meant to be set by environment or user at all, but "in case I ran the steam client in gamescope itself, so the gamescope in which I run the steam client sets the variable for the client – so the client it trying to figure out in which environment it’s running and acting accordingly? But I am still not convinced, that it’s the case, because the warning/error lines start with “wayland:” not with “gamescope:”. Like it’s trying to run in native wayland mode, but fails, because the variable is not set.

that’s exactly what I did also before and it runs poorly. (almost like in x11 mode and it doesn’t really like it? (no idea how to check it though)) the -dev argument gives you the “Console” tab into the client, which is handy quite often.

it runs poorly. lags, hangs, crashes doing certain things. but works.

doing that also mostly, as it does show a little bit more information than the console tab in client.

there is a “reset” command that has steam go through a bit of a repair of its installation… steam --reset

Based on your explanation, it makes me wonder if your and video drivers are installed/configured correctly… AFAIK steam (and most likely the steam games you launch) is going to want to use hardware acceleration, so this will ne important

  • per Steam - ArchWikiYou must install the 32-bit version of the OpenGL graphics driver appropriate for your system.
  • per the table @ Xorg - ArchWiki, the reference above is likely pointing to lib32-mesa, but I would work across the table for your amdgpu to ensure all are in place… note: most use vulkan-radeon over amdvlk
  • and then there is the question of whether your gpu is configured correctly… per AMDGPU - ArchWiki for example, there are special kernel parameters that need to be passed if you are using a Southern Islands (SI) or Sea Islands (CIK) based amdgpu

I guess one of the take-aways here is that booting to the desktop is is really only testing your 2D drivers, and not 3D acceleration/drivers. perhaps running tools like glxgears or glmark2 may help to show you have an overall 3D issue, and not really a steam issue (although steam might have exposed it)

UPDATE: there is also a Steam/Troubleshooting - ArchWiki section that may help you

And why do you think there is anything wrong with my drivers and GPU, when all the games work fine? Problem is with steam client – which is a piece of work… X11 gtk chromium running in xwayland in kde plasma.