Wayland + KDE 6 + Optimus Nvidia

I have the same issue on my Lenovo Legion 5 Slim 2023 with Optimus (i7-13700h/nvidia 4060), also on wayland + plasma 6. When I connect the external monitor via HDMI with the system in hybrid mode, framerates of my display get almost halved.

Boring technical problem summary

Ironically, the issue here is the iGPU (or kwin_wayland usage of the iGPU), because it needs to copy the frame buffer twice, as the HDMI output is connected to the nvidia dGPU, and it’s not fast enough to do it.

This is a “well-known” issue and it’s really noticable on mixed frequency displays (my laptop screen is at 165 and monitor at 144hz).

There are some merge requests for KWin to support dynamic DMA-fence deadline (boost GPU clock speed to complete render on time, https://www.phoronix.com/news/KDE-KWin-DMA-Fence-Deadline), and support for triple buffering to prevent framerate issues. KDE 6.1 should be released with these improvements merged (hopefully we also get improved Optimus support in nvidia drivers by then).

You can try to set NVIDIA as the primary GPU for your KWin compositor on wayland, with this in your environment

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

This works well for me and apps on both my displays run with their native 165/144 hz without any frame drops.