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

gamescope doesn't run on NVIDIA #497

Open
severinkaderli opened this issue May 15, 2022 · 88 comments
Open

gamescope doesn't run on NVIDIA #497

severinkaderli opened this issue May 15, 2022 · 88 comments

Comments

@severinkaderli
Copy link

I'm trying to run glxgears inside gamescope:
gamescope -W 1920 -H 1080 -- glxgears

and I get the following output:

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce 940MX'
vulkan: physical device supports DRM format modifiers
vulkan: physical device has no render node
Failed to initialize Vulkan

The kernel parameter: nvidia-drm.modeset=1 is set.

Graphics card: NVIDIA GeForce 940MX
NVIDIA version: 515.43.04
Gamescope version: 3.11.31.beta4.r6.g97288b8-1
Distribution: Archlinux

@MabaKalox
Copy link

MabaKalox commented May 16, 2022

Try (1st line of logs complains about it):
# setcap 'cap_sys_nice=eip' /usr/bin/gamescope
With root privileges.
Keep in mind open issue: #492

@LethalManBoob
Copy link

LethalManBoob commented May 16, 2022

Using gamescope-git on my archlinux build it does work.
However the frame rate is reduced to near unplayable levels on all titles tested from dying light to half life and they all excibit horrid screen tear.
Edit: gamescope -W 1920 -H 1080 -- vkquake works fine and performance is good with no tearing.
I get the same issues as noted above if I use gamescope from lutris. It also locks my res to 640x480. changing res forces it to 1080p and gives me issues once again. i am using hdmi 2.1 if it matters

@MabaKalox
Copy link

MabaKalox commented May 16, 2022

@LethalManBoob I guess better to put this report into #492, instead of this issue.

@somewhatfrog
Copy link

somewhatfrog commented May 18, 2022

Seems like the same issue here.

gamescope -h 1080 -H 1800 -- vkcube
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan
Segmentation fault (core dumped)

Arch, everything is up to date.
gamescope 3.11.30-1
nvidia 515.43.04-1
i3wm (no compositor)
nvidia-drm.modeset=1

@kellerman
Copy link

kellerman commented May 18, 2022

gamescope -h 1080 -H 1800 -- vkcube
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan
Segmentation fault (core dumped)

Yes, also facing same issue, same settings and nvidia drivers, same distro.

@ranisalt
Copy link

ranisalt commented May 19, 2022

Also having this issue with an NVIDIA GeForce RTX 2060 Mobile on Arch Linux running master

Edit: not the same, I actually get

vulkan: vkCreateDevice failed (VkResult: -7)

@franzmondlichtmann
Copy link

franzmondlichtmann commented May 23, 2022

Same issue here, also with mobile GPU.

vulkan: selecting physical device 'NVIDIA GeForce RTX 3050 Laptop GPU'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan.

Up-to-date arch.
Gamescope 3.11.30-1
KDE Plasma
Nvidia 515.43.04
nvidia-drm.modeset=1
setcap 'cap_sys_nice=eip' /usr/bin/gamescope

@misyltoad
Copy link
Collaborator

That version is too old, it's missing the NVIDIA fixes.

@franzmondlichtmann
Copy link

franzmondlichtmann commented May 23, 2022

Configuration like in my post above (Laptop GPU, using NVIDIA Prime), except: Gamescope git Version from 18.05.2022
Output of gamescope -Y -- glxgears shows no gears.
Get this error message: "Error getting buffer", from this log:

gamescope -Y -- glxgears
vulkan: selecting physical device 'NVIDIA GeForce RTX 3050 Laptop GPU'
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan: 0x34325241
vulkan: 0x34325258
wlserver: [backend/headless/backend.c:82] Creating headless backend
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:18] Starting headless backend
wlserver: [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [xwayland/server.c:92] Starting Xwayland on :1
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x560c31c18590 (res 0x560c31b01240)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 61
pipewire: renegotiating stream params (size: 1280x720)
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x560c31a960c0 (res 0x560c31c0fcf0)
Error getting buffer
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
2075 frames in 5.0 seconds = 414.844 FPS
2107 frames in 5.0 seconds = 421.268 FPS
1943 frames in 5.0 seconds = 388.594 FPS
.
.
.
.

Update: Ran the same command with prime-run:
prime-run gamescope -Y -- glxgears
, with the same outcome
(Is prime-run even necessary with gamescope?)

@Samsagax
Copy link

Configuration like in my post above (Laptop GPU, using NVIDIA Prime), except: Gamescope git Version from 18.05.2022 Output of gamescope -Y -- glxgears shows no gears. Get this error message: "Error getting buffer", from this log:

Seems like the same as this bug #498
I made it somewhat work in nested mode by setting nvidia prime variables, i.e:
$ __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only gamescope -e -f -- steam
And games launched that way will be rendered by the Nvidia card (checked with nvidia-smi).
Embedded mode doesnt work, no matter if those variables are set.

@LethalManBoob
Copy link

If anyone wonders. The chaotic aur version of gamescope-git is what I used. Usually chaotic aur is more up to date than the -git foundi n the normal aur

@franzmondlichtmann
Copy link

franzmondlichtmann commented May 23, 2022

Was testing, like suggested from Samsagax, but with -Y flag because of Nvidia GPU:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only gamescope -Y -- glxgears

Still same error like in my last post:
error getting buffer

And: Window with Gears is NOT showing

Setup is still the same, like in my last post: (Gamescope git Version from 18.05.2022, Nvidia 3050 Laptop GPU)

Full ouput:

vulkan: selecting physical device 'NVIDIA GeForce RTX 3050 Laptop GPU'
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan: 0x34325241
vulkan: 0x34325258
wlserver: [backend/headless/backend.c:82] Creating headless backend
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:18] Starting headless backend
wlserver: [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [xwayland/server.c:92] Starting Xwayland on :1
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x562660db6de0 (res 0x562660db7600)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 68
pipewire: renegotiating stream params (size: 1280x720)
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x562660d926a0 (res 0x562660dbd9d0)
Error getting buffer
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
1963 frames in 5.0 seconds = 392.430 FPS
.
.
.

@loisgomez
Copy link

loisgomez commented May 27, 2022

Getting a segmentation fault when trying to test gamescope on an Nvidia GTX 1070TI.
The kernel parameter: nvidia-drm.modeset=1 is set.
And also setcap 'cap_sys_nice=eip' /usr/bin/gamescope

Graphics card: NVIDIA GTX 1070TI
NVIDIA version: 515.43.04
Gamescope version: (gamescope-git) 3.11.27.r0.ga913f85-3
Distribution: Archlinux

$> gamescope -W 1920 -H 1080 -- glxgears

[2022-05-27 22:41:25.061] [MANGOHUD] [info] [config.cpp:114] skipping config: '/usr/bin/MangoHud.conf' [ not found ]
[2022-05-27 22:41:25.061] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/berto/.config/MangoHud/gamescope.conf' [ not found ]
[2022-05-27 22:41:25.061] [MANGOHUD] [info] [config.cpp:119] parsing config: '/home/berto/.config/MangoHud/MangoHud.conf'
vulkan: selecting physical device 'NVIDIA GeForce GTX 1070 Ti': queue family 2
vulkan: physical device supports DRM format modifiers
[2022-05-27 22:41:25.167] [MANGOHUD] [info] [overlay.cpp:678] Uploading is disabled (permit_upload = 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan: 0x34325241
vulkan: 0x34325258
[1] 7604 segmentation fault (core dumped) gamescope -W 1920 -H 1080 -- glxgears

@misyltoad
Copy link
Collaborator

Try disabling mangohud?

@loisgomez
Copy link

Try disabling mangohud?

Dont think the error message has anything to do with mangohud.

vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)

@somewhatfrog
Copy link

somewhatfrog commented Jun 6, 2022

515.48 still the same issue on X11, regardless of mangohud.

MANGOHUD=0 gamescope -h 900 -H 1800 -n vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan
Segmentation fault (core dumped)

@khaneliman
Copy link

khaneliman commented Jun 6, 2022

515.48 still the same issue on X11, regardless of mangohud.

MANGOHUD=0 gamescope -h 900 -H 1800 -n vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan
Segmentation fault (core dumped)

I believe to get past that error you need to use the gamescope-git package, right now. The last comment I saw you make mentioned gamescope 3.11.30-1 but the fixes for NVIDIA were in 3.11.31 Although, I think I had an address boundary error and not just core dumped for the last line. You should also run setcap 'cap_sys_nice=eip' /usr/bin/gamescope .

@MinmoTech
Copy link

MinmoTech commented Jun 6, 2022

It's also failing for me:

$ sudo -E setcap 'cap_sys_nice=eip' /usr/bin/gamescope
$ gamescope -r 30 -- glxgears
vulkan: selecting physical device 'NVIDIA GeForce GTX 1080 Ti': queue family 2
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   0x34325241
vulkan:   0x34325258
gamescope: ../gamescope/src/wlserver.cpp:916: void wlserver_key(uint32_t, bool, uint32_t): Assertion `wlserver.wlr.virtual_keyboard_device != nullptr' failed.
fish: Job 1, 'gamescope -r 30 -- glxgears' terminated by signal SIGABRT (Abort)

Versions:

$ pacman -Q nvidia-dkms
nvidia-dkms 515.48.07-2
$ pacman -Q gamescope-git
gamescope-git 3.11.31.beta6.r0.gb1c3859-1

@SpidFightFR
Copy link

515.48 still the same issue on X11, regardless of mangohud.

MANGOHUD=0 gamescope -h 900 -H 1800 -n vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan
Segmentation fault (core dumped)

I had this issue too, switching to the gamescope-git version of the package solved the issue.

I have a GTX 1060 6gb and it seems to work.

@mkaito
Copy link

mkaito commented Jun 21, 2022

I suspect this might be a driver issue, but here goes.

❯ pacman -Q nvidia-dkms
nvidia-dkms 515.48.07-2

❯ pacman -Q gamescope-git
gamescope-git 3.11.33.beta1.r1.g1b3ad77-1

❯ gamescope -- vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce RTX 3080 Ti': queue family 2
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   0x34325241
vulkan:   0x34325258
vulkan: physical device queue doesn't support presenting on our surface
vulkan_make_output failed
[1]    45448 segmentation fault (core dumped)  gamescope -- vkcube

@somewhatfrog
Copy link

somewhatfrog commented Jun 25, 2022

gamescope-git with mangohud systemwide:

gamescope -h 1080 -H 1800 -- vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[2022-06-25 22:42:20.707] [MANGOHUD] [info] [config.cpp:112] skipping config: '/usr/bin/MangoHud.conf' [ not found ]
[2022-06-25 22:42:20.707] [MANGOHUD] [info] [config.cpp:112] skipping config: '/home/hello/.config/MangoHud/gamescope.conf' [ not found ]
[2022-06-25 22:42:20.707] [MANGOHUD] [info] [config.cpp:117] parsing config: '/home/hello/.config/MangoHud/MangoHud.conf'
sh: line 1: glxinfo: command not found
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti': queue family 2
vulkan: physical device supports DRM format modifiers
[2022-06-25 22:42:20.812] [MANGOHUD] [info] [overlay.cpp:718] Uploading is disabled (permit_upload = 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   0x34325241
vulkan:   0x34325258
Segmentation fault (core dumped)

And without mangohud it opens the window and freezes until manually killed:

MANGOHUD=0 gamescope -h 1080 -H 1800 -- vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti': queue family 2
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   0x34325241
vulkan:   0x34325258
wlserver: [backend/headless/backend.c:82] Creating headless backend
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:18] Starting headless backend
wlserver: [xwayland/server.c:92] Starting Xwayland on :1
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x5621380cc860 (res 0x5621380a8420)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 150
Selected GPU 0: NVIDIA GeForce RTX 3060 Ti, type: DiscreteGpu
pipewire: renegotiating stream params (size: 3200x1800)
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x562137e4d270 (res 0x5621380cb470)
pipewire: renegotiating stream params (size: 1920x2128)
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
(EE) failed to read Wayland events: Broken pipe
Killed

It does work in wayland tho.

@givname
Copy link

givname commented Jun 27, 2022

i got it working under steam but when i use it in terminal it doesnt work
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce GTX 1060'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan

on bottles flatpak i get:
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce GTX 1060': queue family 2
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan: 0x34325241
vulkan: 0x34325258
wlserver: [backend/headless/backend.c:82] Creating headless backend
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:18] Starting headless backend
wlserver: [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [xwayland/server.c:92] Starting Xwayland on :1
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x5617b48b5c70 (res 0x5617b4af30c0)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: pw_context_connect failed
Warning: failed to setup PipeWire, screen capture won't be available
wineserver: using server-side synchronization.
002c:err:wineboot:process_run_key Error running cmd L"C:\windows\system32\winemenubuilder.exe -r" (2).
00bc:err:xrandr:xrandr14_get_adapters Failed to get adapters
014c:err:ole:com_get_class_object apartment not initialised
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x5617b47b8000 (res 0x5617b4b15a30)
Error getting buffer
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_ABOVE
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_MAXIMIZED_VERT

on lutris its greyed out

running optimus with intel

@somewhatfrog
Copy link

somewhatfrog commented Jun 30, 2022

weirdly enough it runs with ENABLE_VKBASALT=1
i.e.:

ENABLE_VKBASALT=1 gamescope -h 1058 -H 1800 -U vkcube

but it locks cursor inside the window and stutters from time to time

@taylor85345
Copy link

I am seeing the same output as @severinkaderli after removing Optimus Manager from my system. I am on Garuda and just replaced their garuda-optimus-manager-config package with garuda-nvidia-prime-config, and now gamescope refuses to launch with prime-run variables. I compared the two packages and tried to find any other variables, but Optimus Manager seems to be doing something that Gamescope requires to work on my system.

@Samsagax
Copy link

Samsagax commented Jul 7, 2022

I am seeing the same output as @severinkaderli after removing Optimus Manager from my system. I am on Garuda and just replaced their garuda-optimus-manager-config package with garuda-nvidia-prime-config, and now gamescope refuses to launch with prime-run variables. I compared the two packages and tried to find any other variables, but Optimus Manager seems to be doing something that Gamescope requires to work on my system.

Optimus setups are a different kind of animal (and they seem to be forgotten by NV). Try the suggested variables setting in #498 I managed to get it working on the nested case.

@taylor85345
Copy link

The referenced variables are set by the prime-run script that I mentioned. Gamescope actually runs through my intel iGPU if I don't set those variables, except for the color corruption referenced in #356, but crashes entirely if I try to run on Nvidia via prime.

@tmespe
Copy link

tmespe commented Jul 8, 2022

Having the same issue on Fedora, but using Wayland. Works fine under X11.

@Arcitec
Copy link

Arcitec commented Jul 8, 2022

As explained here, I have tried NVIDIA driver 515.57 on Wayland (GNOME 42, GBM backend) with both the latest gamescope git and a specific commit that was said to work. Neither works. I get the "DRM format 0x3231564E" error as everyone else.

#492 (comment)

This is some kind of regression. That exact format was supported by NVIDIA on an earlier gamescope build or earlier NVIDIA driver. Not sure if the regression is in NVIDIA driver or in gamescope.

I've already verified that the modeset flag is set: cat /proc/cmdline | grep nvidia-drm.modeset=1

You can see some other user's log here which shows that the exact format WAS supported in whatever NVIDIA driver and gamescope version they used back then: #492 (comment) (Or perhaps they were running it on X11 and it's Wayland version that's broken? No idea.)

@taylor85345
Copy link

perhaps they were running it on X11 and it's Wayland version that's broken?

In my case I am trying to run in Wayland, but I have verified that it is broken in X11 (bspwm) as well

@gulafaran
Copy link

this is what it currently prints here.

 ┌┤acer->tom ~
 └➤ prime-run gamescope vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:68] Creating headless backend
vulkan: physical device 10de:2520 compute queue doesn't support presenting on our surface, using graphics queue
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Laptop GPU': queue family 0
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344258 (VkResult: 0)
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:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
wlserver: [types/wlr_compositor.c:673] New wlr_surface 0x56472b0c0b70 (res 0x56472b442a40)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 121
warning: queue 0x56472b384510 destroyed while proxies still attached:
  zwp_linux_dmabuf_feedback_v1@38 still attached
  zwp_linux_dmabuf_v1@39 still attached
pipewire: renegotiating stream params (size: 1280x720)
Selected GPU 0: NVIDIA GeForce RTX 3060 Laptop GPU, type: DiscreteGpu
wlserver: [types/wlr_compositor.c:673] New wlr_surface 0x56472b4134a0 (res 0x56472b442f30)
xwm: got the same buffer committed twice, ignoring.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
[destroyed object]: error 7: importing the supplied dmabufs failed

and if i leave it "running" long enough it begins spamming
vblankmanager: write failed: Resource temporarily unavailable

@pchome
Copy link

pchome commented Aug 23, 2023

Some people should check their commands.
To make sure use gamescope -- actual_command format.

Also
$ VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay gamescope -S integer -- vkcube

Result

Screenshot_20230823_151411

$ gamescope -S integer -- env VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay vkcube

Result

Screenshot_20230823_151505

EDIT: debug helper example (while running gamescope)

$  lsof | grep egl- | awk '{print $1" "$2" "$NF}' | sort -u
firefox-b 16547 /usr/lib64/libnvidia-egl-gbm.so.1.1.0
Xwayland 18483 /usr/lib64/libnvidia-egl-gbm.so.1.1.0

EDIT2:
@gulafaran

and if i leave it "running" long enough it begins spamming
vblankmanager: write failed: Resource temporarily unavailable

I noticed gamescope will not completely exit if command has failed.
e.g. $ gamescope -- vkcube --garbage-var

@ghost
Copy link

ghost commented Aug 23, 2023

I see, thanks, it does load now (gamescope -- vkcube) but I'm unable to interact with the window (eg. resizing it) as it causes the system to hang for a bit and I have to force the program to quit
if I add any other command (eg. gamescope --fullscreen -- vkcube) the program immediately crashes and causes the system to hang
it outputs:

The XKEYBOARD keymap compiler (xkbcomp) reports:
 Warning:          Unsupported maximum keycode 708, clipping.
                   X11 cannot support keycodes above 255.
gamescope: ../src/rendervulkan.cpp:1514: void CVulkanDevice::wait(uint64_t, bool): Assertion `0' failed.
(EE) failed to read Wayland events: Broken pipe

It also spammed the logs with
vblankmanager: write failed: Resource temporarily unavailable

When running the command one time, it displayed the first image of the vkcube fullscreen, froze and hung the entire system for ~5 minutes until I was put back at the login menu

@pchome
Copy link

pchome commented Aug 23, 2023

@PikaDevs

When running the command one time, it displayed the first image of the vkcube fullscreen, froze and hung the entire system for ~5 minutes until I was put back at the login menu

Same for me with gamescope --fullscreen -- vkcube
#651 (?)

But I was able to switch to next plasma virtual desktop and kill it via xterm. Usually using them instead of Alt+TAB.
Had no Alt+TAB problems ever in games.
I'm used to do Ctrl+F1, Ctrl+F2, ...

@ghost
Copy link

ghost commented Aug 23, 2023

I see, thanks, it just seems that gamescope isn't really useable for me in it's current state with NVIDIA

gamescope --nested-height 1440 --nested-width 2560 --output-height 2160 --output-width 3840 --filter fsr --fsr-sharpness 15 --

I assume since there's no fullscreen that's why the current output is 1440 by 2560, which makes no difference as to just running it at that resolution

@raresgmihalcea
Copy link

Also having this issue with an NVIDIA GeForce RTX 2060 Mobile on Arch Linux running master

Edit: not the same, I actually get

vulkan: vkCreateDevice failed (VkResult: -7)

I've managed to fix VkResult: -7 by using Vulkan Validation Layers

@pchome
Copy link

pchome commented Sep 18, 2023

@raresgmihalcea

I've managed to fix VkResult: -7 by using Vulkan Validation Layers

lol

$ grep '\-7' /usr/include/vulkan/vulkan_core.h
    VK_ERROR_EXTENSION_NOT_PRESENT = -7,

Which is either VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME (if not in modeset=1) or VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME (on some nv gpus), AFAIK.

EDIT: well, the VK_KHR_MAINTENANCE_5_EXTENSION_NAME too in current git (which, according to gpuinfo, currently supported only by nv vulkan beta drivers)

@LethalManBoob
Copy link

Anyone else having it crash every other boot? I can make gamescope work fullscreen on kde but ever other boot it just fails even if i close all running gamescope tasks

@kekkoudesu
Copy link

kekkoudesu commented Oct 11, 2023

Here's a weird one:

I'm on Fedora 38, KDE. I just built the Gamescope binary, and i tried it out with vkcube. I get a black window and then it crashes, but I have to kill it with pkill gamescope -9:

build/src/gamescope -- vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Your Wayland compositor does NOT support wp_presentation/presentation-time which is required for VK_KHR_present_wait and VK_KHR_present_id.
Please complain to your compositor vendor for support. Falling back to X11 window with less accurate present wait.
wlserver: [backend/headless/backend.c:68] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 2060 SUPER': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344258 (VkResult: 0)
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:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x2744c20 (res 0x2c3ddd0)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 42
pipewire: renegotiating stream params (size: 1280x720)
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
Selected GPU 0: NVIDIA GeForce RTX 2060 SUPER, type: DiscreteGpu
[Gamescope WSI] Creating Gamescope surface: xid: 0x400000
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x2c17e90 (res 0x2c40390)
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x2c16da0 (res 0x2c451b0)[Gamescope WSI] Made gamescope surface for xid: 0x400000

[Gamescope WSI] Surface state:
  window xid:                    0x400000
  wayland surface res id:        5
wlserver:   layer client flags:            0x0
[wayland] error in client communication (pid 55569)  server hdr output enabled:     false

  hdr formats exposed to client: false
xwm: got the same buffer committed twice, ignoring.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
[Gamescope WSI] Creating swapchain for xid: 0x400000 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
wl_display@1: error 1: invalid method 2, object gamescope_xwayland@4
[Gamescope WSI] Failed to create swapchain - vr: VK_ERROR_INITIALIZATION_FAILED xid: 0x400000
gamescope: children shut down!

Trying it with a native Ren'Py game, I get a black window and it crashes:

build/src/gamescope -- ./aheroandagarden.sh
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Your Wayland compositor does NOT support wp_presentation/presentation-time which is required for VK_KHR_present_wait and VK_KHR_present_id.
Please complain to your compositor vendor for support. Falling back to X11 window with less accurate present wait.
wlserver: [backend/headless/backend.c:68] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 2060 SUPER': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344258 (VkResult: 0)
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:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x1464bd0 (res 0x195de60)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 42
pipewire: renegotiating stream params (size: 1280x720)
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x1937f20 (res 0x195fb90)
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server
vblankmanager: write failed: Resource temporarily unavailable

So I tried it over Wine, and I don't get a window at all. It just dies immediately:

build/src/gamescope -- WINEPREIFX=~/.local/share/wineprefixes/vn32 LANG=ja_JP.UTF-8 wine DistantMemorajxo.exe
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Your Wayland compositor does NOT support wp_presentation/presentation-time which is required for VK_KHR_present_wait and VK_KHR_present_id.
Please complain to your compositor vendor for support. Falling back to X11 window with less accurate present wait.
wlserver: [backend/headless/backend.c:68] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 2060 SUPER': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344258 (VkResult: 0)
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:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x2f76b20 (res 0x346f8a0)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 42
xwm: execvp failed: No such file or directory
gamescope: children shut down!
(EE) failed to read Wayland events: Broken pipe

And here's the really weird part. I added the Ren'Py game and Windows game to Lutris with DXVK and Gamescope enabled, and they...work fine?

lutris-wrapper: A HERO AND A GARDEN
Started initial process 56961 from gamescope -w 1920 -h 1080 -- gamemoderun ./aheroandagarden.sh
Start monitoring process.
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:68] Creating headless backend
vulkan: physical device 10de:1f06 compute queue doesn't support presenting on our surface, using graphics queue
vulkan: selecting physical device 'NVIDIA GeForce RTX 2060 SUPER': queue family 0
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344258 (VkResult: 0)
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:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
wlserver: [types/wlr_compositor.c:673] New wlr_surface 0x559d4489c460 (res 0x559d448a0e20)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 61
pipewire: renegotiating stream params (size: 1280x720)
gamemodeauto: 
gamemodeauto: 
wlserver: [types/wlr_compositor.c:673] New wlr_surface 0x559d4487ac00 (res 0x559d448a42d0)
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server

I tried passing gamemoderun to gamescope after seeing this, but nothing changed. So, it would seem to me...that the Lutris Runtime has some library I need that I don't know about. I guess I need to poke around ~/.local/share/lutris/runtime to see what libraries I need to install. There are 130 pinned Ubuntu 18.04 x64 libraries.

@LethalManBoob
Copy link

LethalManBoob commented Nov 24, 2023

Gamescope hasent worked for me in months. Boots to empty screen.

╰─>$ gamescope -- glxgears
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:67] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 3070': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
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:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
vulkan: Creating Gamescope nested swapchain with format 44 and colorspace 0
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:17] Starting headless backend
wlserver: [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x560b78828fc0 (res 0x560b78eab040)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 113
vulkan: Creating Gamescope nested swapchain with format 44 and colorspace 0
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
pipewire: renegotiating stream params (size: 1280x720)
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x560b78647780 (res 0x560b78eae670)
xwm: got the same buffer committed twice, ignoring.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server

@sharkautarch
Copy link

sharkautarch commented Nov 25, 2023

Gamescope hasent worked for me in months. Boots to empty screen.


...
Errors from xkbcomp are not fatal to the X server

@LethalManBoob
I've just updated my nvidia-fix branch, which has a workaround for the current nvidia driver bug w/ gamescope, to the latest git revision of gamescope.
I've tested my building and running gamescope from my branch w/ nvidia, and it seems to work as long as you set ENABLE_GAMESCOPE_WSI=0 (e.i. ENABLE_GAMESCOPE_WSI=0 gamescope <params> -- <game>)
if you're using hybrid graphics, you'll have to run gamescope like so: ENABLE_GAMESCOPE_WSI=0 gamescope --prefer-vk-device $(env MESA_VK_DEVICE_SELECT=list vulkaninfo) <params> -- <game>

to build from my branch:

git clone https://github.com/sharkautarch/gamescope.git
cd gamescope
git checkout nvidia-fix
meson setup -Dc_args="-Wno-uninitialized -Wno-maybe-uninitialized" -Dcpp_args="-Wno-uninitialized -Wno-maybe-uninitialized" --reconfigure build
ninja -C build
meson install -C build

@Rdeisenroth
Copy link

Rdeisenroth commented Nov 26, 2023

@sharkautarch i tried your fix branch, but:

  • following your steps i had to run git submodule update --init --recursive after the git pull in order to fetch the submodules or it wouldn't build
  • i also get the freezing described by others after a short while in every game i tested so far, with the log spamming:
    vblankmanager: write failed: Resource temporarily unavailable
    i run with something like ENABLE_GAMESCOPE_WSI=0 gamemoderun gamescope -r 144 -- glxgears

@sharkautarch
Copy link

@sharkautarch i tried your fix branch, but:

* following your steps i had to run `git submodule update --init --recursive` after the `git pull` in order to fetch the submodules or it wouldn't build

* i also get the freezing described by others after a short while in every game i tested so far, with the log spamming:
  `vblankmanager: write failed: Resource temporarily unavailable`
  i run with something like `ENABLE_GAMESCOPE_WSI=0 gamemoderun gamescope -r 144 -- glxgears`

@Rdeisenroth
Huh...
what nvidia driver are you using?
there may or may not be an issue with the nvidia 545 driver...
One person said that my branch was able to run after switching to 535 dkms driver
Another person said it actually worked fine w/ the 545 driver...

Nvidia is one heck of a weird gpu on linux, amirite!

See:
#948 (comment)

and see:
#948 (comment)

@LethalManBoob

This comment was marked as outdated.

@sharkautarch
Copy link

@LethalManBoob
I just updated the nvidia-fix branch (pulling in newer upstream gamescope commits)
Maybe rebuilding gamescope now might help? idk

Your Wayland compositor does NOT support wp_presentation/presentation-time which is required for VK_KHR_present_wait and VK_KHR_present_id.
Please complain to your compositor vendor for support. Falling back to X11 window with less accurate present wait.

I assume you're running on wayland?

wlserver: [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use

hmmm that probably isn't supposed to happen normally????

wlserver: [xwayland/server.c:108] Starting Xwayland on :2

hmmm maybe this line, plus the quoted line above it could just be due to a previous gamescope session that didn't exit properly????

Can you confirm that you still get said lines in your terminal after following these steps and then re-running gamescope:

  • if you do nvidia-smi, do you see any processes (besides, say, your normal DE session if applicable)
  • and if so, try killing said processes
  • also doing ps -aux | grep '[g]amescope|[r]aze' and killing any process you find from that command

What version is your nvidia driver? is it 545 or 535?

@Rdeisenroth
Copy link

Rdeisenroth commented Nov 29, 2023

@Rdeisenroth Huh... what nvidia driver are you using?

@sharkautarch
I am using 545.29.06.

Nvidia is one heck of a weird gpu on linux, amirite!

Absolutely. I regret my RTX 4080. Should've bought AMD. But i do need some of the proprietary features of team green 😢

See: #948 (comment)

and see: #948 (comment)

Hmm idk i can't get it to work with 545, it always freezes after a while. I will test 535 and other WMs tomorrow. I am using Hyprland with xorg-xwayland-explicit-sync-git package.

@LethalManBoob
Copy link

LethalManBoob commented Nov 30, 2023

updated

╰─>$ ENABLE_GAMESCOPE_WSI=0 gamescope -- raze
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Your Wayland compositor does NOT support wp_presentation/presentation-time which is required for VK_KHR_present_wait and VK_KHR_present_id.
Please complain to your compositor vendor for support. Falling back to X11 window with less accurate present wait.
wlserver: [backend/headless/backend.c:67] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 3070': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
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:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
vulkan: Creating Gamescope nested swapchain with format 44 and colorspace 0
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:17] Starting headless backend
wlserver: [xwayland/sockets.c:63] 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:435] WLR_NO_HARDWARE_CURSORS set, forcing software cursors
wlserver: [xwayland/server.c:108] Starting Xwayland on :2
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x5567fc99cd80 (res 0x5567fceed170)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 62
vulkan: Creating Gamescope nested swapchain with format 44 and colorspace 0
Raze 1.8.1 - 2023-11-12 14:35:34 +0100 - SDL version
Compiled on Nov 15 2023

pipewire: renegotiating stream params (size: 1280x720)
Log started: 2023-11-30 00:02:40
OS: CachyOS, Linux 6.6.2-3-cachyos-sched-ext on x86_64
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_ABOVE
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_STAYS_ON_TOP
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_BELOW
wlserver: [types/wlr_compositor.c:692] New wlr_surface 0x5567fcec4ec0 (res 0x5567fcef0270)
xwm: Unhandled initial NET_WM_STATE property: _NET_WM_STATE_MODAL
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
gamescope: Received Terminated signal, forwarding to child!
gamescope: Received Terminated signal, attempting shutdown!
gamescope: Received Terminated signal, forwarding to child!
gamescope: Received Terminated signal, attempting shutdown!
gamescope: Received Terminated signal, forwarding to child!
gamescope: Received Terminated signal, attempting shutdown!
gamescope: Received Terminated signal, forwarding to child!
gamescope: Received Terminated signal, attempting shutdown!
gamescope: Received Terminated signal, forwarding to child!
gamescope: Received Terminated signal, attempting shutdown!
gamescope: Received Terminated signal, forwarding to child!
gamescope: Received Terminated signal, attempting shutdown!
(EE) failed to read Wayland events: Broken pipe

@sharkautarch
Copy link

@Rdeisenroth:
Hmm idk i can't get it to work with 545, it always freezes after a while. I will test 535 and other WMs tomorrow. I am using Hyprland with xorg-xwayland-explicit-sync-git package.

LethalManBoob: updated
╰─>$ ENABLE_GAMESCOPE_WSI=0 gamescope -- raze
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.

@LethalManBoob Are you using nvidia driver version 545?

I wonder if the issue w/ nvidia-fix not working is an issue of nvidia+gamescope being used w/ a wayland DE?
idk...

@akay you said that nvidia-fix + switching to nvidia 535 dkms driver worked for you... Do you use a wayland or X11 DE?

I'm using nvidia dkms 535 on xfce (x11) and the nvidia-fix branch of gamescope is working for me

@akay
Copy link

akay commented Nov 30, 2023

@akay you said that nvidia-fix + switching to nvidia 535 dkms driver worked for you... Do you use a wayland or X11 DE?

I use Sway, so Wayland on wlroots:

$ env | rg -i "wlr|gl|gbm|vk|sdl"
WLR_NO_HARDWARE_CURSORS=1
WLR_DRM_DEVICES=/dev/dri/card0
WLR_RENDERER=gles2
WLR_BACKENDS=libinput,drm
WLR_RENDER_DRM_DEVICE=/dev/dri/renderD128
__GLX_VENDOR_LIBRARY_NAME=nvidia
__GL_GSYNC_ALLOWED=0
__GL_VRR_ALLOWED=0
GBM_BACKEND=nvidia-drm
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
SDL_VIDEODRIVER=wayland

$ pacman -Q xorg-xwayland sway wlroots*
xorg-xwayland 23.2.2-1
sway 1:1.8.1-4
wlroots-nvidia 0.17.0-2
wlroots0.16 0.16.2-2

@LethalManBoob
Copy link

LethalManBoob commented Nov 30, 2023

Replying to #497 (comment)

545.29.06 wayland kde plasma

@sharkautarch
Copy link

Replying to #497 (comment)

545.29.06 wayland kde plasma

Yeah, so it seems like nvidia 545 might not work well w/ gamescope nvidia-fix branch

@LethalManBoob
Copy link

Replying to #497 (comment)

545.29.06 wayland kde plasma

Yeah, so it seems like nvidia 545 might not work well w/ gamescope nvidia-fix branch

nvidia-fix needs a fix for nvidia B)

@sharkautarch
Copy link

nvidia-fix needs a fix for nvidia B)

well, since the bug that necessitated the nvidia-fix branch is actually a bug in the nvidia driver itself, it would be more appropriate to say:

nvidia needs a fix for nvidia-fix
(and they also need a fix for gamescope)

@sergiotca
Copy link

sergiotca commented Feb 23, 2024

Has anyone had a chance to test if the newly nvidia driver 550.54.14 has solved this issue?

https://www.nvidia.com/Download/driverResults.aspx/218826/en-us/

@gulafaran
Copy link

i just tested to run it on 550.40.07 with gamescope-git rebuilt, havent tried it in a while and vkcube shows now. this is on a prime/optimus setup

@kulothunganug

This comment was marked as outdated.

@kulothunganug
Copy link

Same issue, i have set nvidia modeset and setcap

using gamescope from aur

gamescope vkcube
[gamescope] [Info]  console: gamescope version 3.15.5
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info]  vulkan: selecting physical device 'NVIDIA GeForce RTX 2050': queue family 2 (general queue family 0)
[gamescope] [Info]  vulkan: physical device supports DRM format modifiers
[gamescope] [Info]  wlserver: [backend/headless/backend.c:67] Creating headless backend
[gamescope] [Info]  xdg_backend: Seat name: Hyprland
[gamescope] [Error] vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344241 (VkResult: 0)
[gamescope] [Error] vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344258 (VkResult: 0)
[gamescope] [Info]  vulkan: supported DRM formats for sampling usage:
[gamescope] [Info]  vulkan:   AR24 (0x34325241)
[gamescope] [Info]  vulkan:   XR24 (0x34325258)
[gamescope] [Info]  vulkan:   AB24 (0x34324241)
[gamescope] [Info]  vulkan:   XB24 (0x34324258)
[gamescope] [Info]  vulkan:   RG16 (0x36314752)
[gamescope] [Info]  vulkan:   AB4H (0x48344241)
[gamescope] [Info]  vulkan:   XB4H (0x48344258)
[gamescope] [Info]  vulkan:   AB30 (0x30334241)
[gamescope] [Info]  vulkan:   AR30 (0x30335241)
[gamescope] [Info]  vulkan:   XR30 (0x30335258)
gamescope: ../gamescope/src/rendervulkan.cpp:2118: bool CVulkanTexture::BInit(uint32_t, uint32_t, uint32_t, uint32_t, createFlags, wlr_dmabuf_attributes*, uint32_t, uint32_t, CVulkanTexture*, gamescope::OwningRc<gamescope::IBackendFb>): Assertion `!modifiers.empty()' failed.
fish: Job 1, 'gamescope vkcube' terminated by signal SIGABRT (Abort)
nvidia-smi
Thu Sep 12 15:33:13 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2050        Off |   00000000:01:00.0 Off |                  N/A |
| N/A   46C    P0              8W /   70W |       8MiB /   4096MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A       894      G   Hyprland                                        1MiB |
+-----------------------------------------------------------------------------------------+

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

No branches or pull requests