ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.12k stars 211 forks source link

gamescope doesn't run on NVIDIA #497

Open severinkaderli opened 2 years ago

severinkaderli commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

somewhatfrog commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

franzmondlichtmann commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Try disabling mangohud?

loisgomez commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Arcitec commented 2 years ago

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.

https://github.com/Plagman/gamescope/issues/492#issuecomment-1178536432

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: https://github.com/Plagman/gamescope/issues/492#issuecomment-1140080513 (Or perhaps they were running it on X11 and it's Wayland version that's broken? No idea.)

taylor85345 commented 2 years ago

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

sad-goldfish commented 2 years ago

On my machine e4892543a04637aa32dfac336762c22cfff880db works but current HEAD ( 3122d1aabec4d8f7df79edb1b76e136c0dd5ffbf ) does not. Running gamescope with perf gives:

git clone https://github.com/Plagman/gamescope --depth=1
cd gamescope
meson build
ninja -C build/
perf record -g -o ~/gamescope.perf --call-graph dwarf,16384 build/gamescope -- glxgears -fullscreen
perf report -i ~/gamescope.perf | head -n 2500 > rpt.txt
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:82] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce GTX 1080': 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: 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 0x558bf72ea950 (res 0x558bf72e1240)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 266
pipewire: renegotiating stream params (size: 1280x720)
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x558bf72aa4a0 (res 0x558bf72e56c0)
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
pipewire: renegotiating stream params (size: 849x1406)
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
vblankmanager: write failed: Resource temporarily unavailable
vblankmanager: write failed: Resource temporarily unavailable
...

The last line is repeated hundreds of times before I sigterm then sigkill gamescope. The output of the report: rpt.txt

dacioromero commented 2 years ago

I have the same issue as above with a GTX 1070 with 515.65.01 drivers. The first bad commit for me is https://github.com/Plagman/gamescope/commit/166395a61971618deed66ad0a426f5d17da44311. I'm currently running Gnome, but interestingly the current HEAD (https://github.com/Plagman/gamescope/commit/3122d1aabec4d8f7df79edb1b76e136c0dd5ffbf) sometimes works in KDE, but never in Gnome.

NotAShelf commented 2 years ago

can confirm this is a thing with a GTX 1660s running both nvidia 515.65.01-11 and nvidia-open 515.65.01-10 on Arch, regardless of whether I'm running xorg or wayland.

Kitsumi commented 2 years ago

I'm also having issues with gamescope on Arch. Using NVIDIA proprietary driver version 515.65.01 with kernel Linux 5.19.7-arch1-1 x86_64 on gamescope 3.11.43

$ gamescope -w 1920 -h 1080 -- vkcube

Output: ``` wlserver: [backend/headless/backend.c:82] Creating headless backend MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0 vulkan: selecting physical device 'NVIDIA GeForce RTX 3050 Ti Laptop GPU': 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: 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 :2 wlserver: [types/wlr_surface.c:741] New wlr_surface 0x55f7bf1feac0 (res 0x55f7bf202f40) wlserver: [xwayland/server.c:250] Xserver is ready pipewire: stream state changed: connecting pipewire: stream state changed: paused pipewire: stream available on node ID: 59 MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0 Selected GPU 0: NVIDIA GeForce RTX 3050 Ti Laptop GPU, type: DiscreteGpu pipewire: renegotiating stream params (size: 1280x720) wlserver: [types/wlr_surface.c:741] New wlr_surface 0x55f7bf171920 (res 0x55f7bf206340) Error getting buffer ```

I tried multiple other commits other people have suggested, but they all result in this same output. The games seem to run without an issue, but the game window is nowhere to be found.

BasedAnon commented 2 years ago

I was looking at the NVidia drivers this morning and noticed that the Stable release is more recent than the Experimental one.

cronyakatsuki commented 2 years ago

Ryzen 5 3500h and Gtx 1650 here on arch it doesnt work but on fedora/nobara gamescope works normally here I get the error getting buffer

log

wlserver: [backend/headless/backend.c:82] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce GTX 1650': 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: 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 0x557a0ac910f0 (res 0x557a0ada0ab0)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 81
Selected GPU 0: NVIDIA GeForce GTX 1650, type: DiscreteGpu
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x557a0ae1d070 (res 0x557a0ada48e0)
Error getting buffer
Arcitec commented 2 years ago

Starting to give up on expecting NVIDIA on Linux to be good...

Maybe next year, guys?

LethalManBoob commented 2 years ago

Starting to give up on expecting NVIDIA on Linux to be good...

Maybe next year, guys?

Doesn't help the latest nvidia driver has a bug that causes a "display not found" when booting up, forcing a chroot to uninstall the driver.

cronyakatsuki commented 2 years ago

Using envycontrol to change the used gpu to only the igpu gamescope works normally. When nvidia driver is loaded in any way gamescope just shows the error error getting buffer

sl1pkn07 commented 1 year ago

same here with 525.53 privative, GTX1070ti FE, gamescope from GIT (2791466) (own package) archlinux with kernel 6.0.8-arch1. nvidia-drm.modeset=1 is set by modprobe.d file. KDE wayland session

gdb:

└───╼  gdb gamescope 
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gamescope...
(No debugging symbols found in gamescope)
(gdb) run
Starting program: /usr/bin/gamescope 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:82] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce GTX 1070 Ti': queue family 2
vulkan: physical device supports DRM format modifiers
[New Thread 0x7f9bdefff6c0 (LWP 391773)]
[New Thread 0x7f9bde7fe6c0 (LWP 391774)]
[New Thread 0x7f9bddffd6c0 (LWP 391775)]
[New Thread 0x7f9bdd4096c0 (LWP 391785)]
[New Thread 0x7f9bdc9086c0 (LWP 391789)]
[New Thread 0x7f9bc7fff6c0 (LWP 391790)]
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
[Thread 0x7f9bdd4096c0 (LWP 391785) exited]
[Thread 0x7f9bdefff6c0 (LWP 391773) exited]

Thread 6 "gamescope-shdr" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f9bdc9086c0 (LWP 391789)]
0x0000559967312065 in ?? ()
(gdb) bt full
#0  0x0000559967312065 in  ()
#1  0x00005599672f2073 in  ()
#2  0x00007f9be46d62f3 in std::execute_native_thread_routine(void*) (__p=0x5599688c0f60) at /usr/src/debug/gcc/libstdc++-v3/src/c++11/thread.cc:82
#3  0x00007f9be449f8fd in start_thread (arg=<optimized out>) at pthread_create.c:442
        ret = <optimized out>
        pd = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140307397117632, -6335962895579123884, -576, 2, 140720749512864, 140307388727296, 6279595061864001364, 6279684479113588564}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#4  0x00007f9be4521a60 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

no cnages with sudo setcap 'cap_sys_nice=eip' /usr/bin/gamescope

adamant-pwn commented 1 year ago

I'm having the same issue with my NVIDIA GeForce RTX 3070 Mobile / Max-Q:

[adamant@Legion-5-Pro ~]$ yay -Q nvidia-dkms
  nvidia-beta-dkms 525.60.11-1
[adamant@Legion-5-Pro ~]$ yay -Q gamescope-git 
  gamescope-git 3.11.49.r26.g5a9bf10-1
[adamant@Legion-5-Pro ~]$ gamescope -- vkcube
  wlserver: [backend/headless/backend.c:68] Creating headless backend
  vulkan: selecting physical device 'NVIDIA GeForce RTX 3070 Laptop GPU': 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
  Segmentation fault (core dumped)

But I can confirm that it works with ENABLE_VKBASALT=1 gamescope -- vkcube.

apprehensions commented 1 year ago

for me, gamescope will not work at all.

$ 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: selecting physical device 'NVIDIA GeForce RTX 2060': 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
Segmentation fault
(gdb) run
Starting program: /usr/bin/gamescope 
warning: File "/usr/lib/libstdc++.so.6.0.30-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
    add-auto-load-safe-path /usr/lib/libstdc++.so.6.0.30-gdb.py
line to your configuration file "/home/wael/.config/gdb/gdbinit".
To completely disable this security protection add
    set auto-load safe-path /
line to your configuration file "/home/wael/.config/gdb/gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
    info "(gdb)Auto-loading safe path"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
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
[Detaching after fork from child process 23620]
vulkan: selecting physical device 'NVIDIA GeForce RTX 2060': queue family 2
vulkan: physical device supports DRM format modifiers
[New Thread 0x7ffff1aff6c0 (LWP 23621)]
[New Thread 0x7ffff12fe6c0 (LWP 23622)]
[New Thread 0x7ffff0afd6c0 (LWP 23623)]
[New Thread 0x7fffe3d0c6c0 (LWP 23624)]
[New Thread 0x7fffe320b6c0 (LWP 23625)]
[New Thread 0x7fffe2a0a6c0 (LWP 23626)]
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   0x34325241
vulkan:   0x34325258

Thread 1 "gamescope" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007ffff53b49e3 in ?? () from /usr/lib/libnvidia-eglcore.so.525.60.11
No symbol table info available.
#2  0x00007ffff5456792 in ?? () from /usr/lib/libnvidia-eglcore.so.525.60.11
No symbol table info available.
#3  0x00007ffff53a5aa0 in ?? () from /usr/lib/libnvidia-eglcore.so.525.60.11
No symbol table info available.
#4  0x00005555555e0b9c in ?? ()
No symbol table info available.
#5  0x000055555556ea0b in ?? ()
No symbol table info available.
#6  0x00007ffff72de30a in ?? () from /usr/lib/libc.so.6
No symbol table info available.
#7  0x00007ffff72de3c5 in __libc_start_main () from /usr/lib/libc.so.6
No symbol table info available.
#8  0x000055555556fc71 in ?? ()
No symbol table info available.
(gdb) 

i am to assume gamescope will no longer work if nvidia-drm.modeset is set to 1.

KorinFlakes commented 1 year ago

Gamescope runs fine for me when launching the vkcube, but if I try to launch a game through steam, 8 times out of 10 the window will be blank and I have to manually kill the window with htop. Occasionally it just works and I can play but that is like 2 out of 10 times...

I am using gamescope-git from the AUR. This issue happens regardless of whether I use the fullscreen, borderless fullscreen or FSR options. nvidia-drm.modeset=1 is set. Not really sure what else to try at this point.

Inxi -Fazy output

szmarczak commented 1 year ago

I am experiencing the same issue @KorinFlakes has. I noticed that it always works if -r 60, but provide any other framerate - and it freezes for a few seconds and the window is blank.

mdeguzis commented 1 year ago

I can run this fine under ChimeraOS, and I don't think there is anything special added. BUT.... when I change a games rendering resolution (Steam > game > props > general > resolution), the game flickers a lot.

Flickering:

https://user-images.githubusercontent.com/3931917/218232518-b6fddebc-9168-4638-bfa7-794da5f8ef77.mp4

Home screen:

image

However, I get a black box when I try to turn on the performance monitor/mangohud:

image

PROS

CONS

System Info:


Kernel release: 6.1.1-arch1-1
Kernel arch: x86_64

LSB Version:    1.4
Distributor ID: chimeraos
Description:    ChimeraOS
Release:    38 (c47f2bb)
Codename:   n/a

GPU: GA102 [GeForce RTX 3080 12GB]
GPU Vendor: NVIDIA
GPU Driver in use: nvidia
GPU Driver Version:  NVIDIA GLX Module  525.60.11  Wed Nov 23 22:51:25 UTC 2022
GPU Video Memory: 12.00 GB
gulafaran commented 1 year ago

i managed to workaround this on my dual gpu prime laptop, with simply gamescope -- prime-run vkcube , instead of applying prime-run ontop of gamescope. now im not sure how much performance impact this has or if it causes some other issues but it let me confine the pointer in a game that refused to do so in wayland. and yet run it on nvidia.

ruineka commented 1 year ago

i managed to workaround this on my dual gpu prime laptop, with simply gamescope -- prime-run vkcube , instead of applying prime-run ontop of gamescope. now im not sure how much performance impact this has or if it causes some other issues but it let me confine the pointer in a game that refused to do so in wayland. and yet run it on nvidia.

Sounds almost like the method I've been experimenting with. You can use prefer-vk-device in a gamescope-session to force the use of a iGPU for gamescope and then use the Nvidia GPU to play the actual games. Using a 5600G Ryzen comboed with an Nvidia GPU is a really good experience. The performance overlay and everything works surprisingly well. Your bios has to have the ability to keep the iGPU and PCIe dGPU enabled at all times (Usually called iGPU multi-monitor support). You'll be plugging into the motherboard, instead of the dGPU to accomplish this.

Freso commented 1 year ago

For gamescope -- glx-gears I get these outputs…

With gamescope 3.11.51-1:

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: selecting physical device 'NVIDIA GeForce GTX 1070': 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
fish: Job 1, 'gamescope -- glx-gears' terminated by signal SIGSEGV (Address boundary error)

With gamescope-git 3.11.52.beta6.r26.g5d9ecd4-1:

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: selecting physical device 'NVIDIA GeForce GTX 1070': queue family 2
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 0x38344241 (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)
vulkan: physical device queue doesn't support presenting on our surface
vulkan_make_output failed
fish: Job 1, 'gamescope -- glx-gears' terminated by signal SIGSEGV (Address boundary error)

> pacman -Qi nvidia-dkms|grep Version
Version                : 530.41.03-1
> uname -a
Linux din 6.2.8-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Wed, 22 Mar 2023 22:52:38 +0000 x86_64 GNU/Linux
> cat /proc/cmdline 
initrd=\amd-ucode.img initrd=\initramfs-linux-zen.img root=[…] rootflags=[…] resume=[…] ro nvidia_drm.modeset=1 mitigations=off
> echo $DISPLAY $WAYLAND_DISPLAY 
:1 wayland-1
meisme-dev commented 1 year ago

Replying to https://github.com/ValveSoftware/gamescope/issues/497#issuecomment-1426534156

I have the quoted problem on my hybrid laptop when forcing NVIDIA.

However, gamescope just segfaults on my other NVIDIA only machine:

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [../backend/headless/backend.c:82] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 2070 SUPER': 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]    17899 segmentation fault (core dumped)  gamescope
Exotic0015 commented 1 year ago

I'm running Fedora 38 KDE with a single Nvidia GPU (proprietary drivers, version 535.54.03), gamescope in the official repositories segfaulted in libX11, after compiling it myself it launches but immediately freezes spamming the log with vblankmanager: write failed: Resource temporarily unavailable

pescepalla commented 1 year ago

NVIDIA GeForce 3070 here on Arch Linux w/ Wayland.

My next GPU is an AMD.