Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

[Bug]: (nvidia-515-48-07) Gamescope - game does not actually display

Open ghtesting2020 opened this issue 2 years ago • 31 comments

Describe the bug

Latest Nvidia driver is in flatpak and i update (org.freedesktop.Platform.GL.nvidia-515-43-04). I enable gamescope for game and when i click play to start it prints error in log and does not start. If i turn off gamescope it works as usual.

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
vulkan: selecting physical device 'NVIDIA GeForce GTX 1650'
vulkan: physical device supports DRM format modifiers
vulkan: vkCreateFence failed (VkResult: -1)
Failed to initialize Vulkan

To Reproduce

using nvidia optimus laptop turn on gamescope try to launch game error printed

Package

Flatpak from Flathub

Distribution

Arch

Health Check

Display:
    X.org: true
    X.org (port): :99.0
    Wayland: false
Graphics:
    vendors:
        nvidia: &id002
            vendor: nvidia
            envs:
                __NV_PRIME_RENDER_OFFLOAD: '1'
                __GLX_VENDOR_LIBRARY_NAME: nvidia
                __VK_LAYER_NV_optimus: NVIDIA_only
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/nvidia_icd.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/nvidia_icd.json
        intel: &id001
            vendor: intel
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/intel_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/intel_icd.i686.json
    prime:
        integrated: *id001
        discrete: *id002
Kernel:
    Type: Linux
    Version: 5.17.12-hardened2-1-hardened
Distro:
    Name: GNOME
    Version: '"42 (Flatpak runtime)"'
Disk:
    Total: 4103133001
    Free: 4102013021
RAM:
    MemTotal: 15.5GiB
    MemAvailable: 13.1GiB
Tools:
    cabextract: true
    p7zip: true
    patool: true
    glibc_min: '2.33'
Bottles_envs: null

Display Protocol

X11

Display Backend used by Bottles

X11

Additional context

No response

ghtesting2020 avatar Jun 01 '22 01:06 ghtesting2020

Can you provide the health check please? To do so, press the hamburger menu () at the top right of Bottles. Then press "Health check". Lastly, select everything and paste it.

TheEvilSkeleton avatar Jun 01 '22 01:06 TheEvilSkeleton

related flatpak runtimes

gamescope                        com.valvesoftware.Steam.Utility.gamescope     3.11.28  stable       system
nvidia-515-43-04                 org.freedesktop.Platform.GL.nvidia-515-43-04           1.4          system
nvidia-515-43-04                 ?g.freedesktop.Platform.GL32.nvidia-515-43-04          1.4          system

ghtesting2020 avatar Jun 01 '22 11:06 ghtesting2020

I’ll try when 515 reach Silverblue

mirkobrombin avatar Jun 01 '22 12:06 mirkobrombin

I’ll try when 515 reach Silverblue

Wouldn't bottles be using the freedesktop nvidia 515 drivers in flatpak so it should not matter if Silverblue has or not? see:

related flatpak runtimes

gamescope                        com.valvesoftware.Steam.Utility.gamescope     3.11.28  stable       system
nvidia-515-43-04                 org.freedesktop.Platform.GL.nvidia-515-43-04           1.4          system
nvidia-515-43-04                 ?g.freedesktop.Platform.GL32.nvidia-515-43-04          1.4          system

ghtesting2020 avatar Jun 01 '22 13:06 ghtesting2020

Unfortunately not. The drivers themselves are built inside the kernel. Flatpak only provides the utilities to get them to work and talk to each other.

TheEvilSkeleton avatar Jun 01 '22 13:06 TheEvilSkeleton

Unfortunately not. The drivers themselves are built inside the kernel. Flatpak only provides the utilities to get them to work and talk to each other.

Thank you, today i learn something new

ghtesting2020 avatar Jun 01 '22 14:06 ghtesting2020

Arch received the latest Nvidia drivers and the issue is same there

nvidia-dkms 515.48.07-2
nvidia-prime 1.0-4
nvidia-settings 515.48.07-1
nvidia-utils 515.48.07-2
gamescope                        com.valvesoftware.Steam.Utility.gamescope     3.11.28  stable       system
nvidia-515-48-07                 org.freedesktop.Platform.GL.nvidia-515-48-07           1.4          system
nvidia-515-48-07                 ?g.freedesktop.Platform.GL32.nvidia-515-48-07          1.4          system

ghtesting2020 avatar Jun 06 '22 11:06 ghtesting2020

I've never used Fedora so I don't know about their speed. But how far behind are they usually? Ubuntu got the 515 drivers today and Ubuntu isn't know for speed of package deployment haha https://old.reddit.com/r/linux_gaming/comments/v643jm/nvidiagraphicsdrivers515_just_hit_the_repos_for/

ghtesting2020 avatar Jun 07 '22 22:06 ghtesting2020

@mirkobrombin Any update on Fedora Silverblue getting the latest Nvidia drivers? I am dying to use Gamescope!!!!!!!

ghtesting2020 avatar Jun 22 '22 23:06 ghtesting2020

Does gamescope work to begin with?

timocapa avatar Jun 26 '22 23:06 timocapa

Gamescope 3.11.28 did not have the necessary support for nvidia 515+ drivers. 3.11.32 has made its way into stable for flatpak and should bring the support needed iirc. Fedora 36 will receive 515 drivers soon.

gageberz avatar Jun 28 '22 21:06 gageberz

Gamescope 3.11.28 did not have the necessary support for nvidia 515+ drivers. 3.11.32 has made its way into stable for flatpak and should bring the support needed iirc. Fedora 36 will receive 515 drivers soon.

I have gamescope 3.11.32 now and I can hear the game launch and it no longer crashes with the error in the begin of ticket. However I cannot actually see the game hahahaha. When I open system activity with CTRL+Esc I can see the game running, and can see .exe listed but cannot alt+tab to it or anything. it is not on either of my monitors. I tried both fullscreen and borderless options. I have mangohud off in case it causes conflicts.

Any ideas on how to get it to actually display the game? I have never used gamescope before in my life.

I cannot see if there are any explicit errors printed or anything when running with terminal because bottles prints like 500 lines hahahahahah. I do see these in the begin of output

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
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: [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 0xa6491c687c0 (res 0xa64912e0350)
wlserver: [xwayland/server.c:250] Xserver is ready
pipewire: pw_context_connect failed
Warning: failed to setup PipeWire, screen capture won't be available
esync: up and running.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely

Name Application ID Version Branch Installation gamescope com.valvesoftware.Steam.Utility.gamescope 3.11.32 stable system

ghtesting2020 avatar Jul 01 '22 01:07 ghtesting2020

@mirkobrombin By the way, the 515.57 drivers are in "RPMFusion NonFree Updates Testing" repo They straight up skipped 515.48 Either way, it'll be pushed to "RPMFusion NonFree Updates" soon (which is stable for us), but you can get it now if you want by enabling the "RPMFusion NonFree Updates Testing" repo from GNOME Software and updating

VarLad avatar Jul 01 '22 17:07 VarLad

I can also reproduce the same problem

VarLad avatar Jul 01 '22 18:07 VarLad

I'll test when I get the update too

mirkobrombin avatar Jul 01 '22 20:07 mirkobrombin

Heads up, the update should be available to all Fedora/SilverBlue users now. I hope this issue can be reproduced and fixed

VarLad avatar Jul 10 '22 10:07 VarLad

I’m able to replicate

mirkobrombin avatar Jul 11 '22 14:07 mirkobrombin

Relevant issue found: https://github.com/Plagman/gamescope/issues/498

VarLad avatar Jul 15 '22 12:07 VarLad

I got the same error

mirkobrombin avatar Jul 15 '22 12:07 mirkobrombin

So is this an issue with Bottles or do we need to wait for fix in https://github.com/Plagman/gamescope/issues/498 or both?

ghtesting2020 avatar Jul 22 '22 18:07 ghtesting2020

They changed nothing on usage so we have nothing to fix. Should be a bug in gamescope end only

mirkobrombin avatar Jul 22 '22 19:07 mirkobrombin

They changed nothing on usage so we have nothing to fix. Should be a bug in gamescope end only

According to https://github.com/Plagman/gamescope/issues/560 all we need to do for Optimus laptops is set the --disable-layers flag for gamescope. Can you please let me know how i do this in Bottles?

ghtesting2020 avatar Jul 23 '22 15:07 ghtesting2020

disable gamescope in Bottles and use launch options to launch with gamescope

something like: gamescope --flags %command%

mirkobrombin avatar Jul 23 '22 15:07 mirkobrombin

disable gamescope in Bottles and use launch options to launch with gamescope

something like: gamescope --flags %command%

So I tried gamescope --disable-layers -w 1280 -h 720 -b -W 2626 -H 1440 %command% and I can see gamescope in kde system monitor but again no window is launched nor game.

ghtesting2020 avatar Jul 23 '22 15:07 ghtesting2020

Just like before I can hear the game and see gamescope running in KDE system monitor but cannot actually see any output from the game :(

ghtesting2020 avatar Jul 23 '22 17:07 ghtesting2020

A temporary solution according to https://github.com/flathub/com.valvesoftware.Steam.Utility.gamescope/issues/28#issuecomment-1201371439 would be to change the GBM_BACKENDS_PATH to the path of the nvidia driver, in the comment it is /usr/lib/x86_64-linux-gnu/GL/nvidia-515-57/extra/gbm but I assume it's different for flatpak

axtloss avatar Aug 01 '22 17:08 axtloss

Something like this?

flatpak run --env=GBM_BACKENDS_PATH=$(flatpak info --show-location org.freedesktop.Platform.GL.nvidia-515-57)/files/extra/gbm:$(flatpak info --show-location org.freedesktop.Platform.GL32.nvidia-515-57)/files/extra/gbm com.usebottles.bottles

Unfortunately, this doesn't seem to work, at least on my machine. I'm just getting this in the log:

wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -r" (2).
0068:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142
00ec:err:xrandr:xrandr14_get_adapters Failed to get adapters
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x56045c1feec0 (res 0x56045c25c010)
xwm: error 2: BadValue (integer parameter out of range for operation) request 137 minor 31 serial 561
xwm: error 2: BadValue (integer parameter out of range for operation) request 137 minor 31 serial 564
Error getting buffer
xwm: error 139: 139 request 137 minor 32 serial 582
xwm: error 139: 139 request 137 minor 32 serial 585
wlserver: [types/wlr_surface.c:741] New wlr_surface 0x56045c200870 (res 0x56045c25bcb0)
Error getting buffer

SuNNjek avatar Aug 02 '22 15:08 SuNNjek

Try using env vars inside the bottle preferences

mirkobrombin avatar Aug 02 '22 17:08 mirkobrombin

Try using env vars inside the bottle preferences

Ah, yeah, that makes sense :smile: That does indeed work

SuNNjek avatar Aug 02 '22 21:08 SuNNjek

Glad you had more luck than me haha

mirkobrombin avatar Aug 02 '22 21:08 mirkobrombin