Kwin Using 90+% CPU At All Times

Hey Everyone, I’m running into an issue that’s driving me nuts, and hoping someone can help: I just downloaded the Plasma Desktop ISO and flashed it to a Live USB, then installed Manjaro on my SSD, and as soon as I log in for the first time, the kwin_wayland process starts using 90+% of my CPU indefinitely, which makes everything else unbearably slow - just moving the mouse or hitting a single key takes 2-4 seconds to register on screen.

Things I’ve tried, and their results:

  • Killing the kwin_wayland process - it just restarts and consumes most of the CPU resources again
  • Letting the system (slowly…) update everything so the whole system is up to date according to Pamac - no noticeable change even after a reboot
  • Downgrading kwin to the version (5.27.4.1-1) that was running just fine on the Live USB I had just installed from - no noticeable change
  • Installing free and nonfree graphics drivers (Nvidia card) - free was already installed, and nonfree didn’t have any noticeable affect
  • Wiping the drive and re-installing everything again (more than once now) - same result
  • Switching from the 6.1LTS to the 5.15LTS kernel - no noticeable affect

Is there anything else I can try to fix this?

[Edit to add inxi output]:

System:
  Host: [Hostname] Kernel: 6.1.30-1-MANJARO arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.27.4 Distro: Manjaro Linux
Machine:
  Type: Desktop System: ASUS product: All Series v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: Z97-AR v: Rev 1.xx serial: <superuser required>
    UEFI: American Megatrends v: 3503 date: 04/18/2018
CPU:
  Info: quad core model: Intel Core i7-4790K bits: 64 type: MT MCP cache:
    L2: 1024 KiB
  Speed (MHz): avg: 3998 min/max: 800/4400 cores: 1: 3998 2: 3998 3: 3998
    4: 3998 5: 3998 6: 3998 7: 3998 8: 3998
Graphics:
  Device-1: NVIDIA GA106 [GeForce RTX 3060 Lite Hash Rate] driver: nouveau
    v: kernel
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.1
    compositor: kwin_wayland driver: X: loaded: modesetting gpu: nouveau
    resolution: 1920x1080
  API: OpenGL v: 4.5 Mesa 23.0.3 renderer: llvmpipe (LLVM 15.0.7 256 bits)
Audio:
  Device-1: Intel 9 Series Family HD Audio driver: snd_hda_intel
  Device-2: NVIDIA GA106 High Definition Audio driver: snd_hda_intel
  API: ALSA v: k6.1.30-1-MANJARO status: kernel-api
  Server-1: PulseAudio v: 16.1 status: active
Network:
  Device-1: Intel Ethernet I218-V driver: e1000e
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: [address]
Drives:
  ID-1: /dev/nvme0n1 vendor: MSI model: M470 1TB size: 931.51 GiB
Partition:
  ID-1: / size: 906.86 GiB used: 7.5 GiB (0.8%) fs: ext4 dev: /dev/dm-0
  ID-2: /boot/efi size: 299.4 MiB used: 452 KiB (0.1%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: partition size: 8.8 GiB used: 0 KiB (0.0%) dev: /dev/dm-1
Sensors:
  System Temperatures: cpu: 52.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 226 Uptime: 1m Memory: available: 31.29 GiB used: 1.29 GiB (4.1%)
  Shell: Zsh inxi: 3.3.27

are you using wayland? if yes switch to xorg

This is something local to your system - but I vannot say what it is.

I run Plasma with Wayland on my system - there is no extreme usage like you describe.

Fresh plasma systems usually suffer from the baloo indexer initializing the database.

kwin is the window manager and compositor.

The only thing I can think of is GPU - but without sys info it a guess - use the following command

inxi -Fc0

Then copy the text from the terminal and paste it inside a code fence

~~~
your inxi output goes here
~~~

For comparison

name version
Plasma 5.27.6
KDE Framework 5.108.0
Qt 5.15.10
Platform Wayland
workstation unstable
Kernel 6.5.0
CPU AMD 5945WX
GPU AMD RX 7900XTX
laptop stable
Kernel 6.1.41
CPU Core i7 5600U
GPU Intel 5500
GeForce 940M

I’m only using Wayland if that’s the default - this is a completely fresh install with no changes whatsoever. Are there any pros/cons to switching to Xorg? Would it mess with anything else? I’d ideally like to keep as many defaults as possible.

Does that mean I could theoretically just let it run until it finishes, and it should be fine after that?

I’ve edited the original post to add the inxi output.

If it is the indexer hogging the system - then yes.

nouveau driver is not good with Nvidia > 1000

Open a terminal and enter

sudo pacman -Syu
sudo mhwd -i pci video-nvidia

I recommend using the latest stable kernel

sudo mhwd-kernel -i linux64

Then reboot the system

Running sudo mhwd -i pci video-nvidia and rebooting caused the system to freeze while loading every time, so I wiped the drive and started over again.

This time, I ran whwd -a pci nonfree 0300, which installed a bunch of Nvidia stuff. Rebooting caused the same freezing issue, so I wiped the drive and started over again.

This time, I ran whwd -a pci nonfree 0300 and then immediately ran mhwd -r pci video-linux, in case that was causing any conflicts. When I rebooted and logged in, it flashed to a black screen with a cursor for a second, then went back to the login screen, and kept looping this over and over each time I entered my password.

I noticed a dropdown in the lower-left corner of the login screen that either wasn’t there before or I just hadn’t noticed before, and it was set to something like Plasma (Wayland). I switched it to Plasma (X11), and then it allowed me to log in, and the CPU wasn’t getting hammered by that kwin_wayland process anymore.

So I’m not 100% sure which of the things I tried (if any) fixed it, but I think we’re good now? Thanks for the help, everyone!

You are now using the proprietary drivers and X11 (instead of wayland)
the wayland process isnt being hammered because it isnt running.
Wayland is known not to work well with nvidia … only the more recent cards+drivers have any reasonable ability to work with it.