Open Virkkunen opened 4 days ago
@Virkkunen
Try adding ENABLE_GAMESCOPE_WSI=1
to the launch options:
ENABLE_GAMESCOPE_WSI=1 ENABLE_HDR_WSI=1 DXVK_HDR=1 DISPLAY=:1 gamemoderun %command%
normally gamescope sets that environment variable automatically, in your case you have to set it yourself
Unfortunately that had no effect. I also tried with --hdr-debug-force-output
and nothing. It allows the game to enable HDR, but the information is not passed to my display.
With that env variable, the only relevant parts of the log I could find, related to HDR were these:
xdg_backend: PreferredMetadata: Red: 0.708 0.292, Green: 0.17 0.797, Blue: 0.131 0.046, White: 0.3127 0.329, Max Luminance: 1015 nits, Min Luminance: 0 nits, Max Full Frame Luminance: 351 nits
josh edid: Patching res 800x1280 -> 3840x2160
pipewire: renegotiating stream params (size: 3840x2160)
[Gamescope WSI] Forcing on VK_EXT_swapchain_maintenance1.
When I set the parameters as gamescope -W 3840 -H 2160 -r 165 --hdr-enabled --hdr-itm-enable --hdr-itm-sdr-nits 300 --hdr-sdr-content-nits 300 -f -e --mangoapp -- gamemoderun %command%
, whenever I toggle HDR in my game I get this:
[Gamescope WSI] Creating swapchain for xid: 0x1400081 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x1400081 - imageCount: 3
[Gamescope WSI] Creating swapchain for xid: 0x1400081 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_HDR10_ST2084_EXT - flip: true
[Gamescope WSI] Created swapchain for xid: 0x1400081 - imageCount: 3
With VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
when it's off and VK_COLOR_SPACE_HDR10_ST2084_EXT
when it's on. The problem is that the second method (creating a gamescope window on a tty and attaching the game to it) cannot properly create a gamescope surface and pass its info to my display, it seems. I'd expect to find logs like
[Gamescope WSI] Made gamescope surface for xid: 0x1400081
[Gamescope WSI] Surface state:
steam app id: 1778820
window xid: 0x1400081
wayland surface res id: 5
layer client flags: 0x4
server hdr output enabled: true
hdr formats exposed to client: true
but cannot find anything this way.
You need GAMESCOPE_WAYLAND_DISPLAY to be set to the right gamescope display, you need DXVK_HDR=1, you need ENABLE_GAMESCOPE_WSI=1.
Really you should probably just launch the game with Gamescope. The overlay thing is a sore point right now, but hopefully I can look into it soon by changing how the LD_PRELOAD stuff works there.
I also should probably add a gamescopectl command to launch inside gamescope, or a command for Gamescope to launch inside the existing gamescope if it can.
You need GAMESCOPE_WAYLAND_DISPLAY to be set to the right gamescope display
You mean by having GAMESCOPE_WAYLAND_DISPLAY=:1
instead of just DISPLAY=:1
on my launch parameters? I tried doing that but unfortunately it's the same result, no actual HDR.
I wanted to run this workaround because if not, then both the overlay and input won't work, mostly because of the Steam input to be fair (and now game recording since it's quite convenient), but I understand there's some quirks to be worked out yet, it's all fair.
The overlay thing is a sore point right now, but hopefully I can look into it soon by changing how the LD_PRELOAD stuff works there.
I have noticed a lot of ERROR: ld.so: object '/home/vrkknn/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
whenever I run gamescope; I'd love to be able to help troubleshooting this one, but I know it's another ticket/issue.
Gamescope waylabd display is like gamescope-0
.
The elf32 thing is a red berring meaningless warning
I still haven't had any luck with that. I've checked and my gamescope creates a gamescope-0
and :1
window, so I tried:
DISPLAY=gamescope-0
will open the game but HDR is still not truly on. GAMESCOPE_WAYLAND_DISPLAY=gamescope-0
won't open the gameGAMESCOPE_WAYLAND_DISPLAY=gamescope-0 DISPLAY=:1
, but I'll get a Gamescope WSI Layer Error pop up, and then a Fatal Error popup before the game closes and the window crashes.Honestly I couldn't find anything different on the logs too. Maybe it's better if I just wait for one of the fixes or workarounds you've mentioned whenever possible.
My system info:
nvidia-dkms
555.58-2egl-wayland
2:1.1.13-2gamescope
version 3.14.22-5-gb44ea3cnvidia nvidia_drm.modeset=1 nvidia_drm.fbdev=1 nvidia_uvm nvidia.NVreg_PreserveVideoMemoryAllocations=1
Title can be a bit confusing, but here's the situation:
When I run a HDR capable game with the following launch options:
I'm able to have HDR working without issues. The logs show the following:
As you can see, the HDR info is being properly passed on to my display/compositor. The following pictures were taken with
ISO 100 23mm F1.8 1/20s WB 6000K
(the pictures might not look good but trust me, HDR is on and working perfectly here)Also note that mangohud displays
HDR: ON
The problem with running games this way is that both Steam Overlay and Steam Input do not work at all. A workaround is to create a gamescope window on a separate terminal, and connect the game to that display. So I run this on a terminal, to create my gamescope window:
This creates gamescope as display :1, so on my game launch options I use:
However, HDR does not work this way. Logs only show:
And I'm unable to enable HDR on the game's settings. There is a workaround for this, which is to manually set some env flags for both the window and gamescope:
And the launch parameters
This way, I'm able to enable HDR on my game, but it seems that it's just forcing HDR to be enabled without passing the correct information to my display, as shown by the logs and the pictures (taken with the same configuration as the previous ones). Mangohud/mangoapp also do not display the HDR status, probably because it isn't actually working:
Let me know if I'm missing any logs or info that could be useful (and how to take them)