Laptop freezes under Wayland

Hello everyone,

I’m looking for a practical solution to the following problem:

My setup is a laptop with both a dedicated GPU (NVIDIA) and an integrated GPU (AMD).

switcherooctl list
Device: 0
  Name:        NVIDIA Corporation AD106M [GeForce RTX™ 4070 Max-Q / Mobile]
  Default:     no
  Discrete:    yes
  Environment: __GLX_VENDOR_LIBRARY_NAME=nvidia __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only VK_LOADER_DRIVERS_SELECT=*nvidia*

Device: 1
  Name:        Advanced Micro Devices, Inc. [AMD/ATI] Strix [Radeon™ 880M / 890M]
  Default:     no
  Discrete:    no
  Environment: DRI_PRIME=pci-0000_66_00_0 VK_LOADER_DRIVERS_SELECT=*radeon*

Under Wayland, when an external monitor is connected via HDMI cable (directly to the NVIDIA GPU, I assume), two different scenarios occur, both leading to a system crash (I cannot switch to TTY; only a hard reset works):

  1. The system runs, but the moment I move my mouse to the external monitor, the system freezes.

  2. After a reboot, the system freezes as soon as Wayland starts loading.

There are no such problems when using X11 instead.

I found a temporary solution here:

However, this is not practical for everyday laptop use. When I set

export KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0"

in /etc/profile.d/kwin_drm.sh (where card1 is the NVIDIA GPU and card0 is the AMD one), Wayland works fine; but now GPU switching no longer functions. Previously, with all external cables unplugged, the AMD GPU would take over from the NVIDIA one, which is much more power‑efficient than the RTX 4070. That behavior is now lost.

My question: is there a way to handle this situation properly? Ideally, I would like to restore the original Wayland behavior that worked out of the box without any hotfixes. Alternatively, are there better workarounds that allow me to simply unplug the HDMI cable and have the AMD GPU take over dynamic switching again?

Thanks in advance,
Cheers

I can only recommend submitting a bug report as described here:

1 Like

Thanks to thibdb13 for already filing the upstream bug report (https://bugs.kde.org/show_bug.cgi?id=517608).

Following that report and the NVIDIA forum discussion (https://forums.developer.nvidia.com/t/580-release-feedback-discussion/341205/1057), I found a working solution that allows to use the integrated card (AMD).

The fix:
(due to readr00m3 from the NVIDIA discussion)
Add
export KWIN_FORCE_SW_CURSOR=1
to a .sh file:
/home/pnk/.config/plasma-workspace/env/force-sw-cursor.sh,
then log out and back in.

Result:
Wayland no longer freezes with an external HDMI monitor connected:

glxinfo -B | grep "OpenGL renderer"
OpenGL renderer string: AMD Radeon 890M Graphics (radeonsi, strix1, ACO, DRM 3.64, 6.19.12-1-default)

I have not checked if the dynamic switching is working, i.e. I do not need the NVIDIA GPU for most of the time, but now the laptop’s battery is feeling much better.

Thank you for for your reply to thibdb13 that lead to this solution.

What you’re seeing makes sense: under Wayland, the NVIDIA + AMD combo can get really unstable when an external monitor is involved, especially if it’s wired through the NVIDIA side. That “freeze when moving mouse to external screen” is a pretty classic symptom.n Your workaround with KWIN_DRM_DEVICES is basically forcing a stable GPU order, which is why it stops freezing, but yeah, you lose the automatic switching to AMD, so power efficiency is gone.n The core problem is really the mix of: hybrid graphics (AMD + NVIDIA), external monitor routed through NVIDIA, Wayland + KDE’s current handling of GPU switching. So there isn’t a clean “one fix” right now. Either you get stability by locking the GPU order, or you keep dynamic switching and risk crashes under Wayland.

2 Likes