SUMMARY The default plasma-kwin-wayland.service doesn't set the KWIN_DRM_DEVICES Environment variable (at all or correctly?) Thus, in the default settings, when you plug in an external monitor to a laptop with the NVIDIA 580 and 595 drivers the entire system locks up hard. (e.g. even the caps-lock key freezes) Sometimes the crash happens at the moment you move the cursor across monitor borders. Sometimes the crash is immediate after connecting the monitor. Tested both with an HDMI-to-HDMI monitor and a LaptopUSBc-to-HDMI monitor. Both crashed. I have a workaround which works great. I am submitting this bug for anyone else with similar issues and willing to undo the workaround if you'd like additional testing. STEPS TO REPRODUCE 1. Log in to Wayland/KDE 2.Plug in external monitor 3. If there is not an immediate crash, then move the mouse cursor from one monitor to another. OBSERVED RESULT Kernel Panic. Even the caps-lock key is frozen. EXPECTED RESULT No crash. SOFTWARE/OS VERSIONS Linux uname -a: Linux ao-x360 6.17.0-23-generic #23-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:29:57 UTC 2026 x86_64 GNU/Linux NAME="Ubuntu" VERSION_ID="25.10" VERSION="25.10 (Questing Quokka)" VERSION_CODENAME=questing Operating System: Kubuntu 25.10 KDE Plasma Version: 6.4.5 KDE Frameworks Version: 6.17.0 Qt Version: 6.9.2 Kernel Version: 6.17.0-23-generic (64-bit) Graphics Platform: Wayland Processors: 12 × Intel® Core™ i9-8950HK CPU @ 2.90GHz Memory: 64 GiB of RAM (62.6 GiB usable) Graphics Processor 1: Quadro P1000 Graphics Processor 2: Intel® UHD Graphics 630 Manufacturer: HP Product Name: HP ZBook Studio x360 G5 System Version: SBKPF ADDITIONAL INFORMATION: I kept running the crash with `journalctl -f` and `dmesg -W` and `tail -f /var/log/kern.log` into files. I think I have the relevant stuff from journalctl below. In this case I was plugging in a usbc connector for the monitor: ``` [ 217.253120] ao-x360 kernel: usb 1-11: new full-speed USB device number 6 using xhci_hcd [ 217.400136] ao-x360 kernel: usb 1-11: not running at top speed; connect to a high speed hub [ 217.431059] ao-x360 kernel: usb 1-11: New USB device found, idVendor=25a4, idProduct=9311, bcdDevice= 2.01 [ 217.432065] ao-x360 kernel: usb 1-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 217.432634] ao-x360 kernel: usb 1-11: Product: USB C Video Adaptor [ 217.433183] ao-x360 kernel: usb 1-11: Manufacturer: USB C [ 217.433708] ao-x360 kernel: usb 1-11: SerialNumber: 000000000001 [ 217.453976] ao-x360 mtp-probe[6597]: checking bus 1, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-11" [ 217.454430] ao-x360 mtp-probe[6597]: bus: 1, device: 6 was not an MTP device [ 217.473054] ao-x360 mtp-probe[6608]: checking bus 1, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-11" [ 217.473279] ao-x360 mtp-probe[6608]: bus: 1, device: 6 was not an MTP device [ 217.945050] ao-x360 kernel: fbcon: Deferring console take-over [ 217.945196] ao-x360 kernel: nvidia 0000:01:00.0: [drm] fb1: nvidia-drmdrmfb frame buffer device [ 218.282571] ao-x360 kwin_wayland_wrapper[4146]: kwin_scene_opengl: 0x500: GL_INVALID_ENUM error generated. Invalid <face>. [ 218.282571] ao-x360 kwin_wayland_wrapper[4146]: kwin_scene_opengl: Invalid framebuffer status: "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" [ 218.283408] ao-x360 kwin_wayland_wrapper[4146]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible [ 218.283408] ao-x360 kwin_wayland_wrapper[4146]: kwin_scene_opengl: Invalid framebuffer status: "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT" [ 218.357261] ao-x360 kernel: BUG: kernel NULL pointer dereference, address: 0000000000000028 [ 218.357483] ao-x360 kernel: #PF: supervisor read access in kernel mode [ 218.371297] ao-x360 kernel: #PF: error_code(0x0000) - not-present page [ 218.371382] ao-x360 kernel: PGD 80000002384ee067 P4D 80000002384ee067 PUD 0 [ 218.371482] ao-x360 kernel: Oops: Oops: 0000 [#1] SMP PTI [ 218.371506] ao-x360 kernel: CPU: 1 UID: 1000 PID: 4146 Comm: kwin_wayland Tainted: P OE 6.17.0-23-generic #23-Ubuntu PREEMPT(voluntary) [ 218.371521] ao-x360 kernel: Tainted: [P]=PROPRIETARY_MODULE, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE [ 218.371536] ao-x360 kernel: Hardware name: HP HP ZBook Studio x360 G5/844F, BIOS Q71 Ver. 01.32.00 03/04/2025 [ 218.371550] ao-x360 kernel: RIP: 0010:_nv000582kms+0x4/0x10 [nvidia_modeset] [ 218.371564] ao-x360 kernel: Code: 87 50 01 00 00 70 2f 17 c3 48 c7 87 38 01 00 00 c0 2d 17 c3 48 c7 87 40 01 00 00 90 31 17 c3 c3 66 0f 1f 44 00 00 f3 0f 1e fa <0f> b6 47 28 c3 0f 1f 80 0 0 00 00 00 89 c9 48 8d 04 49 48 c1 e0 04 [ 218.371582] ao-x360 kernel: RSP: 0018:ffffccaedb24f960 EFLAGS: 00010293 [ 218.371594] ao-x360 kernel: RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffc31735b0 [ 218.371607] ao-x360 kernel: RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 218.371619] ao-x360 kernel: RBP: ffffccaedb24fa20 R08: 0000000000000000 R09: 0000000000000000 [ 218.371630] ao-x360 kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffff8c38704ab100 [ 218.371642] ao-x360 kernel: R13: ffffccaedb24f9a8 R14: ffff8c38704ab108 R15: 0000000000000000 [ 218.371654] ao-x360 kernel: FS: 00007f410626bd40(0000) GS:ffff8c47cf0fc000(0000) knlGS:0000000000000000 [ 218.371666] ao-x360 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 218.371681] ao-x360 kernel: CR2: 0000000000000028 CR3: 0000000184a62005 CR4: 00000000003726f0 [ 218.371694] ao-x360 kernel: Call Trace: [ 218.371708] ao-x360 kernel: <TASK> [ 218.371720] ao-x360 kernel: ? nv_drm_framebuffer_create+0x2f7/0x760 [nvidia_drm] [ 218.371733] ao-x360 kernel: drm_internal_framebuffer_create+0xfd/0x210 [ 218.371745] ao-x360 kernel: drm_mode_addfb2_ioctl+0x51/0x100 [ 218.371760] ao-x360 kernel: ? __pfx_drm_mode_addfb2_ioctl+0x10/0x10 [ 218.371772] ao-x360 kernel: drm_ioctl_kernel+0xb2/0x110 [ 218.371785] ao-x360 kernel: drm_ioctl+0x309/0x5e0 [ 218.371798] ao-x360 kernel: ? __pfx_drm_mode_addfb2_ioctl+0x10/0x10 [ 218.371808] ao-x360 kernel: nv_drm_ioctl+0x38/0x3e0 [nvidia_drm] [ 218.371819] ao-x360 kernel: ? hook_file_ioctl+0x10/0x20 [ 218.371831] ao-x360 kernel: __x64_sys_ioctl+0xa0/0x100 [ 218.371844] ao-x360 kernel: x64_sys_call+0x1151/0x2330 [ 218.371855] ao-x360 kernel: do_syscall_64+0x81/0xb30 [ 218.371873] ao-x360 kernel: ? drm_ioctl+0x348/0x5e0 [ 218.371887] ao-x360 kernel: ? __pfx_drm_prime_fd_to_handle_ioctl+0x10/0x10 [ 218.371903] ao-x360 kernel: ? hook_file_ioctl+0x10/0x20 [ 218.371916] ao-x360 kernel: ? __x64_sys_ioctl+0xbd/0x100 [ 218.371928] ao-x360 kernel: ? arch_exit_to_user_mode_prepare.isra.0+0xd/0xe0 [ 218.371942] ao-x360 kernel: ? do_syscall_64+0xb9/0xb30 [ 218.371954] ao-x360 kernel: ? __x64_sys_ioctl+0xbd/0x100 [ 218.371965] ao-x360 kernel: ? arch_exit_to_user_mode_prepare.isra.0+0xd/0xe0 [ 218.371974] ao-x360 kernel: ? do_syscall_64+0xb9/0xb30 [ 218.371987] ao-x360 kernel: ? arch_exit_to_user_mode_prepare.isra.0+0xd/0xe0 [ 218.371997] ao-x360 kernel: ? do_syscall_64+0xb9/0xb30 [ 218.372046] ao-x360 kernel: ? arch_exit_to_user_mode_prepare.isra.0+0xd/0xe0 [ 218.372059] ao-x360 kernel: ? do_syscall_64+0xb9/0xb30 [ 218.372072] ao-x360 kernel: ? irqentry_exit_to_user_mode+0x2d/0x1d0 [ 218.372114] ao-x360 kernel: ? irqentry_exit+0x43/0x50 [ 218.372127] ao-x360 kernel: ? exc_page_fault+0x90/0x1b0 [ 218.372139] ao-x360 kernel: entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 218.372151] ao-x360 kernel: RIP: 0033:0x7f410d1328bd [ 218.372165] ao-x360 kernel: Code: 04 25 28 00 00 00 48 89 45 c8 31 c0 48 8d 45 10 c7 45 b0 10 00 00 00 48 89 45 b8 48 8d 45 d0 48 89 45 c0 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1 a 48 8b 45 c8 64 48 2b 04 25 28 00 00 00 [ 218.372177] ao-x360 kernel: RSP: 002b:00007fff939f5ff0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 218.372189] ao-x360 kernel: RAX: ffffffffffffffda RBX: 00007fff939f61d4 RCX: 00007f410d1328bd [ 218.372201] ao-x360 kernel: RDX: 00007fff939f6080 RSI: 00000000c06864b8 RDI: 00000000000000bb [ 218.372212] ao-x360 kernel: RBP: 00007fff939f6040 R08: 00007fff939f6230 R09: 0000622737b2f578 [ 218.372227] ao-x360 kernel: R10: 000000007fffffff R11: 0000000000000246 R12: 00007fff939f6080 [ 218.372240] ao-x360 kernel: R13: 00000000c06864b8 R14: 00000000000000bb R15: 0000622737b2f540 [ 218.372252] ao-x360 kernel: </TASK> ``` WORKAROUND: Add KWIN_DRM_DEVICES Environment variable for the plasma-kwin-wayland.service $ mkdir -p ~/.config/systemd/user/plasma-kwin_wayland.service.d/ $ cat > ~/.config/systemd/user/plasma-kwin_wayland.service.d/01-nvidia-drm-device-order.conf << 'EOF' [Service] Environment=KWIN_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1 EOF $ systemctl --user daemon-reload $ reboot I searched for other bugs and perhaps these are duplicates? * https://bugs.kde.org/show_bug.cgi?id=482940 * https://bugs.kde.org/show_bug.cgi?id=517684 Possibly related NVIDIA discussions: * https://forums.developer.nvidia.com/t/580-release-feedback-discussion/341205/1050 * https://forums.developer.nvidia.com/t/kernel-null-pointer-dereference-when-using-the-580-142-driver/363409 I understand that kernel panics are essentially an NVIDIA driver issue, however, given that there seems to be a KWIN setting that 100% solves this issue, I'm submitting this bug for * information for others * in case you think there's a setting with plasma-kwin_wayland.service that should have been set by default and isn't * in case you want more diagnostics. Willing to undo the workaround if you'd like additional testing. Otherwise, feel free to close the bug as "has workaround"
I forgot to mention that the environment values set in the file `~/.config/systemd/user/plasma-kwin_wayland.service.d/01-nvidia-drm-device-order.conf` e.g. ``` [Service] Environment=KWIN_DRM_DEVICES=/dev/dri/card0:/dev/dri/card1 ``` come from the cards listed in the directory `/dev/dri`
Please report kernel bugs to the kernel / to Nvidia in this case.