#484746 /usr/bin/kwin: kwin eats CPU cycles

Package:
kde-window-manager
Source:
kwin
Submitter:
William Thomas Orr
Date:
2023-04-26 09:33:16 UTC
Severity:
normal
Tags:
#484746#5
Date:
2008-06-06 03:01:00 UTC
From:
To:
When running KDE4, Kwin eats roughly 40% of one of my 4 3.6 GHz CPUs
idling, according to top and Gkrellm.  Probs not a good thing.

#484746#10
Date:
2009-12-04 19:23:47 UTC
From:
To:
tags 484746 moreinfo upstream
thanks

Hello,

Is it still the case with KDE 4.3?

#484746#17
Date:
2009-12-04 20:54:49 UTC
From:
To:
Here it is still the case but I can bring it down to a basic failure in the
Graphics driver as it is only appearing when KWin's compositing is running.
What graphicscard you got there?
Are you using the Compositing with it?
Whats the driver version for your Graphics card?
Have you tried updating it?

#484746#22
Date:
2009-12-04 21:01:26 UTC
From:
To:
Hello,

What is yours? nvidia? Then use the latest drivers (190 series iirc).

I don't need help. I'm asking reporter if the bug is still valid.

#484746#27
Date:
2009-12-04 22:19:05 UTC
From:
To:
I will test it for the newer driver but currently I haven't had a problem.
To me not but I will ping back if  there is after updating.

#484746#32
Date:
2009-12-04 22:19:05 UTC
From:
To:
I will test it for the newer driver but currently I haven't had a problem.
To me not but I will ping back if  there is after updating.

#484746#37
Date:
2009-12-04 20:54:49 UTC
From:
To:
Here it is still the case but I can bring it down to a basic failure in the
Graphics driver as it is only appearing when KWin's compositing is running.
What graphicscard you got there?
Are you using the Compositing with it?
Whats the driver version for your Graphics card?
Have you tried updating it?

#484746#40
Date:
2011-01-02 16:44:58 UTC
From:
To:
tags 484746 + moreinfo
thanks

Hi,

you reported http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=484746 some time
ago. Since then, KDE Software Compilation had several releases. Can you please
verify whether the bug you reported is still present in a more current version
(and - if yes - specify which version)?

Eckhart

#484746#45
Date:
2011-07-28 17:09:20 UTC
From:
To:
Hello,

I still have this issue with Debian testing and Nvidia drivers.

ilya@mefesto:/tmp$ apt-cache policy kde-window-manager
kde-window-manager:
  Installed: 4:4.6.5-1
  Candidate: 4:4.6.5-1
  Version table:
     4:4.6.5-2 0
        600 http://cdn.debian.net/debian/ unstable/main amd64 Packages
 *** 4:4.6.5-1 0
        700 http://cdn.debian.net/debian/ testing/main amd64 Packages
        100 /var/lib/dpkg/status
ilya@mefesto:/tmp$ apt-cache policy nvidia-glx
nvidia-glx:
  Installed: 275.09.07-5
  Candidate: 275.09.07-5
  Version table:
     275.21-1 0
        600 http://cdn.debian.net/debian/ unstable/non-free amd64 Packages
 *** 275.09.07-5 0
        700 http://cdn.debian.net/debian/ testing/non-free amd64 Packages
        100 /var/lib/dpkg/status
ilya@mefesto:/tmp$

Regards, Ilya.

#484746#50
Date:
2011-09-22 09:54:55 UTC
From:
To:
I have had the same problem, I think ever since I switched to the KDE 4 series. Also using the nvidia driver:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                              Version                           Description
+++-=================================-=================================-====================================================================================
ii  nvidia-alternative                280.13-1                          allows the selection of NVIDIA as GLX provider
ii  nvidia-cg-toolkit                 2.1.0017.deb1+nmu3                NVIDIA Cg Toolkit Installer
ii  nvidia-glx                        280.13-1                          NVIDIA metapackage
ii  nvidia-installer-cleanup          20110729+1                        Cleanup after driver installation with the nvidia-installer
ii  nvidia-kernel-2.6.38-2-amd64      270.41.06-1+2.6.38-5              NVIDIA binary kernel module for Linux 2.6.38-2-amd64
ii  nvidia-kernel-2.6.39-2-amd64      275.09.07-1+2.6.39-2              NVIDIA binary kernel module for Linux 2.6.39-2-amd64
ii  nvidia-kernel-3.0.0-1-amd64       275.21-1+3.0.0-1                  NVIDIA binary kernel module for Linux 3.0.0-1-amd64
ii  nvidia-kernel-common              20110729+1                        NVIDIA binary kernel module support files
ii  nvidia-kernel-dkms                280.13-1                          NVIDIA binary kernel module DKMS source
ii  nvidia-kernel-source              280.13-1                          NVIDIA binary kernel module source
ii  nvidia-settings                   280.13-1                          Tool for configuring the NVIDIA graphics driver
ii  nvidia-support                    20110729+1                        NVIDIA binary graphics driver support files
ii  nvidia-vdpau-driver               280.13-1                          NVIDIA vdpau driver

Disabling compositing (Alt+Shift+F12) is a workaround as mentioned, and sometimes necessary when running off a battery.

When compositing is enabled, kwin sometimes behaves well, but sometimes seems to eat as many CPU cycles as it can get (on a single core). Switching desktops away from a desktop containing a konsole window may be a trigger (I'm not really sure if it's konsole related; certainly I get a short spike in CPU usage following this and I seem to remember it triggering unlimited CPU usage in the past).

Many times I've seen this happen with CPU usage never seeming to reduce again (unless I disabled compositing or killed kwin); I thought I saw the same thing just now but CPU load did reduce (after maybe a minute or so).

The kde task manager doesn't notice the high CPU usage, but other programs like top do.

Possibly related upstream reports:

https://bugs.kde.org/show_bug.cgi?id=279944
https://bugs.kde.org/show_bug.cgi?id=242979

Those aren't the only reports matching "kwin CPU", but the most relevent.