this post was submitted on 17 Mar 2024
57 points (96.7% liked)

Linux Gaming

15350 readers
1 users here now

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

Resources

WWW:

Discord:

IRC:

Matrix:

Telegram:

founded 1 year ago
MODERATORS
57
submitted 8 months ago* (last edited 8 months ago) by million to c/linux_gaming
 

As the title asks, how does one actually use HDR for games after upgrading to Plasma 6?

This was the feature I was most excited about, and I can hit the HDR button on my display configuration and it looks like the desktop is going into HDR mode, but so far I have had zero luck enabling the HDR feature in games. Every game I've tried had the HDR toggle disabled with no way to enable it.

I am running these games under Proton and I've tried both 8-GE and 9 Beta. Any tips?

Edit: probably important to note that I am using an AMD GPU under Wayland

all 22 comments
sorted by: hot top controversial new old
[–] thadah 31 points 8 months ago (5 children)

Hi! To enable HDR in most games you will need to set your game in fullscreen. Windowed or Borderless won't allow you to use HDR functionality.

You'll also need to use the DXVK_HDR=1 %command% startup variable in steam to enable HDR in any Proton game. Proton 8 and 9 should support HDR without issuez although there are some games that might need additional configuration.

If you use an NVIDIA card, you might need to enable NVAPI with DXVK_ENABLE_NVAPI=1

Happy gaming! :D

[–] Hominine 3 points 8 months ago

Excellent, thanks for this!

[–] [email protected] 3 points 8 months ago (1 children)

This only lets you enable hdr in game. Since proton runs under xwayland the hdr info won't reach the compositor.

[–] million 2 points 8 months ago (2 children)

Oh really? That sucks, how do you work around that?

[–] [email protected] 9 points 8 months ago

Use Gamescope and a Vulkan layer. Here's a more detailed post: https://planet.kde.org/xavers-blog-2023-12-18-an-update-on-hdr-and-color-management-in-kwin/

If you get the latest gamescope from git. You no longer need the vulkan layer.

[–] [email protected] 2 points 8 months ago (1 children)

Gamescope supports hdr with --hdr-enabled --hdr-debug-force-output flags and running the game under it doesn't require xwayland in my understanding. It doesn't support nvidia though

[–] million 1 points 8 months ago (1 children)

So what is the benefit of KDE's HDR support at that? Could you do something similar under Gnome and get HDR support in games?

[–] [email protected] 2 points 8 months ago

If gnome supports hdr too you can. Kde's support is a part of the stack that needs to support hdr for it to work. The programs and drivers can speak hdr all they want but if the compositor (kde) doesn't understand and relay the info to the monitor it won't work.

[–] BoiLudens 1 points 8 months ago

Well I was wondering this whole time how that works! Thanks a ton!

[–] million 1 points 8 months ago* (last edited 8 months ago)

Nice, this appears to allow me to enable HDR at least in Resident Evil 8.

Is there a distinct command if the game is native Vulkan versus using the Direct3d to Vulkan layer?

Edit: Lojcs is saying this only allows you to enable it but it isn't actually working, https://a.lemmy.world/lemmy.world/comment/8535260

[–] [email protected] 10 points 8 months ago (2 children)

To play Proton games you only need the latest gamescope from git, the HDR layer and environment variables are no longer needed for gamescope

Just set the launch arguments on Steam for any game to: gamescope --hdr-enabled --nested-refresh 165 --fullscreen --steam -w 3440 -W 3440 -h 1440 -H 1440 -- %command%.

Don't forget to set your refresh rate and resolution.

If you want to play videos files in HDR (YouTube also works) you need to use mpv together with the HDR layer.

After installing the layer you can run mpv like this: ENABLE_HDR_WSI=1 mpv --vo=gpu-next --target-colorspace-hint --gpu-api=vulkan --gpu-context=waylandvk "https://www.youtube.com/watch?v=dQw4w9WgXcQ".

[–] million 4 points 8 months ago (2 children)

Thanks, appreciate the write up. Definitely sounds like HDR under Linux has a long way to go to reach the "just works" level.

I asked this in another thread but I would be curious to get different perspectives; could you use gamescope and mpv under Gnome and get HDR support or is KDE's HDR support essential here?

[–] [email protected] 5 points 8 months ago (1 children)

Thanks, appreciate the write up. Definitely sounds like HDR under Linux has a long way to go to reach the "just works" level.

It's not as long as you might think, by the end of the year we should have out of the box HDR on Linux. At least for Proton games. All the puzzle pieces are there, they just need to be put in place.

could you use gamescope and mpv under Gnome and get HDR support or is KDE's HDR support essential here?

No, not until GNOME implements their HDR support. You can however run gamescope and mpv directly in tty instead of KDE/GNOME.

[–] million 2 points 8 months ago

Fingers crossed on the out of the box support.

Thanks again for the knowledge.

[–] [email protected] 3 points 8 months ago

On the Steam Deck it already "just works" for a lot of games (with an OLED or an external display). So we're not that far off for those changes propagating to Desktop.

[–] million 1 points 8 months ago (1 children)

I finally got a chance to try this out and couldn't get it to work then I realized you mentioned this was git only right now, and I am all Flatpak'd up, so I need to wait.

What is the specific commit that adds the magic since the last release?

[–] [email protected] 2 points 8 months ago (1 children)

Not sure, probably somewhere around when the new Wayland backend was introduced: https://github.com/ValveSoftware/gamescope/commit/9563271dea5ee4844b16a7e179e9f6bc7ed51168

I also normally run in Flatpak but I switched to native until everything settles in. Turns out the config files are compatible now so you can run either and they will pick up the others config with no issue. Just have to watch out with shader pre-compilation because if you have different Mesa versions the clients will pre-compile back and forth all the time.

[–] million 1 points 8 months ago

I could compile my own flatpak locally I suppose but I imagine they will do a release soon

[–] [email protected] 6 points 8 months ago* (last edited 8 months ago)

I haven't tested it myself, but you'll need to install gamescope and the Vulkan HDR layer, then set the launch options to use it.

Of course, you'll also need a monitor that supports it, and a cable that supports it as well (I recommend using a DisplayPort 1.4+ cable).

Edit: Here's a detailed how-to: https://zamundaaa.github.io/wayland/2023/12/18/update-on-hdr-and-colormanagement-in-plasma.html

[–] million 5 points 8 months ago (1 children)

To add to this, I was doing some testing since this is on my mind and I am also unable to get HDR working on Youtube under either Firefox or Chromium.

This may be orthogonal to running games or it could be related.

[–] [email protected] 3 points 8 months ago

That might be more due to them not supporting HDR on Linux yet, but I'll wait for someone else to confirm that