[Nvidia] HDR not working for vk3d/dx12 games
Is there an existing issue for this?
- [X] I have searched the existing issues
Are you using any gamescope patches or a forked version of gamescope?
- [X] The issue occurs on upstream gamescope without any modifications
Current Behavior
HDR working fine on dx11/dxvk titles but when I try to turn on hdr on dx12/vk3d titles the display goes black, i can hear the sound everything but there is no display to the game.
And i get these error log spammed, tried The First Descendant and Warframe dx12
[Gamescope WSI] Refusing to make swapchain (unsupported VkFormat) for xid: 0x2600030 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Creating swapchain for xid: 0x2600030 - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Refusing to make swapchain (unsupported VkFormat) for xid: 0x2600030 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Creating swapchain for xid: 0x2600030 - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Refusing to make swapchain (unsupported VkFormat) for xid: 0x2600030 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Creating swapchain for xid: 0x2600030 - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
Steps To Reproduce
- Launch the game with
GBM_BACKEND=nvidia-drm gamescope -w 2560 -h 1440 -f -r 165 --adaptive-sync --hdr-enabled -- %command% - Goes in settings select HDR On, (tested on The First Descendant and Warframe dx12)
- Screen goes black, but sound is on, so game is running. but no display.
Hardware information
- Distro: CachyOS
- CPU: 12th Gen Intel(R) Core(TM) i7-12800H
- GPU:
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] [8086:46a6] (rev 0c)
01:00.0 3D controller [0302]: NVIDIA Corporation GA107GLM [RTX A1000 Laptop GPU] [10de:25b9] (rev a1)
- Driver Version: 565.77 (Nvidia)
Software information
- Desktop environment: KDE 6.2.5
- Session type: Wayland
- Gamescope version: 3.16.1-4-gf873ec78 (gcc 14.2.1)
- Gamescope launch command(s): `DXVK_HDR=1 GBM_BACKEND=nvidia-drm gamescope -w 2560 -h 1440 -f -e -r 165 --force-grab-cursor --adaptive-sync --hdr-enabled --hdr-debug-force-output -- game-performance %command%`
Which gamescope backends have the issue you are reporting?
- [X] Wayland (default for nested gamescope)
- [ ] DRM (default for embedded gamescope, i.e. gamescope-session)
- [ ] SDL
- [ ] OpenVR
Logging, screenshots, or anything else
just to confirm, does setting VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait change anything?
just to confirm, does setting
VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_waitchange anything?
Tried with that, still same problem, the game audio is working, it just not displaying maybe cause HDR10 is not being supported or something, but dxvk_hdr and MPV with hdr working fine. So i dont know what's the issue exactly.
Okay, thanks for checking. One more thing - could you upload a full Gamescope log from launch? Can just be a .txt or .log or whatever attached.
Okay, thanks for checking. One more thing - could you upload a full Gamescope log from launch? Can just be a .txt or .log or whatever attached.
Here you go, wraframe-hdr-log.txt
vulkan: selecting physical device 'Intel(R) Iris(R) Xe Graphics (ADL GT2)': queue family 0 (general queue family 0)
it looks like it's using your intel iGPU to composite so GBM_BACKEND=nvidia-drm probably isn't doing anything. have you tried --prefer-vk-device and choosing your NVIDIA GPU? I think--prefer-vk-device 10de:25b9 would be the gamescope argument you want.
vulkan: selecting physical device 'Intel(R) Iris(R) Xe Graphics (ADL GT2)': queue family 0 (general queue family 0)it looks like it's using your intel iGPU to composite so
GBM_BACKEND=nvidia-drmprobably isn't doing anything. have you tried--prefer-vk-deviceand choosing your NVIDIA GPU? I think--prefer-vk-device 10de:25b9would be the gamescope argument you want.
Oh you are actually right i didn't notice that, I used GBM_BACKEND=nvidia-drm cause this fixed the issue for me with the gamescope not running
@matte-schwartz I have noticed something thanks to you, so if
vulkan: selecting physical device 'Intel(R) Iris(R) Xe Graphics (ADL GT2)': queue family 0 (general queue family 0)
Gamescope select this and inside application is render in Nvidia it works
╰─❯ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json gamescope -- vkcube
[gamescope] [Info] console: gamescope version 3.16.1-4-gf873ec78 (gcc 14.2.1)
Tracing is enabled
[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/valve.steamdeck.lcd.lua' (id: 5)
[gamescope] [Info] scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 6)
[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/syntist/.config/gamescope/scripts'
[gamescope] [Warn] scriptmgr: Directory '/home/syntist/.config/gamescope/scripts' does not exist
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info] vulkan: selecting physical device 'Intel(R) Iris(R) Xe Graphics (ADL GT2)': queue family 0 (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] 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: AB48 (0x38344241)
[gamescope] [Info] vulkan: XB48 (0x38344258)
[gamescope] [Info] vulkan: AB30 (0x30334241)
[gamescope] [Info] vulkan: AR30 (0x30335241)
[gamescope] [Info] vulkan: XR30 (0x30335258)
[gamescope] [Info] wlserver: Using explicit sync when available
[gamescope] [Info] wlserver: Running compositor on wayland display 'gamescope-0'
[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 :1
[gamescope] [Info] pipewire: stream state changed: connecting
[gamescope] [Info] pipewire: stream state changed: paused
[gamescope] [Info] pipewire: stream available on node ID: 129
[gamescope] [Info] xwm: Embedded, no cursor set. Using left_ptr by default.
[gamescope] [Info] vblank: Using timerfd.
[gamescope] [Info] xdg_backend: PreferredMetadata: Red: 0.64 0.33, Green: 0.3 0.6, Blue: 0.15 0.06, White: 0.3127 0.329, Max Luminance: 200 nits, Min Luminance: 0.05 nits, Max Full Frame Luminance: 200 nits
[gamescope] [Info] edid: Patching res 800x1280 -> 1280x720
Selected WSI platform: xcb
[Gamescope WSI] Application info:
pApplicationName: vkcube
applicationVersion: 0
pEngineName: vkcube
engineVersion: 0
apiVersion: 4194304
[Gamescope WSI] Executable name: vkcube
[Gamescope WSI] Creating Gamescope surface: xid: 0x600000
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
[gamescope] [Warn] xwm: got the same buffer committed twice, ignoring.
[Gamescope WSI] Made gamescope surface for xid: 0x600000
[Gamescope WSI] Surface state:
steam app id: 0
window xid: 0x600000
wayland surface res id: 5
layer client flags: 0x0
server hdr output enabled: false
hdr formats exposed to client: false
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning: Unsupported maximum keycode 708, clipping.
> X11 cannot support keycodes above 255.
> Warning: Could not resolve keysym XF86KbdInputAssistPrevgrou
> Warning: Could not resolve keysym XF86KbdInputAssistNextgrou
Errors from xkbcomp are not fatal to the X server
Selected GPU 0: NVIDIA RTX A1000 Laptop GPU, type: DiscreteGpu
[Gamescope WSI] Forcing on VK_EXT_swapchain_maintenance1.
[gamescope] [Info] xdg_backend: Changed refresh to: 165.000hz
[Gamescope WSI] Creating swapchain for xid: 0x600000 - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x600000 swapchain: 0x5585746697c0 - imageCount: 3
[Gamescope WSI] Swapchain recieved new refresh cycle: 6.06ms
^C[gamescopereaper] [Info] reaper: Parent of gamescopereaper was killed. Killing children.
[gamescope] [Info] launch: Primary child shut down!
But if gamescope try to use [gamescope] [Info] vulkan: selecting physical device 'NVIDIA RTX A1000 Laptop GPU': queue family 2 (general queue family 0)
╰─❯ gamescope --prefer-vk-device 10de:25b9 -- vkcube
[gamescope] [Info] console: gamescope version 3.16.1-4-gf873ec78 (gcc 14.2.1)
Tracing is enabled
[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/valve.steamdeck.lcd.lua' (id: 5)
[gamescope] [Info] scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 6)
[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/syntist/.config/gamescope/scripts'
[gamescope] [Warn] scriptmgr: Directory '/home/syntist/.config/gamescope/scripts' does not exist
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info] vulkan: selecting physical device 'NVIDIA RTX A1000 Laptop GPU': 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] [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: AR30 (0x30335241)
[gamescope] [Info] vulkan: XR30 (0x30335258)
gamescope: ../src/rendervulkan.cpp:2139: 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.size() > 0' failed.
fish: Job 1, 'gamescope --prefer-vk-device 10…' terminated by signal SIGABRT (Abort)
It crashes, maybe this can help you drill down the issue. Now i know why i was having performance issue on overwatch 2, cause I was using intel for compositor and nvidia for game, probably.
Edit: Updated the format, to be more readable.
when you use your NVIDIA dGPU, it looks like you run into the exact same rendervulkan error as https://github.com/ValveSoftware/gamescope/issues/1590 which tracks since they also have an iGPU and report that using the iGPU for gamescope does at least launch it. I don't really have any further advice to give at this point until I get back home and dig up my own NVIDIA laptop to see if I can poke at this at all.
when you use your NVIDIA dGPU, it looks like you run into the exact same rendervulkan error as #1590 which tracks since they also have an iGPU and report that using the iGPU for gamescope does at least launch it. I don't really have any further advice to give at this point until I get back home and dig up my own NVIDIA laptop to see if I can poke at this at all.
Appreciated, Let me know if you need me to test anything, I was gonna make another issue, regarding preformance regression, but I guess now i know the reason why that might be happening, as the compositor is using igpu, which can create more overhead
https://imgur.com/a/low-fps-using-gamescope-3Mr9vCI
As you can see here, same screen losing around 10-15fps on gamescope.
Any update regarding this issue?
No, I'm away on vacation and working on Gamescope is not a job for me, so you may need to temper your expectations a bit. Thanks.