[Nvidia] Black screen when HDR option is enabled
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
When I activate the HDR option, I see that nothing is displayed on my TV in terms of images (there is sound, I hear Steam starting up and I return to the desktop by the sound of the keys). To run Steam on my TV I use ChimeraOS/gamescope-session. I will describe what I see in some steps of reproducing the problem: 3. I see Steam on my TV. I see the TV showing that it is currently outputting HDR. I see a bar flashing at the bottom of my screen. 4. The entire image is terribly distorted, image fragments are mixed up, the screen flickers. 6. I don't see anything. The TV shows a black screen. There is no HDR on/off sign either. There is only sound.
Steps To Reproduce
- Specify in the
gamescope-session-plus.confparametrENABLE_GAMESCOPE_HDR=1; - Log out of the desktop session;
- Login to "Steam Big Picture" session;
- In Steam, go to display settings and enable HDR;
- Select "Exit" and "Go to Desktop" (maybe there are other names on steam, I use another language, sorry);
- Login to "Steam Big Picture" session;
Hardware information
- Distro: Fedora Linux 40 (Workstation Edition)
- CPU: AMD Ryzen™ 7 7800X3D
- GPU: NVIDIA GeForce RTX™ 4070 Ti
- Driver Version: 560.35.03
Software information
- Desktop environment: GNOME 46
- Session type: wayland
- Gamescope version: gamescope version 3.15.13 (gcc 14.2.1)
- Gamescope launch command(s): /usr/local/bin/gamescope -W 3840 -H 2160 --hdr-enabled --hdr-itm-enable --prefer-output HDMI-A-2 --xwayland-count 2 --default-touch-mode 4 --hide-cursor-delay 3000 --fade-out-duration 200 --steam -R /run/user/1000/gamescope.Mn36AFM/startup.socket -T /run/user/1000/gamescope.Mn36AFM/stats.pipe --prefer-vk-device 10de:2782
Which gamescope backends have the issue you are reporting?
- [ ] Wayland (default for nested gamescope)
- [X] DRM (default for embedded gamescope, i.e. gamescope-session)
- [ ] SDL
- [ ] OpenVR
Logging, screenshots, or anything else
Logs after entering a session after enabling HDR from the Steam settings
I have uploaded some videos to my drive with the appropriate titles so you can see what is going on.
Your logs show it failing to modeset for the resolution it's picking, which is probably when you get a black screen. The other part, that flickering, looks exactly like an issue I reported a few months ago https://forums.developer.nvidia.com/t/display-modes-above-2560x1440p-120hz-with-hdr-enabled-cause-flickering-corruption-within-gamescope-session/295314 but I did not create a dedicated issue here at the time.
Seems like maybe there's some NV issue with HDR over a certain resolution and refresh rate, but I don't think it ever got logged for an internal NV bug report.
This is my 4090 with gamescope's DRM backend (gamescope-session) at 7680x2160p@120hz with HDR enabled with the same issue you recorded
The first thing to check would be if the NVIDIA 565 release series behaves better.
already did, no change sadly https://forums.developer.nvidia.com/t/565-release-feedback-discussion/310777/16
@cubanismo sorry for the additional ping here but this seems like an issue you'd want to be aware of if there isn't an internal NV report filed already. here are some repro steps for this issue on upstream gamescope with DRM backend (without needing to install gamescope-session-plus):
Method One: Using the upstream Valve gamescope package from: https://steamdeck-packages.steamos.cloud/archlinux-mirror/sources/jupiter-main/?C=M&O=D
Prep: Launch Steam first with the following launch options, and log into your account if prompted: steam -steamdeck -steamos -steampal -gamepadui - this needs to be done to get around an issue where -steamos3 as a launch option will cause the OOBE to complain about network issues without extra services. using -steamos first and then subsequently using -steamos3, which Valve's gamescope-session script sets by default, works around this issue.
- download the latest .src.tar.gz for gamescope
- untar the folder and then use
makepkg -sito build and install (you may need a couple additional dependencies from the jupiter-main repo like Powerbuttond). using the built package forgamescopewould also work, but it will probably complain about differing dependencies at runtime since SteamOS uses older package versions - log out of your desktop session, and choose SteamOS (gamescope) from your display manager's splash screen
- once logged in, try going to Settings -> Display -> turn off "automatic resolution" -> choose your display's highest modeset
- From the right side menu in Steam: enable HDR with the toggle, and if it's already on, toggle it off and then on again
You should see the issue at this point.
Method Two: trying to repro without gamescope officially packaged by Valve. this method is a bit less reliable than the session, but it should still show the same issue
Prep: Same applies as above
- From a VT, launch gamescope with
gamescope -e --hdr-enabled --mangoapp -- steam -steamdeck -steamos3 -steampal -gamepadui - if it looks normal, shutdown with
gamescopectl shutdownfrom a separate terminal and then try to relaunch with the same parameters, but without--hdr-enabled - Repeat step 2, except add
--hdr-enabledback
You should (hopefully) see the issue at this point.
feel free to ping me with any questions, gamescope-session isn't the most well documented feature (although that's something I personally want to try and work on improving) and it can be a bit finnicky depending on setup. Method One is definitely my recommendation since the HDR toggle on the side menu will work without you needing to restart Steam/gamescope, although it's janky enough that I would only recommend it to devs
It's much rarer, but it seems like the Wayland backend also has the possibility to be affected by the same flickering, even when the WSI layer is disabled with ENABLE_GAMESCOPE_WSI=0 and HDR is not used.
I do have the argument to allow Nvidia colorspace in my KWin environment left over from Gamescope testing yesterday. The flickering went away when I alt-tabbed out of full screen Gamescope and started again once tabbing back in.
My specific launch command was gamescope -f -h 2160 -w 7680 -r 120 --adaptive-sync in Lutris and only started after entering and exiting the game (Star Citizen) a few times without quitting the launcher. Screenshots did not capture the flickering which makes me suspect maybe something at scanout?
this also happens when started in nested mode, artifacting disappears however when you hit the super/meta key to bring up the app menu in KDE Plasma 6.2.3
I'm seeing this issue as well, seems to repro much more reliably with --hdr-itm-enable as well.
Factorio launch command in Steam:
VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait DXVK_HDR=1 gamescope -W 3440 -H 1440 -r 60 -e -f --hdr-enabled --hdr-itm-enable --adaptive-sync --force-grab-cursor -- %command%
Escape from Tarkov Gamescope custom settings in Lutris:
-r 144 --hdr-enabled --hdr-itm-enable --hdr-itm-target-nits 1100 --hdr-itm-sdr-nits 200 --adaptive-sync --force-grab-cursor --mangoapp
Removing --hdr-itm-enable reliably fixes the corruption. Alternately rebooting seems to help and lets me play without corruption, though I typically play and then shut down afterwards so I haven't tried multiple game sessions.
Haven't had HDR issues in games that natively support it like Baldur's Gate 3, Forza Horizon 4, or Horizon Zero Dawn Remastered using:
VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait DXVK_HDR=1 gamescope -W 3440 -H 1440 -r 144 -e -f --hdr-enabled --adaptive-sync --force-grab-cursor -- %command%
Running latest CachyOS with 6.12.1 kernel, KDE Plasma 6.2.4, NVIDIA 565.57.01 drivers on a 7950X3D and RTX 3080. Plugged into an Acer Predator X35 with DisplayPort.
I'm seeing this as well. If hdr is enabled with --hdr-enabled with or without " --hdr-itm-enable --hdr-debug-force-support" I get either a blackscreen or sometimes no screen with a game that has hdr. FarCry5, CP2077, Horizon Zero Dawn Remaster and Ghost of Tsushima. If I disable the hdr options and envs, I can run them.
If I set ENABLE_HDR_WSI=0 I was able to launch HZD:R. I still can't play with HDR enabled in my little test as it is corrupt and crashes at the hdr calibrate menu though.
Nvidia 4080 (565.*) Plasma 6.2.4
Full command I am trying to use: "ENABLE_HDR_WSI=1 DXVK_HDR=1 DXVK_ENABLE_NVAPI=1 /usr/bin/gamescope --hdr-enabled --hdr-itm-enable --nested-refresh 75 --hide-cursor-delay 3000 --fade-out-duration 200 --hdr-debug-force-support -f -W 5120 -H 2160 -h 2160 -w 5120 -- %command%"
Can we re-title this thread to something like: "[NVIDIA] Black/flickering screen when HDR is toggled" to make this easier to track?
it's a bit more accurate of a title, given "The entire image is terribly distorted, image fragments are mixed up, the screen flickers." from the original report and follow up comments. A NVIDIA label would also be warranted, as this only happens under nvidia-drm
Also experiencing this issue. Happened when I tried to use HDR, although weirdly enough it's now happening with SDR now too.
#!/bin/bash
REFRESH_RATE=120
WIDTH=3840
HEIGHT=2160
exec gamescope --backend drm -W "$WIDTH" -w "$WIDTH" -H "$HEIGHT" -h "$HEIGHT" -r "$REFRESH_RATE" --framerate-limit "$REFRESH_RATE" -e -- steam -tenfoot -steamos3
- Nvidia 3080 with 565.77
- Fedora 41
- gamescope 3.15.15
@SmithAF does it still happen if you fully reboot your PC and try again with SDR? I've found that once it starts going wrong (flickering, black screen, etc.) your only option is to reboot and then try launching Gamescope again after the fresh reboot, even if only using SDR.
@matte-schwartz that seems to mostly work, although comes back again after starting up the session again without reboot. With SDR it's only roughly 5% of the screen at the bottom that gets corrupted, but with HDR it's like the images above. So likely this SDR issue I'm seeing is only tangentially related.
@SmithAF thanks for the confirmation on that. from my own testing, if you leave HDR enabled or leave HDR disabled, then it should mostly work correctly as long as you remain in a single gamescope-session. if you leave the session and re-enter, or if you touch the HDR toggle or resolution drop-down menu at all in the DRM backend, it sends you into the fun flickering fiesta until you fully reboot your PC.
I am no closer to figuring out why this happens however, or why it very rarely spreads to nested gamescope on Plasma 6 Wayland. drm_info doesn't change at all between these good and bad states, so I can only assume something is happening internally within nvidia-drm that causes this.
as an aside, @kisak-valve friendly ping on: https://github.com/ValveSoftware/gamescope/issues/1593#issuecomment-2550018899, NVIDIA bug label was something I discussed with @Plagman a few weeks ago. feel free to reach out if you want to discuss it further, thanks!
I've been getting this issue lately. Quite frustrating. With 3.16.11/2
LMAO, I found a HACK around fix. Basically make a plasma window rule to remove titlebar, and force fullscreen off..
Basically if you set the game window to not fullscreen the issue went away for me, or unfocused mode.
Others should give this a try. If I set window to FULLSCREEN again via plasma, it glitches out.
This visual corruption in Gamescope session appears to be resolved on the latest Bazzite builds that are including the 575.57.08 new feature branch drivers and with the current steam client as of writing this post.
I've gone through multiple reboots now and switching between desktop and gamescope session without this issue popping up at a resolution of 4K, HDR, and VRR enabled.
I'm not sure if this was resolved with the driver or with a recent update to the steam client.
Running that driver version here, still happens. At least there is a workaround for time being.
Still an issue with the 590 drivers. I can basically confirm all of the findings reported in this thread.
Cold boot -> fine until a res change or other display related changes (HDR e.g.). Switching to Desktop and then back to gamescope-session -> broken. Startung gamescope in a new tty -> broken.
The super weird thing that I don't understand is: why is it working fine on a cold boot?
Somehow this feels like it may be an initialization or timing problem of some sort..?
Only happens at 4k120 resolution for me and only on nvidia.
The super weird thing that I don't understand is: why is it working fine on a cold boot?
It's odd. But FYI the semi-workaround is to unload and reload the nvidia kernel modules after every gamescope session. (And yes unfortunately that implies that you have to stop gdm+desktop too, i.e. init 4 , making it only barely more convenient than a whole reboot.)
Last I heard NVIDIA was investigating this issue after reproducing it fwiw