Skip to content

Setting this environment variable VK_ICD_FILENAMES breaks gamescope #1

@Tweakkinn

Description

@Tweakkinn

I finally got gamescope working after a lot of trail and error this env variable was the culprit

VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.json

Initially I thought it broke gamescope because radeon_icd.json isn't the correct file name it is radeon_icd.x86_64.json for my system

❯ ls /usr/share/vulkan/icd.d/
.rw-r--r-- 140 root 24 Mar 08:29  nvidia_icd.json
.rw-r--r-- 179 root  6 Apr 03:36  radeon_icd.i686.json
.rw-r--r-- 177 root  6 Apr 03:29  radeon_icd.x86_64.json

but after fixing it gamescope would still fail to launch

gamescope log
>WAYLAND_CLIENT=debug gpu-prime gamescope -- vkcube --wsi xcb
[gamescope] [Info]  console: gamescope version 3.16.20+ (gcc 15.2.1)
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/common'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/inspect.lua' (id: 0)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/modegen.lua' (id: 1)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/util.lua' (id: 2)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/displays'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/asus.rogally.lcd.lua' (id: 3)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/deckhd.steamdeck.deckhd-lcd.lua' (id: 4)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/gpd.win4.lcd.lua' (id: 5)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongo.lcd.lua' (id: 6)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongos.lcd.lua' (id: 7)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/onexplayer.f1.oled.lua' (id: 8)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.lcd.lua' (id: 9)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 10)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/zotac.zone.oled.lua' (id: 11)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/etc/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/etc/gamescope/scripts' does not exist
[gamescope] [Info]  scriptmgr: Loading scripts from: '/home/tweak/.config/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/home/tweak/.config/gamescope/scripts' does not exist
[gamescope] [Info]  vulkan: selecting physical device 'NVIDIA GeForce RTX 5070 Ti': 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: seat0
[gamescope] [Info]  xdg_backend: Initted Wayland backend
[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:   NV12 (0x3231564E)
[gamescope] [Info]  vulkan:   AB4H (0x48344241)
[gamescope] [Info]  vulkan:   XB4H (0x48344258)
[gamescope] [Info]  vulkan:   AB30 (0x30334241)
[gamescope] [Info]  vulkan:   XB30 (0x30334258)
[gamescope] [Info]  vulkan:   AR30 (0x30335241)
[gamescope] [Info]  vulkan:   XR30 (0x30335258)
[gamescope] [Info]  wlserver: Using explicit sync when available
[gamescope] [Info]  wlserver: [wayland] unable to lock lockfile /run/user/1000/gamescope-0.lock, maybe another compositor is running
[gamescope] [Info]  wlserver: Running compositor on wayland display 'gamescope-1'
[gamescope] [Info]  wlserver: [backend/headless/backend.c:17] Starting headless backend
[gamescope] [Info]  wlserver: Successfully initialized libei for input emulation!
[gamescope] [Info]  wlserver: [xwayland/server.c:107] Starting Xwayland on :2
The XKEYBOARD keymap compiler (xkbcomp) reports:
Warning:          Multiple symbols for level 1/group 1 on key <FK23>
                  Using F23, ignoring XF86TouchpadOff
Warning:          Symbol map for key <FK23> redefined
                  Using last definition for conflicting fields
Warning:          Symbol map for key <FK24> redefined
                   Using last definition for conflicting fields
Errors from xkbcomp are not fatal to the X server
[gamescope] [Info]  pipewire: stream state changed: connecting
[gamescope] [Info]  pipewire: stream state changed: paused
[gamescope] [Info]  pipewire: stream available on node ID: 80
(EE) failed to read Wayland events: Broken pipe
/usr/bin/gpu-prime: line 20: 15763 Aborted                    (core dumped) __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia LIBVA_DRIVER_NAME=nvidia __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json "$@"`

I removed that variable from being set and used prime-run instead of gpu-prime to launch steam now it works flawlessly! I got gamescope running with mangohud and HDR working correctly.

My current launch options

gamescope --hdr-enabled --force-grab-cursor -W 2560 -H 1440 -f -r 480 --mangoapp -- env PROTON_VKREFLEX=1 PROTON_DLSS_UPGRADE=1 PROTON_USE_NTSYNC=1 PROTON_VKD3D_HEAP=1 DXVK_NVAPI_DRS_NGX_DLSS_FG_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_b prime-run game-performance %command% --useallavailablecores

to get gamescope with mangohud and HDR you only need

gamescope --hdr-enabled -W 2560 -H 1440 -f -r 480 --mangoapp -- env prime-run %command%
Image

Image

I have found that I need to manually set this env variable for each app I don't want interfering with launching my VM or it will fail to unload the NVIDIA driver. You can also just close the app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions