ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3k stars 198 forks source link

HDR tonemapping doesn't work on Nvidia #776

Open DisplayTalk opened 1 year ago

DisplayTalk commented 1 year ago

An HDR game run from Lutris with the command prefix: gamescope --hdr-debug-force-support -w 1920 -h 1440 -W 1920 -H 1440 -f on an RTX 3080 with the Nvidia driver results in HDR still being greyed out in the game. Gamescope runs fine but it's as if the HDR command wasn't used. DXVK and VKD3D at latest 2.1 and 2.8 versions, using wine-ge-lutris 7-36.

Expected behavior is that HDR will be recognized by the game and tonemapped to SDR by gamescope.

Joshua-Ashton commented 1 year ago

You need to enable the gamescope WSI layer (ENABLE_GAMESCOPE_WSI=1).

I don't think NV implement EXT_swapchain_colorspace either yet.

DisplayTalk commented 1 year ago

Thanks for the reply. Would I put that ENABLE_GAMESCOPE_WSI=1 as an environment variable in Lutris, or what?

Edit: guess not, because that didn't enable it. I'll wait for your reply. Is this confirmed not to work on Nvidia, or just unknown?

rialpa84 commented 1 year ago

Launch Gamescope with that environment variable in a separate TTY (ctrl+alt+F#) or create an entry for a login manager like SDDM and log into a Gamescope session. This is an approximation of what I use to launch a Steam session in HDR on my 4K TV with Gamescope.

ENABLE_GAMESCOPE_WSI=1 gamescope -W 3840 -H 2160 -e --default-touch-mode 4 --force-windows-fullscreen --xwayland-count 2 --hdr-enabled --hdr-itm-enable --hdr-wide-gammut-for-sdr --hdr-itm-sdr-nits 200 --hdr-sdr-content-nits 500 --hdr-itm-target-nits 800 -- steam-native -gamepadui -steamos3 -steampal -steamdeck

Note that those are all the non-default values I'm using to dial it in to my TV and they still need a bit of fine tuning. Defaults: sdr-nits is 100, content-nits is 400, target-nits is 1000.

You also need to set DXVK_HDR=1 as well. You can do that from Lutris or by puting it next to ENABLE_GAMESCOPE_WSI=1.

What game are you trying? This doesn't work for every game....yet. I've had success with FFVII Remake (50+ hours), Death Stranding, and Portal RTX and no success with Hitman 2, Callisto Protocol, Resident Evil 2, Resident Evil 3, or Tony Hawk's Pro Skater 1+2.

DisplayTalk commented 1 year ago

So wait, the HDR tonemapping won't work nested in xorg? I don't know how to run a gamescope session other than with the steam deck interface(gamescope-session package). To clarify I am not trying to output HDR, just tonemap it to SDR. Game is Elden Ring.

Joshua-Ashton commented 1 year ago

It does work, must not on NVIDIA rn

DisplayTalk commented 1 year ago

So it does work nested in xorg on amd, should have worked with ENABLE_GAMESCOPE_WSI=1 as a lutris environment variable, but didn't because nvidia drivers lack a feature needed for it to work(EXT_swapchain_colorspace?)? Or did I not test thoroughly enough?

LethalManBoob commented 1 year ago

bump

Joshua-Ashton commented 1 year ago

Bumping here is not going to help, it needs work on the NV driver on the VK and DRM side.

kodatarule commented 1 year ago

As Joshua mentioned, currently Nvidia doesn't seem to support HDR at all, I did open a discussion on their forums which didn't caught much attention. Side note: I also opened a bug report for the mouse cursor which seems tied to HW mouse cursor support which again NV driver doesn't support and that thread also didn't get much attention.

https://forums.developer.nvidia.com/t/hdr-wayland-support/259193

https://forums.developer.nvidia.com/t/gamescope-mouse-cursor-is-sliced-in-the-middle/238568