Kwin_wayland 100% cpu

After the recent update on 2024-05-11 I got KWIN_WAYLAND to use 100%.
Went through all topics related to that issue and I have not found any solution.

Any thoughts on that?

inxi -Fc0                                                                                                                                                                                                                               ✔ 
System:
  Host: thinky Kernel: 6.9.3-3-MANJARO arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.0.5 Distro: Manjaro Linux
Machine:
  Type: Laptop System: LENOVO product: 21DE003HGR v: ThinkPad X1 Extreme Gen 5
    serial: <superuser required>
  Mobo: LENOVO model: 21DE003HGR v: SDK0T76538 WIN
    serial: <superuser required> UEFI: LENOVO v: N3JET38W (1.22 )
    date: 03/12/2024
Battery:
  ID-1: BAT0 charge: 88.7 Wh (100.0%) condition: 88.7/90.0 Wh (98.5%)
CPU:
  Info: 14-core (6-mt/8-st) model: 12th Gen Intel Core i7-12700H bits: 64
    type: MST AMCP cache: L2: 11.5 MiB
  Speed (MHz): avg: 1723 min/max: 400/4600:4700:3500 cores: 1: 4573 2: 400
    3: 2223 4: 400 5: 3741 6: 400 7: 3464 8: 400 9: 716 10: 1973 11: 1055
    12: 400 13: 2412 14: 2345 15: 828 16: 3098 17: 3216 18: 1449 19: 400
    20: 985
Graphics:
  Device-1: Intel Alder Lake-P GT2 [Iris Xe Graphics] driver: i915 v: kernel
  Device-2: NVIDIA GA107M [GeForce RTX 3050 Ti Mobile] driver: nvidia
    v: 550.90.07
  Device-3: Syntek Integrated Camera driver: uvcvideo type: USB
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.0
    compositor: kwin_wayland driver: X: loaded: modesetting unloaded: nvidia
    dri: iris,nouveau gpu: i915,nvidia resolution: 1: 3440x1440 2: 3440x1440
    3: 2560x1600
  API: EGL v: 1.5 drivers: iris,nvidia,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.90.07
    renderer: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2
  API: Vulkan v: 1.3.279 drivers: nvidia surfaces: xcb,xlib,wayland
Audio:
  Device-1: Intel Alder Lake PCH-P High Definition Audio
    driver: sof-audio-pci-intel-tgl
  Device-2: NVIDIA driver: snd_hda_intel
  Device-3: Samsung USBC Headset driver: hid-generic,snd-usb-audio,usbhid
    type: USB
  API: ALSA v: k6.9.3-3-MANJARO status: kernel-api
  Server-1: PipeWire v: 1.0.7 status: active
Network:
  Device-1: Intel Alder Lake-P PCH CNVi WiFi driver: iwlwifi
  IF: wlp0s20f3 state: down mac: 02:9e:cb:cb:1d:8e
  Device-2: Intel Ethernet I225-LMvP driver: igc
  IF: enp85s0 state: up speed: 1000 Mbps duplex: full mac: 64:4b:f0:37:bf:72
  Device-3: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
  IF: enp86s0u1u1u6 state: down mac: 08:92:04:d4:da:41
  IF-ID-1: docker0 state: down mac: 02:42:5c:1b:fc:51
  IF-ID-2: tun0 state: unknown speed: 10000 Mbps duplex: full mac: N/A
Bluetooth:
  Device-1: Intel AX211 Bluetooth driver: btusb type: USB
  Report: btmgmt ID: hci0 state: up address: 28:6B:35:BC:50:9C bt-v: 5.3
Drives:
  Local Storage: total: 1.4 TiB used: 103.55 GiB (7.2%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: PM981 NVMe 512GB
    size: 476.94 GiB
  ID-2: /dev/nvme1n1 vendor: Western Digital model: WD PC SN810
    SDCQNRY-1T00-1001 size: 953.87 GiB
Partition:
  ID-1: / size: 937.53 GiB used: 103.55 GiB (11.0%) fs: ext4 dev: /dev/dm-0
  ID-2: /boot/efi size: 299.4 MiB used: 448 KiB (0.1%) fs: vfat
    dev: /dev/nvme1n1p1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 93.0 C mobo: N/A
  Fan Speeds (rpm): fan-1: 3953 fan-2: 3725
Info:
  Memory: total: 64 GiB available: 62.5 GiB used: 12.19 GiB (19.5%)
  Processes: 446 Uptime: 36m Shell: Zsh inxi: 3.3.34

Hi @lem11h,

Please provide the output for:

grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub
grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub                                                                                                                                                                                       ✔ 
GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=6bdb1a58-7446-4b9d-9f84-4d6f99826679:luks-6bdb1a58-7446-4b9d-9f84-4d6f99826679 root=/dev/mapper/luks-6bdb1a58-7446-4b9d-9f84-4d6f99826679 udev.log_priority=3 nvidia_drm.modeset=1 nvidia_drm.fbdev=1"

And please provide the output of:

sudo cat /sys/module/nvidia_drm/parameters/modeset
sudo cat /sys/module/nvidia_drm/parameters/modeset                                                                                                                                                                                     
Y
top -bn 1 -o %CPU |head -n 20              
                                                                                                                                                                                            
top - 12:09:45 up  1:43,  1 user,  load average: 2,28, 1,83, 1,90
Tasks: 435 total,   2 running, 433 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2,4 us,  1,9 sy,  0,0 ni, 94,7 id,  0,5 wa,  0,0 hi,  0,5 si,  0,0 st 
MiB Mem :  63999,7 total,  40614,5 free,  18632,7 used,   7745,8 buff/cache     
MiB Swap:      0,0 total,      0,0 free,      0,0 used.  45367,0 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
   1393 konrad    -2   0 3396544 375904 284576 R 100,0   0,6  65:40.87 kwin_wa+
   1334 konrad    20   0   21156  11360   9120 S  10,0   0,0   0:17.95 systemd
  16426 root       0 -20       0      0      0 I  10,0   0,0   0:01.14 kworker+
  18323 root      20   0       0      0      0 I  10,0   0,0   0:00.53 kworker+
      1 root      20   0   22072  12032   9092 S   0,0   0,0   0:18.89 systemd

systemd-analyze --user blame                                                                                                                                                                                                            ✔ 
1.336s xdg-desktop-portal.service
 794ms plasma-kcminit.service
 405ms plasma-powerdevil.service
 193ms plasma-kded6.service
 190ms plasma-plasmashell.service
 158ms plasma-xdg-desktop-portal-kde.service
 139ms plasma-polkit-agent.service
 131ms plasma-ksmserver.service
 130ms plasma-kactivitymanagerd.service
 128ms plasma-baloorunner.service
  43ms plasma-kglobalaccel.service
  43ms kde-baloo.service
  26ms plasma-kwin_wayland.service
  17ms xdg-document-portal.service
  13ms plasma-kcminit-phase1.service
  12ms app-geoclue\x2ddemo\x2dagent@autostart.service
  11ms app-pamac\x2dtray\x2dplasma@autostart.service
  10ms app-kaccess@autostart.service
  10ms app-xapp\x2dsn\x2dwatcher@autostart.service
  10ms dbus.socket
   9ms app-msm_kde_notifier@autostart.service
   8ms app-org.kde.kdeconnect.daemon@autostart.service
   7ms plasma-restoresession.service
   7ms app-at\x2dspi\x2ddbus\x2dbus@autostart.service
   7ms plasma-ksplash-ready.service
   6ms app-print\x2dapplet@autostart.service
   6ms app-pamac\x2dtray\x2dbudgie@autostart.service
   6ms app-pamac\x2dtray@autostart.service
   6ms at-spi-dbus-bus.service
   5ms xdg-permission-store.service
   5ms dbus-broker.service
   4ms xdg-user-dirs-update.service
   3ms dconf.service

OK, I honestly have absolutely no idea what it could be…sorry.

Perhaps someone smarter than me :stuck_out_tongue_winking_eye: will know what to do.

thank you @Mirdarthos for the effort - I’ve browsed the Internet back and forth for the answer before posting here.

Also no clue why it is happening.

One point was that it could be due that KWIN_WAYLAND switched to render desktop into software mode (not with nvidia crap), but frankly I also applied some “changes”, but could be also that they did not work.
Heh

1 Like

You’re welcome!

There is definitely something amiss. I mean mine is negligible:

$ top -bn 1 -o %CPU
[...]
PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
[...]
1164 mirdart+  20   0  145.2m  16.1m  12.7m S   0.0   0.1   0:00.00 kwin_wa+
1165 mirdart+  -2   0 2564.8m 407.6m 191.8m S   0.0   2.6   0:23.64 kwin_wa+

@Mirdarthos did you set somewhere such variable

KWIN_DRM_USE_EGL_STREAMS

I found in some forums that this indicates if NVIDIA is used for rendering in kwin_wayland

I’ve created in profile.d kwin.sh that sets that variable (as recommended), but frankly it might be that it took no effect - as profile.d is used upon user creation as far as I remember.

Sadly no, I don’t have it set:

$ echo $KWIN_DRM_USE_EGL_STREAMS

╭─mirdarthos@Mirdarthos-PC ~
╰─➤

This is difficult to have any opinion on without hands-on.

Without any definite say - I don’t have a laptop with intel-nvidia combo - none of my systems shows this behavior.

So one suspect that Nvidia driver is somehow involved as Wayland and Nvidia especially in dual-gpu laptops is - kind of - troublesome.

There was an attempt to apply simpledrm with Nvidia but it failed for dual-gpu systems and has been reverted.

Did you consult the latest Announcements topic for your branch?

Stable Updates Testing Updates

There was a stable snap at June. 10 and a testing snap at June. 11

I’m using only the Stable branch - no testing whatsoever - I’ve mentioned that day as that was the last time I’ve updated the system (got info about that nvidia update is for kernel 6.9).

  53728913 06-11 07:05 linux69-nvidia-550.90.07-5-x86_64.pkg.tar.zst
       329 06-11 07:05 linux69-nvidia-550.90.07-5-x86_64.pkg.tar.zst.sig
     12506 06-11 07:05 mhwd-nvidia-550.90.07-3-any.pkg.tar.zst
       329 06-11 07:05 mhwd-nvidia-550.90.07-3-any.pkg.tar.zst.sig
 231604507 06-11 07:05 nvidia-utils-550.90.07-3-x86_64.pkg.tar.zst
       329 06-11 07:05 nvidia-utils-550.90.07-3-x86_64.pkg.tar.zst.sig

same problem but with amd gpu

@lem11h Did you find the solution? I started similar thread with similar problem and detected problem with combo nvidia + wayland + external display.

Sadly I have not found any solution