Bug 500258

Summary: When using DSC, 4K 144Hz screen does not display content after being turned off and back on again until switching VTs
Product: [Plasma] kwin Reporter: Arnaudb <abarisain>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: abarisain, akselmo, justin.slay, nate, xaver.hugl
Priority: NOR Keywords: wayland-only
Version First Reported In: 6.3.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: drm debug logs with vt switch
drm debug logs without vt switch
partial kwin logs while switching

Description Arnaudb 2025-02-17 13:20:33 UTC
SUMMARY

I have a 4k 144hz screen (LG 27GR95UM-B) hooked up to a NVidia 4080. I run KDE using wayland and Nvidia's 570 drivers. The screen supports VRR and uses DSC (display stream compression) to achieve more than 4k 120hz.
DSC is important here as I've experienced a lot of bugs both on Windows & Linux because of it, and I believe it's the culprit here.

My problem is that when I turn the display off and back on, be it immediatly or after a long time, the output stays black. The session doesn't crash or anything, it just doesn't render and the screen doesn't see any signal.

The only reliable way to get it back is to switch to another graphical desktop (Ctrl Alt F2 on my current install, which is SDDM's Xorg session), wait for the cursor to come up and then Ctrl Alt F1 back to KDE. It then comes back immediatly. 
Switching to a TTY then does NOT work, only switching to one _before_ I turn the screen off does. Once I run into the bug, only the other graphical session will do the trick.

This works as expected when using Gnome, X11 KDE or when I'm on a TTY (DSC might be off on a TTY though).

WORKAROUND

Turning DCC or VRR off doesn't do anything. However, I noticed that going to a lower resolution or refresh rate fixes the issue, which led me to Display stream compression. Disabling DSC on the monitor fixes the issue (while limiting me to 4k120).

STEPS TO REPRODUCE
1. Get a KDE Install, Wayland + Nvidia (open/closed driver does not matter) and a screen using DSC (8k@60 or 4k@144)
2. Turn the screen off, wait until the "unplug" sound
3. Turn the screen back on

OBSERVED RESULT

The screen is black

EXPECTED RESULT

The screen should show what I left it on (desktop or lockscreen)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.13.2-arch1 (latest archlinux)
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION

I also reproduce this on Fedora 41: I couldn't test X11 there as they disabled X on the plasma spin.

I can't find anything of use in journalctl or dmesg: it's the same logs whether I have DSC on or off. I'd gladly give more logs if someone has something they want me to try/some place to look/some verbose logs to enable.

This has been happening for a while now, I'm not even sure when it started but it was there on plasma 6.2 too.

Sorry if this is a duplicate. The bug looks like some reports I've seen on forums or here, but it's always a bit different.
The closest I could find is https://bugs.kde.org/show_bug.cgi?id=453557 but I run a single screen setup.
I also found threads about Samsung screens, so I tried to disable the brightness management/etc and it didn't change anything.


Thanks for your time,
Arnaud
Comment 1 Akseli Lahtinen 2025-02-18 13:12:07 UTC
I have had similar problem with my screen LC34G55TWWPXEN, however it only has happened in regular Fedora Plasma session. It does not happen in the developer session. I will have to test this again to see if it happens for me in regular session before I can confirm this.

Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.12.13-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Comment 2 Justin Slay 2025-02-20 10:05:58 UTC
I have had this issue for a while now (~1 year). 

Disabling DSC did not resolve the issue for me. Not only, I have been running at 4k@120hz the entire time the issue has presented itself. This is on a single monitor PG48UQ setup. When the monitor comes back on, I will hear the device connected sound, then disconnected sound shortly thereafter. This repeats indefinitely until I switch virtual terminals and back. I can also repro this just by unplugging the HDMI cable from the GPU, and plugging it back in. I have had this issue since at least KDE 6.0, maybe even before it, but I can't remember exactly.

Also having issues with SDDM crashing on the NVidia 570 driver, but I believe this is unrelated as it has only just started with the new driver. This just exacerbates the issue because when I would usually switch virtual desktops and back to get a picture/signal back, it now crashes SDDM and I lose my session. Using GDM, this particular issue does not occur. 

Arch/KDE 6.3 13900K with NVidia 4090 570.86.16 DKMS with kernel 6.13.2/6.13.3. 

Interestingly enough, KDE "About this system" shows that both my GPUs are my 4090, when that is incorrect. GPU 1 should be the i915 integrated graphics from the Intel chip, even though it is unused and no device plugged into the motherboard outputs. 

Operating System: Arch Linux
KDE Plasma Version: 6.3.1
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.3-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × 13th Gen Intel® Core™ i9-13900K
Memory: 62.6 GiB of RAM
Graphics Processor 1: NVIDIA GeForce RTX 4090/PCIe/SSE2
Graphics Processor 2: NVIDIA GeForce RTX 4090/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: Z790 AORUS MASTER
System Version: -CF


$ inxi -G
Graphics:
  Device-1: Intel Raptor Lake-S GT1 [UHD Graphics 770] driver: i915 v: kernel
  Device-2: NVIDIA AD102 [GeForce RTX 4090] driver: nvidia v: 570.86.16
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.5
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia dri: iris
    gpu: nvidia,nvidia-nvswitch resolution: 3840x2160~120Hz
  API: EGL v: 1.5 drivers: iris,nvidia
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: nvidia mesa v: 570.86.16
    renderer: NVIDIA GeForce RTX 4090/PCIe/SSE2
  API: Vulkan v: 1.4.303 drivers: N/A surfaces: xcb,xlib,wayland
  Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor gpu: nvidia-settings,nvidia-smi
    wl: wayland-info x11: xdpyinfo, xprop, xrandr
Comment 3 Arnaudb 2025-02-20 12:22:57 UTC
For what it's worth, when I plug the monitor via HDMI I get a different kind of brokenness, a lot like you describe. The DSC workaround is DisplayPort only.
Comment 4 Zamundaaa 2025-02-20 14:53:44 UTC
Please put KWIN_DRM_PREFER_COLOR_DEPTH=24 into /etc/environment and reboot. Does it still happen with that?

If it does please follow the instructions at https://invent.kde.org/plasma/kwin/-/wikis/Debugging/Debugging-DRM-issues to get a drm debug log of the problem.
Comment 5 Arnaudb 2025-02-20 18:40:41 UTC
Thanks.
Unfortunately this does not fix it.

I added three logs:
- kwin logs for 3 cases. I set QT_LOGGING_RULES=kwin_*.debug=true. Once logged in, I started grepping journalctl for kwin and performed 3 tests which I detailed in the log file.
- DRM logs with me turning the screen off and on, then switching to the X11 VT and back to Wayland (drm-debug-with-vt-switch.log)
- DRM logs with me turning the screen off and on, then switching to the X11 VT and back to Wayland (drm-debug-with-vt-switch.log)

KWIN_DRM_PREFER_COLOR_DEPTH=24 was set for both DRM logs but not the QT_LOGGING_RULES one. One thing I noticed is that my screen is YCbCr, I don't know how to force RGB (or if this is even possible with DSC): I'm used to this colorspace causing issues but this might be a bad lead.
Comment 6 Arnaudb 2025-02-20 18:41:03 UTC
Created attachment 178654 [details]
drm debug logs with vt switch
Comment 7 Arnaudb 2025-02-20 18:41:18 UTC
Created attachment 178655 [details]
drm debug logs without vt switch
Comment 8 Arnaudb 2025-02-20 18:41:37 UTC
Created attachment 178656 [details]
partial kwin logs while switching
Comment 9 Zamundaaa 2025-03-05 16:23:37 UTC
The log shows that KWin is doing new commits after the hotplug, and the driver applies them with not a single error message.
I have no idea how this wouldn't also happen on Gnome, but given that KWin seems to be doing everything right, I'm certain this issue is on the driver side - or a monitor quirk that the driver has to work around. Please report it at https://forums.developer.nvidia.com/c/gpu-graphics/linux