ValveSoftware / gamescope

SteamOS session compositing window manager
Other
2.84k stars 189 forks source link

Gamescope 3.14.3 canBypassXWayland #1249

Open verres1 opened 2 months ago

verres1 commented 2 months ago

Hi after update in Arch gamescope to version 3.14.3-1.1 I can't start WarThunder via gamescope anymore.

[michal@gene ~]$ gamescope /games/WarThunder/launcher
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
vulkan: selecting physical device 'AMD Radeon RX 7900 XTX (RADV NAVI31)': queue family 1 (general queue family 0)
vulkan: physical device supports DRM format modifiers
wlserver: [backend/headless/backend.c:67] Creating headless backend
xdg_backend: Seat name: 
vulkan: supported DRM formats for sampling usage:
vulkan:   AR24 (0x34325241)
vulkan:   XR24 (0x34325258)
vulkan:   AB24 (0x34324241)
vulkan:   XB24 (0x34324258)
vulkan:   RG16 (0x36314752)
vulkan:   NV12 (0x3231564E)
vulkan:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB48 (0x38344241)
vulkan:   XB48 (0x38344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:17] Starting headless backend
wlserver: [xwayland/sockets.c:64] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [xwayland/server.c:107] Starting Xwayland on :2
wlserver: [types/wlr_compositor.c:771] New wlr_surface 0x56fa37241790 (res 0x56fa37241ff0)
wlserver: [xwayland/server.c:272] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 97
xwm: Embedded, no cursor set. Using left_ptr by default.
vblank: Using timerfd.
xdg_backend: PreferredMetadata: Red: 0.64 0.33, Green: 0.3 0.6, Blue: 0.15 0.06, White: 0.3127 0.329, Max Luminance: 100 nits, Min Luminance: 0 nits, Max Full Frame Luminance: 100 nits
josh edid: Patching res 800x1280 -> 1280x720
pipewire: renegotiating stream params (size: 1280x720)

(launcher:30708): GLib-CRITICAL **: 08:29:11.911: Source ID 82 was not found when attempting to remove it
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
[S_API] SteamAPI_Init(): Loaded '/home/michal/.local/share/Steam/linux64/steamclient.so' OK.
[S_API FAIL] SteamAPI_Init() failed; create pipe failed.ATTENTION: default value of option vk_khr_present_wait overridden by environment.
wlserver: [types/wlr_compositor.c:771] New wlr_surface 0x56fa3729fcc0 (res 0x56fa3728c4f0)
[Gamescope WSI] Creating Gamescope surface: xid: 0x600002
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
wlserver: [Gamescope WSI] Made gamescope surface for xid: 0x600002
[Gamescope WSI] Surface state:
[types/wlr_compositor.c:771] New wlr_surface 0x56fa3729ecb0 (res 0x56fa3728ce20)  steam app id:                  0

  window xid:                    0x600002
  wayland surface res id:        5
  layer client flags:            0x0
  server hdr output enabled:     false
  hdr formats exposed to client: false
xwm: Unhandled initial NET_WM_STATE property: _NET_WM_STATE_FOCUSED
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
> Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
> Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Errors from xkbcomp are not fatal to the X server
[Gamescope WSI] Forcing on VK_EXT_swapchain_maintenance1.
xwm: Rejecting WM_CHANGE_STATE to ICONIC for window 0x600002
[Gamescope WSI] Creating swapchain for xid: 0x600002 - minImageCount: 4 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x600002 - imageCount: 4
gamescope: children shut down!
(EE) failed to read Wayland events: Broken pipe
[michal@gene ~]$ [Gamescope WSI] getWindowRect: xcb_get_geometry failed for window 0x600002.
[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x600002.
[Gamescope WSI] getWindowRect: xcb_get_geometry failed for window 0x600002.
[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x600002.
Can't open display: :2
Can't open display: :2
Can't open display: :2

After downgrade to version 3.14.2-1.1 everything is working fine.

Joshua-Ashton commented 2 months ago

Do you have an outdated Gamescope layer somewhere?

sharkautarch commented 2 months ago

@verres1 to check for an outdated Gamescope layer/binary:

verres1 commented 2 months ago

@verres1 to check for an outdated Gamescope layer/binary:

  • install the lostfiles package
  • see if this command prints anything: sudo lostfiles | grep -iE '[/]usr[/](local[/]bin|bin)|[.]so.*' | grep -iE 'gamescope|FROG|vkroots|wlroots'

I think it is stricly related to the gamescope package only. Output from this command above is empty. When I downgrade with command sudo pacman -U file:///var/cache/pacman/pkg/gamescope-3.14.2-1.1-x86_64.pkg.tar.zst it is working ok. When update with sudo pacman -S gamescope (extra/gamescope 3.14.3-1.1) I have error from above.

sharkautarch commented 2 months ago

Replying to https://github.com/ValveSoftware/gamescope/issues/1249#issuecomment-2059343446

hmmm, does this command also fail to run: ENABLE_GAMESCOPE_WSI=0 gamescope -- vkcube

verres1 commented 2 months ago

ENABLE_GAMESCOPE_WSI=0 gamescope -- vkcube with this command, the cube is rendering fine - no errors.

Joshua-Ashton commented 2 months ago

Does vkcube work normally?

Is there a crash dump for gamescope/vkcube if not?

sharkautarch commented 2 months ago

ENABLE_GAMESCOPE_WSI=0 gamescope -- vkcube with this command, the cube is rendering fine - no errors.

can you confirm that gamescope -- vkcube fails (to make sure that the issue isn't limited to just running war thunder under gamescope)

if the above command fails, to give us more info on what's going on install the archlinux vulkan-extra-layers package, and then show the output from running this command: gamescope -- env VK_APIDUMP_OUTPUT_RANGE='0,1' VK_LOADER_LAYERS_ENABLE='*FROG*,*api*' vkcube

(if running gamescope -- vkcube actually didn't fail, then do the above command for war thunder instead)

verres1 commented 2 months ago

gamescope -- vkcube is working completely fine without any errors. Here is given command output for warthunder. warthunder_gamescope.txt

vkcube console output end with

[Gamescope WSI] Creating swapchain for xid: 0x400000 - minImageCount: 3 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x400000 - imageCount: 3
[Gamescope WSI] Swapchain recieved new refresh cycle: 16.67ms

warthunder console output ends with

[Gamescope WSI] Creating swapchain for xid: 0x600002 - minImageCount: 4 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x600002 - imageCount: 4
[Gamescope WSI] Swapchain recieved new refresh cycle: 16.67ms
gamescope: children shut down!
(EE) failed to read Wayland events: Broken pipe
[michal@gene ~]$ [Gamescope WSI] getWindowRect: xcb_get_geometry failed for window 0x600002.
[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x600002.
[Gamescope WSI] getWindowRect: xcb_get_geometry failed for window 0x600002.
[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x600002.
[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x600002.
Can't open display: :2
Can't open display: :2
Can't open display: :2

I have dual monitor setup.

sharkautarch commented 2 months ago

Replying to https://github.com/ValveSoftware/gamescope/issues/1249#issuecomment-2061530405

now that I think about it, it’s probably not an issue with gamescope wsi… I imagine if you were to run ENABLE_GAMESCOPE_WSI=0 gamescope /games/WarThunder/launcher It would still fail

If this problem isn’t actually an WSI issue, then it could be related to https://github.com/ValveSoftware/gamescope/issues/1237

The only other troubleshooting idea I have is: checking if gamescope-git behaves any differently, since there was a use-after-free bug that I had discovered (introduced at some commit in 3.14.3), which then was fixed in a recent git commit, but not fixed yet in the 3.14.3 release.

verres1 commented 2 months ago

With ENABLE_GAMESCOPE_WSI=0 gamescope /games/WarThunder/launcher it is still failing. In gamescope-git-3.14.3.r11.gf8c873e-1 also not fixed.

Joshua-Ashton commented 2 months ago

You are missing the -- after gamescope...

The-Lost-Light commented 2 months ago

I have same problem in Arch linux (also work when downgrade to 3.14.2)

$ gamescope -- ./FEZ
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Tracing is enabled
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
vulkan: selecting physical device 'NVIDIA GeForce RTX 2060 with Max-Q Design': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
wlserver: [backend/headless/backend.c:67] Creating headless backend
xdg_backend: Seat name: seat0
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344258 (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   AR24 (0x34325241)
vulkan:   XR24 (0x34325258)
vulkan:   AB24 (0x34324241)
vulkan:   XB24 (0x34324258)
vulkan:   RG16 (0x36314752)
vulkan:   NV12 (0x3231564E)
vulkan:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:17] Starting headless backend
wlserver: [xwayland/sockets.c:64] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [util/env.c:9] Loading WLR_NO_HARDWARE_CURSORS option: 1
wlserver: [types/output/output.c:370] WLR_NO_HARDWARE_CURSORS set, forcing software cursors
wlserver: [xwayland/server.c:107] Starting Xwayland on :2
wlserver: [types/wlr_compositor.c:771] New wlr_surface 0x620415cd4600 (res 0x620415cd54c0)
wlserver: [xwayland/server.c:272] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 88
xwm: Embedded, no cursor set. Using left_ptr by default.
(EE) glamor0: GL error: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
(EE) 
(EE) Backtrace:
(EE) 0: Xwayland (0x5d0b31c00000+0x14fcf3) [0x5d0b31d4fcf3]
(EE) 1: /usr/lib/libnvidia-eglcore.so.550.67 (0x7710a5800000+0x72d295) [0x7710a5f2d295]
(EE) 2: /usr/lib/libnvidia-eglcore.so.550.67 (0x7710a5800000+0x236c7d) [0x7710a5a36c7d]
(EE) 3: /usr/lib/libnvidia-eglcore.so.550.67 (0x7710a5800000+0x24980a) [0x7710a5a4980a]
(EE) 4: Xwayland (0x5d0b31c00000+0x30956) [0x5d0b31c30956]
(EE) 5: Xwayland (0x5d0b31c00000+0x3100f) [0x5d0b31c3100f]
(EE) 6: Xwayland (0x5d0b31c00000+0x312b8) [0x5d0b31c312b8]
(EE) 7: Xwayland (0x5d0b31c00000+0x876be) [0x5d0b31c876be]
(EE) 8: Xwayland (0x5d0b31c00000+0x8fdd7) [0x5d0b31c8fdd7]
(EE) 9: Xwayland (0x5d0b31c00000+0x183a8) [0x5d0b31c183a8]
(EE) 10: /usr/lib/libc.so.6 (0x7710ad49e000+0x25cd0) [0x7710ad4c3cd0]
(EE) 11: /usr/lib/libc.so.6 (__libc_start_main+0x8a) [0x7710ad4c3d8a]
(EE) 12: Xwayland (0x5d0b31c00000+0x19d85) [0x5d0b31c19d85]
(EE) 
XXX fail to create fbo.
vblank: Using timerfd.
fish: Job 1, 'gamescope -- ./FEZ' terminated by signal SIGABRT (Abort)
Saroumane commented 2 months ago

I made some tests in my setup (Archlinux + Gnome Wayland), and gamescope 3.14.3 crash with gamescope: ../gamescope/src/wayland_backend.cpp:688: void gamescope::CWaylandFb::OnCompositorRelease(): Assertion `m_bCompositorAcquired' failed. for any X11 application.

If I use gamescope to start a wayland application, no crash. Downgrading to gamescope 3.14.2 is indeed the solution, for now.

Doomsdayrs commented 2 weeks ago

This is something that has been happening for over 2 years with the game, in varying forms, on and off.

https://github.com/ValveSoftware/gamescope/issues/598.


The game works when steam is in control of gamescope via -e. And that is how I have been playing for awhile.