Bug 488941

Summary: Plasma 6.1 Screen turn off on login into a Wayland session if HDR is enabled
Product: [Plasma] kwin Reporter: Alexis NICOLAS <alexis>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: REOPENED ---    
Severity: crash CC: contact, davidgillig9, fusionz916, irangarciaieg, jonathansimon, kontakt, kryptokatalyst, lionelg+kde, mail, ponyosunshine, thezenzombie, xaver.hugl
Priority: NOR    
Version: 6.1.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alexis NICOLAS 2024-06-21 23:52:06 UTC
SUMMARY

After upgrading to Plasma 6.1.0, upon login with SDDM onto a Wayland session the screen turn black after showing "No Signal" and I can't even switch to a terminal. On Plasma 6.0.5, I was able to login on Wayland just fine. 

I tested GNOME Wayland and I can login into a session just fine.

I'm using the Nvidia 555.52.04 driver. I reported the issue to them initially (https://forums.developer.nvidia.com/t/nvidia-555-52-04-plasma-6-1-wayland-screen-turn-off-on-login/297197) but I know think it might be a KDE Plasma issue.

STEPS TO REPRODUCE
1. Start the computer
2. Login into a Plasma Wayland session using SDDM

OBSERVED RESULT
The screen display the "No Signal" warning and turns off

EXPECTED RESULT
KDE Plasma loads normally into the desktop

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 6 × Intel® Core™ i5-8600K CPU @ 3.60GHz
Memory: 15.5 Gio of RAM
Graphics Processor: NVIDIA GeForce RTX 4060/PCIe/SSE2
Screen: ASUS XG27AQ connected via DisplayPort

ADDITIONAL INFORMATION
With "journalctl -b -1 -p3" I get:

juin 22 01:19:16 galeanthrope-mini kernel: x86/cpu: SGX disabled by BIOS.
juin 22 01:19:16 galeanthrope-mini kernel: 
juin 22 01:19:21 galeanthrope-mini (udev-worker)[373]: sdb: /etc/udev/rules.d/60-schedulers.rules:6 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:02.0/0000:05:00.0/usb5/5-1/5-1:1.0/host6/target6:0:0/6:0:0:0/block/sdb/queue/scheduler}="cfq", ignoring: Invalid argument
juin 22 01:19:21 galeanthrope-mini /usr/bin/nvidia-powerd[763]: Found unsupported configuration. Exiting...
juin 22 01:19:35 galeanthrope-mini sddm-helper[1160]: gkr-pam: unable to locate daemon control file
juin 22 01:19:36 galeanthrope-mini disable-paste[1229]: *** err
juin 22 01:19:36 galeanthrope-mini disable-paste[1229]: /dev/tty1: Permission denied
juin 22 01:19:36 galeanthrope-mini disable-paste[1229]: *** err
juin 22 01:19:36 galeanthrope-mini disable-paste[1229]: Oh, oh, it's an error! possibly I die!
juin 22 01:19:38 galeanthrope-mini kwin_wayland[1250]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
juin 22 01:19:38 galeanthrope-mini kwin_wayland[1250]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
juin 22 01:19:38 galeanthrope-mini kwin_wayland[1250]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
juin 22 01:19:38 galeanthrope-mini kwin_wayland[1250]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
juin 22 01:19:38 galeanthrope-mini kwin_wayland[1250]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
... (and multiple other identical lines)
Comment 1 Alexis NICOLAS 2024-06-21 23:57:30 UTC
I should have added, I have no issue login in into a Plasma X11 session.
Comment 2 Alexis NICOLAS 2024-06-25 02:58:57 UTC
After deleting ~/.config/kwinoutputconfig.json, I could login. I did some tests and the issue happens when HDR is enabled. In the config file that put "highDynamicRange" and "wideColorGamut" to "true". Just changing "highDynamicRange" to "false" doesn't work, but if I put both to "false", I can login again.
Comment 3 Zamundaaa 2024-06-25 12:23:16 UTC
So if you enable HDR while in the session, that works, and only if you log in with HDR already enabled, it fails?
Comment 4 Iran Garcia 2024-06-25 16:50:20 UTC
I am having the same issue. I enable HDR and try to reboot I get the No Signal screen when login into a Wayland session. Also unable to switch TTYs.
Changing "highDynamicRange" and "wideColorGamut" to "false" in the kwinoutputconfig.json and making the file immutable allowed me to log back into the Wayland session.
Comment 5 Alexis NICOLAS 2024-06-25 20:26:43 UTC
(In reply to Zamundaaa from comment #3)
> So if you enable HDR while in the session, that works, and only if you log
> in with HDR already enabled, it fails?

Yes. I can enable HDR once I login without issue and the screen does switch to HDR mode. But if I let it enabled and I reboot, I get "No Signal".
Comment 6 kryptokatalyst 2024-06-29 00:25:56 UTC
I also starting having this on Arch/Nvidia 550 when KDE updated to 6.1 in the `extra` repo.

Relevant `journalctl` output:

Repeated:

>Jun 20 17:03:07 gogeta kwin_wayland[2604]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
>Jun 20 17:03:07 gogeta kwin_wayland[2604]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"

Followed by single:

> Jun 20 17:03:07 gogeta kwin_wayland[2604]: kwin_wayland_drm: Checking test buffer failed!
> Jun 20 17:03:07 gogeta kwin_wayland[2604]: kwin_core: Applying output config failed!

Issue exists under every permutation of [NVIDIA DRM](https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting).

>    OS: Arch Linux x86_64
>    Host: X570S I AORUS PRO AX (-CF)
>    Kernel: Linux 6.9.6-arch1-1
>    Uptime: 15 hours, 28 mins
>    Packages: 970 (pacman)
>    Shell: bash 5.2.26
>    Display (AW3225QF): 3840x2160 @ 120Hz (HDMI 2.1)
>    DE: KDE Plasma 6.1.0
>    WM: KWin (X11)
>    WM Theme: Breeze
>    Theme: Breeze (Dark) [QT], Breeze-Dark [GTK2], Breeze [GTK3/4]
>    Icons: breeze-dark [QT], breeze-dark [GTK2/3/4]
>    Font: Noto Sans (10pt) [QT], Noto Sans (10pt) [GTK2/3/4]
>    Cursor: breeze (24px)
>    Terminal: yakuake 24.05.1
>    CPU: AMD Ryzen 5 5600 (12) @ 3.50 GHz
>    GPU: NVIDIA GeForce RTX 4070 SUPER [Discrete]

Have just been leaving HDR off until it's resolved, and X11 for gaming until official NVIDIA driver update for explicit sync.
Comment 7 kryptokatalyst 2024-06-29 00:33:04 UTC
Also, same behavior as submitter:

1. Backup .config/kwinoutputconfig.json
2. Enable HDR in Wayland session (nothing else) everything works fine during that session.  
3. Reboot or re-log and I get:

w/o nvidia  in initramfs & nvidia_drm.modeset=1 and nvidia_drm.fbdev=1 
> Black screen w/white cursor

w/nvidia  in initramfs & nvidia_drm.modeset=1 and nvidia_drm.fbdev=1
> No signal to display

4. Login to X11 session and restore .config/kwinoutputconfig.json
5. Reboot/re-log into Wayland session; everything fine again (HDR off)
Comment 8 Stephanie 2024-06-29 06:44:33 UTC
I am also experiencing the exact same problem and have found the same temporary solution to work.
Comment 9 nolemretaW 2024-06-30 08:44:17 UTC
Same problem here, though I had to make kwinoutputconfig.json read only for Plasma to start in Wayland
Comment 10 ZombieLurker 2024-07-01 08:25:45 UTC
Same issue with nvidia 555.58 driver and the following:

Operating System: Arch Linux 
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × 13th Gen Intel® Core™ i9-13900KS
Memory: 62.5 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3090 Ti/PCIe/SSE2

Deleting '~/.config/kwinoutputconfig.json' temporarily fixes the issue.
Comment 11 Zamundaaa 2024-07-02 21:28:48 UTC
I haven't been able to reproduce this issue with driver 555.58 with a laptop rtx 3060 myself. Is it 100% reproducible for you, or does it only happen sometimes?
Comment 12 kryptokatalyst 2024-07-02 21:44:45 UTC
(In reply to Zamundaaa from comment #11)
> I haven't been able to reproduce this issue with driver 555.58 with a laptop
> rtx 3060 myself. Is it 100% reproducible for you, or does it only happen
> sometimes?

Nvidia 555 hit the `extra` repo (Arch) a couple days ago and the Issue is not happening for me on this driver (555.58).  It was happening 100% of the time on 550.90.
Comment 13 Stephanie 2024-07-03 00:08:04 UTC
I can confirm, upgrading to Nvidia 555.58 and a reboot fixed the bug for me. I can start KDE / Plasma with HDR enabled and everything starts correctly without needing to hack a conf file.
Comment 14 Zamundaaa 2024-07-03 00:16:27 UTC
Great! Probably just a weird driver bug then
Comment 15 Kai 2024-07-03 18:23:35 UTC
Hi,

I can still reproduce this after just having upgraded the nvidia drivers from 555.58 to 555.58.02. I have `nvidia-drm.modeset=1` and `nvidia-drm.fbdev=1`. When I start into the Wayland session from SDDM with HDR enabled, I loose all display output and switching to a different tty no longer works. I can boot up to SDDM, switch to a different tty, disable HDR in `~/.config/kwinoutputconfig.json` and then just start the Wayland session no problem. Also enabling HDR when already in the session works.

Operating System: EndeavourOS 
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-9700K CPU @ 3.60GHz
Memory: 31.2 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2080/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: Z390 AORUS MASTER
Comment 16 Stephanie 2024-07-04 02:07:46 UTC
(In reply to Kai from comment #15)
> Hi,
> 
> I can still reproduce this after just having upgraded the nvidia drivers
> from 555.58 to 555.58.02. I have `nvidia-drm.modeset=1` and
> `nvidia-drm.fbdev=1`. When I start into the Wayland session from SDDM with
> HDR enabled, I loose all display output and switching to a different tty no
> longer works. I can boot up to SDDM, switch to a different tty, disable HDR
> in `~/.config/kwinoutputconfig.json` and then just start the Wayland session
> no problem. Also enabling HDR when already in the session works.
> 
> Operating System: EndeavourOS 
> KDE Plasma Version: 6.1.1
> KDE Frameworks Version: 6.3.0
> Qt Version: 6.7.2
> Kernel Version: 6.9.7-arch1-1 (64-bit)
> Graphics Platform: Wayland
> Processors: 8 × Intel® Core™ i7-9700K CPU @ 3.60GHz
> Memory: 31.2 GiB of RAM
> Graphics Processor: NVIDIA GeForce RTX 2080/PCIe/SSE2
> Manufacturer: Gigabyte Technology Co., Ltd.
> Product Name: Z390 AORUS MASTER

I just verified that I have the same Nvidia kernel flags enabled as you, Pacman says 555.58-2 installed. Nvidia tools ( nvidia-smi, nvidia-settings ) both say 555.58 ( no .2 on the end ), so I'm not sure which to tell you exactly. I am also running EndeavourOS. I am also using the same kernel as you. The only difference I could possibly think is that I had the LTS kernel installed from reading a different solution and removed it right before the system upgrade. Other than that, I have been having perfect results, surviving a reboot, and now it is also surviving turning off my hdmi tv for lengths of time and coming back without a session restart. I'm using an RTX 3060, I'm a Ryzen 5, I am on the same version of Plasma, Frameworks, and QT as you as well. Have you tried to create a new user, separate from you main, to isolate that it isn't something else in your confs that might also be triggering this?
Comment 17 jonathansimon 2024-07-04 02:41:25 UTC
This is also happening to me on any 555.58.x driver, although my primary display is black on Wayland or X11 not just on Wayland. If I back down to 550.90.07, it's fine under X11. Wayland is iffy on that version for me.

Operating System: EndeavourOS 
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × 11th Gen Intel® Core™ i9-11900K @ 3.50GHz
Memory: 62.6 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2
Manufacturer: ASUS
Comment 18 Alexis NICOLAS 2024-07-04 03:25:35 UTC
I can still reproduce the issue after upgrading the Nvidia driver to 555.58.02 (and fully up to date ArchLinux). I get the same behavior and the exact same kind of error messages: 

juil. 04 05:13:16 galeanthrope-mini kwin_wayland[1404]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible
juil. 04 05:13:16 galeanthrope-mini kwin_wayland[1404]: kwin_scene_opengl: Invalid framebuffer status:  "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
Comment 19 Alexis NICOLAS 2024-07-04 03:38:50 UTC
For me the issue can be reproduced 100% of the time. If I have the wrong configuration (HDR enabled), I get "No Signal" every time. When I want to go back to a good configuration, I do like Kay and switch to a TTY while I'm still at the SDDM screen.
Comment 20 Fusion916 2024-07-04 17:58:52 UTC
Can confirm with the lastest nvidia drivers (nvidia 555.58.02-1) in arch this problem still exists. If HDR is enabled on boot the GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT errors still occur under wayland session.
Comment 21 Zamundaaa 2024-07-04 18:42:56 UTC
*** Bug 488670 has been marked as a duplicate of this bug. ***