Bug 486214 - High CPU usage on kwin_wayland when idle
Summary: High CPU usage on kwin_wayland when idle
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (other bugs)
Version First Reported In: 6.0.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 493769 503184 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-27 17:42 UTC by Bill
Modified: 2025-09-02 08:31 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
hotspot logs (3.75 MB, application/octet-stream)
2024-04-27 17:46 UTC, Bill
Details
btop_screenshot (1.04 MB, image/png)
2024-04-27 17:47 UTC, Bill
Details
intel_gpu_top_screenshot (579.92 KB, image/png)
2024-04-27 17:47 UTC, Bill
Details
powertop_screenshot (765.63 KB, image/png)
2024-04-27 17:49 UTC, Bill
Details
hotspot flamegraph firefox playback (353.70 KB, image/png)
2024-06-12 12:44 UTC, Dashon
Details
htop screenshot (380.79 KB, image/png)
2025-07-01 16:06 UTC, TraceyC
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bill 2024-04-27 17:42:48 UTC
SUMMARY


STEPS TO REPRODUCE
1. Use system as normal
2. Btop shows high cpu and power usgae by kwin_wayland
3. 

OBSERVED RESULT
kwin_wayland usage cpu constantly, causing higher power draw, stoping cpu from deeper sleep state

EXPECTED RESULT
kwin_wayland should not be using cpu consultant, it should allow cpu to fall into deeper sleep state when no in active use

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.8.7-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × 12th Gen Intel® Core™ i5-1240P
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: Framework
Product Name: Laptop (12th Gen Intel Core)
System Version: A4

ADDITIONAL INFORMATION
Comment 1 Bill 2024-04-27 17:46:09 UTC
Created attachment 168952 [details]
hotspot logs
Comment 2 Bill 2024-04-27 17:47:08 UTC
Created attachment 168953 [details]
btop_screenshot
Comment 3 Bill 2024-04-27 17:47:56 UTC
Created attachment 168954 [details]
intel_gpu_top_screenshot
Comment 4 Bill 2024-04-27 17:49:05 UTC
Created attachment 168955 [details]
powertop_screenshot

I left the system to idle for about 10 mins, then took this.
Comment 5 Zamundaaa 2024-04-28 22:13:05 UTC
I don't see anything particularly weird in the flamegraph, most of the CPU time is in compositing and processing Wayland events. There is a somewhat odd QThreadPool thing in there taking up a not insignificant part of CPU time, but it's not enough to cause this issue
Comment 6 Bill 2024-04-30 12:24:09 UTC
(In reply to Zamundaaa from comment #5)
> I don't see anything particularly weird in the flamegraph, most of the CPU
> time is in compositing and processing Wayland events. There is a somewhat
> odd QThreadPool thing in there taking up a not insignificant part of CPU
> time, but it's not enough to cause this issue

I've made few more observations since.
The issue is not persistent and constant as it was when I reported it, that seem to have been the right moment where I caught it in full swing.
laptop was asleep for few hours after reporting this bug and I didn't see the same CPU usage by kwin_wayland that day. 
It does reaper occasionality, especially where it does uses significant cpu time just sitting around idling for some reason?
Comment 7 Dashon 2024-06-12 12:44:27 UTC
Created attachment 170414 [details]
hotspot flamegraph firefox playback
Comment 8 Dashon 2024-06-12 12:49:14 UTC
Sorry wrong report
Comment 9 Dashon 2024-08-04 03:56:07 UTC
Would help to upload a copy of my perf.data file?
Comment 10 TraceyC 2024-10-22 20:33:17 UTC
*** Bug 493769 has been marked as a duplicate of this bug. ***
Comment 11 TraceyC 2024-10-22 23:15:54 UTC
I have a KDE Neon Stable VM that has this issue. It was suffering from the same thing previously, but the high CPU usage went away (probably from the fix in bug 493295) and has returned in the last few days.

kwin_wayland takes 180-200% CPU from system start, and then continuously

I've got hotpot installed, but I'm not sure how to get data out of it that would be useful. If I can provide data from it, just let me know what you need.

Plasma 6.2.1
Frameworks 6.7.0
Qt 6.7.2
Wayland

Given that I'm seeing constant high CPU usage, my system might have a different root cause.
Comment 12 Oded Arbel 2024-10-23 14:04:25 UTC
(In reply to TraceyC from comment #11)
> I've got hotpot installed, but I'm not sure how to get data out of it that
> would be useful. If I can provide data from it, just let me know what you
> need.

I tried `hotspot`, but for some reason it won't let me attach to `kwin_wayland` - only to `kwin_wayland_wrapper` and when I do that I get no results (I think because `kwin_wayland_wrapper` doesn't actually do anything unless `kwin_wayland` crashes).

You can use `perf` to generate the call trace data directly, and then - if you want - you can load it in hotspot. I use this command to capture 60 seconds of execution data:

sudo perf record -F 1000 -p $(pidof kwin_wayland) -g -- sleep 60
Comment 13 TraceyC 2024-10-23 19:58:48 UTC
Thanks Oded.
Here's the data I got from the VM, let me know if you want any other data.


Samples: 113K of event 'cycles:P', Event count (approx.): 333196569442
  Children      Self  Command          Shared Object                 Symbol
+   49.66%     0.00%  llvmpipe-1       libc.so.6                     [.] clone3
+   49.66%     0.00%  llvmpipe-1       libc.so.6                     [.] start_thread
+   49.66%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17c51d6fc
+   49.65%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb485b7
+   49.56%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4836b
+   49.46%     0.00%  llvmpipe-0       libc.so.6                     [.] clone3
+   49.46%     0.00%  llvmpipe-0       libc.so.6                     [.] start_thread
+   49.46%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17c51d6fc
+   49.43%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb485b7
+   49.33%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4836b
+   40.21%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb47d91
+   40.13%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb47d91
+    6.60%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4a3e6
+    6.53%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4a3e6
+    3.93%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4a9c4
+    3.86%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4a9c4
+    3.00%     2.98%  llvmpipe-1       [JIT] tid 2605                [.] 0x000079a186696d60
+    2.99%     2.96%  llvmpipe-0       [JIT] tid 2605                [.] 0x000079a186696d60
+    1.41%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb488d6
+    1.30%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb488d6
+    1.24%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4ae57
+    1.21%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4ae57
+    1.14%     1.13%  llvmpipe-1       [JIT] tid 2605                [.] 0x000079a17e5f57a9
+    1.12%     1.11%  llvmpipe-0       [JIT] tid 2605                [.] 0x000079a17e5f57a9
+    1.06%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb49b46
+    1.05%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb49b46
+    0.82%     0.00%  kwin_wayland     kwin_wayland                  [.] _start
+    0.82%     0.00%  kwin_wayland     libc.so.6                     [.] __libc_start_main@@GLIBC_2.34
+    0.82%     0.00%  kwin_wayland     libc.so.6                     [.] __libc_start_call_main
+    0.82%     0.00%  kwin_wayland     kwin_wayland                  [.] main
+    0.82%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QCoreApplication::exec()
+    0.82%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QEventLoop::exec(QFlags<QEventLoop::Proces
+    0.82%     0.00%  kwin_wayland     libQt6Gui.so.6.7.2            [.] QUnixEventDispatcherQPA::processEvents(QFl
+    0.82%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QEventDispatcherUNIX::processEvents(QFlags
+    0.81%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] 0x000079a195264d34
+    0.80%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QCoreApplication::notifyInternal2(QObject*
+    0.80%     0.00%  kwin_wayland     libQt6Widgets.so.6.7.2        [.] QApplicationPrivate::notify_helper(QObject
+    0.77%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QObject::event(QEvent*)
+    0.77%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QTimerInfoList::activateTimers()
+    0.77%     0.00%  kwin_wayland     libQt6Core.so.6.7.2           [.] QTimer::timeout(QTimer::QPrivateSignal)
+    0.77%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::RenderLoopPrivate::dispatch()
+    0.77%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::RenderLoop::frameRequested(KWin::Ren
+    0.77%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::WaylandCompositor::composite(KWin::R
+    0.72%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4b570
+    0.72%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb49fce
+    0.72%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4b570
+    0.69%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb49fce
+    0.69%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4ade0
+    0.66%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4b5ec
+    0.65%     0.00%  llvmpipe-1       kms_swrast_dri.so             [.] 0x000079a17cb4b4cf
+    0.65%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4ade0
+    0.64%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4b4cf
+    0.62%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::Compositor::paintPass(KWin::RenderLa
+    0.62%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::SceneDelegate::paint(KWin::RenderTar
+    0.62%     0.06%  llvmpipe-0       [kernel.kallsyms]             [k] asm_exc_page_fault
+    0.62%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::WorkspaceScene::paint(KWin::RenderTa
+    0.61%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::WorkspaceScene::paintSimpleScreen(KW
+    0.61%     0.07%  llvmpipe-1       [kernel.kallsyms]             [k] asm_exc_page_fault
+    0.60%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::WorkspaceScene::paintWindow(KWin::Re
+    0.60%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::ItemRendererOpenGL::renderItem(KWin:
+    0.59%     0.00%  llvmpipe-0       kms_swrast_dri.so             [.] 0x000079a17cb4b5ec
+    0.55%     0.00%  llvmpipe-0       [kernel.kallsyms]             [k] exc_page_fault
+    0.54%     0.00%  llvmpipe-0       [kernel.kallsyms]             [k] do_user_addr_fault
+    0.53%     0.00%  llvmpipe-1       [kernel.kallsyms]             [k] exc_page_fault
+    0.52%     0.00%  llvmpipe-1       [kernel.kallsyms]             [k] do_user_addr_fault
     0.50%     0.01%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::ItemRendererOpenGL::createRenderNode
     0.48%     0.00%  kwin_wayland     libkwin.so.6.2.1              [.] KWin::SurfaceItem::preprocess()
Comment 14 TraceyC 2025-04-15 16:31:18 UTC
Is anyone still seeing this issue on their systems? This is not an issue anymore on the KDE Neon User VM
Comment 15 TraceyC 2025-04-22 19:33:42 UTC
*** Bug 503184 has been marked as a duplicate of this bug. ***
Comment 16 TraceyC 2025-04-22 19:34:40 UTC
Another user just reported the same issue, setting back to reported
Comment 17 Adam 2025-06-07 09:50:23 UTC
as of today on Arch it still persist:
kwin_wayland --version
kwin 6.3.5

after killall kwin_wayland session restarts without this weird load. 

If guided, I'm willing to provide any necessary information to finally solve this
Comment 18 Adam 2025-06-08 19:36:54 UTC
I have made small discovery reg. this issue. kwin_wayland may not be fully responsible for this... 
I have 3 apps on autostart, ROG Control Center, pCloud and Bitwarden. Till now I taught this high CPU is since start but at least in my case its start when I start Biwarden... (electron app) and stays high even after I close Bitwarden. 

Maybe this will help to investigate this someone a bit better.
Comment 19 MathieuM 2025-07-01 09:00:04 UTC
Hi,
I have just installed openSuse with KDE Wayland and Plasma 6.4 and had this issue after my first restart.
Here is a pic of my htop: https://imgur.com/a/xkBwocm
Comment 20 TraceyC 2025-07-01 16:06:36 UTC
Created attachment 182840 [details]
htop screenshot

I'm attaching the htop screenshot to this report so that it remains with the report, and can't get lost if the imgur post is deleted
Comment 21 TraceyC 2025-07-01 18:28:28 UTC
I'm not able to reproduce this in an openSUSE Tumbelweed 20250630 VM with Plasma 6.4.1
I left htop running in the VM for a few hours and kwin_wayland CPU usage was pretty low.

(In reply to MathieuM from comment #19)
> I have just installed openSuse with KDE Wayland and Plasma 6.4 and had this
> issue after my first restart.

Please let us know which version of openSUSE you have installed. Is it Tumbleweed? Also please let us know the output of 

kinfo

Thanks!
Comment 22 MathieuM 2025-07-02 10:39:00 UTC
(In reply to TraceyC from comment #21)
> I'm not able to reproduce this in an openSUSE Tumbelweed 20250630 VM with
> Plasma 6.4.1
> I left htop running in the VM for a few hours and kwin_wayland CPU usage was
> pretty low.
> 
> (In reply to MathieuM from comment #19)
> > I have just installed openSuse with KDE Wayland and Plasma 6.4 and had this
> > issue after my first restart.
> 
> Please let us know which version of openSUSE you have installed. Is it
> Tumbleweed? Also please let us know the output of 
> 
> kinfo
> 
> Thanks!

Hello and thanks for the attachment of htop to the post.
As a disclaimer, this issue caused me to switch over to KDE Neon, but I have booted up a VM to try and repo, as well as give you required info. I apologize for the double kinfo, but I do not know which settings are most relevant, so I don't want to merge them myself :)


I used OpenSUSE Tumbleweed 20250630. 

For the result of kinfo, this is what I have in VM (OpenSUSE Tumbleweed):
Operating System: openSUSE Tumbleweed 20250630
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.3-2-default (64-bit)
Graphics Platform: X11
Processors: 3 × AMD Ryzen 5 7600X 6-Core Processor
Memory: 7.7 GiB of usable RAM
Graphics Processor: llvmpipe

And in my current physical machine (KDE Neon User Edition):
libEGL warning: egl: failed to create dri2 screen
ERROR:             VkInstanceCreateInfo::pApplicationInfo::apiVersion has value of 0 which is not permitted. If apiVersion is not 0, then it must be greater than or equal to the value of VK_API_VERSION_1_0 [VUID-VkApplicationInfo-apiVersion]
Operating System: KDE neon User Edition
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.0
Kernel Version: 6.11.0-29-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor
Memory: 32 GiB of RAM (30.4 GiB usable)
Graphics Processor 1: NVIDIA GeForce RTX 2070
Graphics Processor 2: AMD Radeon Graphics

I'll keep trying to repro, will post journalctl if that happens :)
Comment 23 MathieuM 2025-07-02 10:45:10 UTC
(In reply to MathieuM from comment #22)
> (In reply to TraceyC from comment #21)
> > I'm not able to reproduce this in an openSUSE Tumbelweed 20250630 VM with
> > Plasma 6.4.1
> > I left htop running in the VM for a few hours and kwin_wayland CPU usage was
> > pretty low.
> > 
> > (In reply to MathieuM from comment #19)
> > > I have just installed openSuse with KDE Wayland and Plasma 6.4 and had this
> > > issue after my first restart.
> > 
> > Please let us know which version of openSUSE you have installed. Is it
> > Tumbleweed? Also please let us know the output of 
> > 
> > kinfo
> > 
> > Thanks!
> 
> Hello and thanks for the attachment of htop to the post.
> As a disclaimer, this issue caused me to switch over to KDE Neon, but I have
> booted up a VM to try and repo, as well as give you required info. I
> apologize for the double kinfo, but I do not know which settings are most
> relevant, so I don't want to merge them myself :)
> 
> 
> I used OpenSUSE Tumbleweed 20250630. 
> 
> For the result of kinfo, this is what I have in VM (OpenSUSE Tumbleweed):
> Operating System: openSUSE Tumbleweed 20250630
> KDE Plasma Version: 6.4.1
> KDE Frameworks Version: 6.15.0
> Qt Version: 6.9.1
> Kernel Version: 6.15.3-2-default (64-bit)
> Graphics Platform: X11
> Processors: 3 × AMD Ryzen 5 7600X 6-Core Processor
> Memory: 7.7 GiB of usable RAM
> Graphics Processor: llvmpipe
> 
> And in my current physical machine (KDE Neon User Edition):
> libEGL warning: egl: failed to create dri2 screen
> ERROR:             VkInstanceCreateInfo::pApplicationInfo::apiVersion has
> value of 0 which is not permitted. If apiVersion is not 0, then it must be
> greater than or equal to the value of VK_API_VERSION_1_0
> [VUID-VkApplicationInfo-apiVersion]
> Operating System: KDE neon User Edition
> KDE Plasma Version: 6.4.1
> KDE Frameworks Version: 6.15.0
> Qt Version: 6.9.0
> Kernel Version: 6.11.0-29-generic (64-bit)
> Graphics Platform: Wayland
> Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor
> Memory: 32 GiB of RAM (30.4 GiB usable)
> Graphics Processor 1: NVIDIA GeForce RTX 2070
> Graphics Processor 2: AMD Radeon Graphics
> 
> I'll keep trying to repro, will post journalctl if that happens :)

kinfo (VM OpenSUSE, but with Wayland, as it was for my bug...):

libEGL warning: egl: failed to create dri2 screen
Operating System: OpenSUSE Tumbleweed 20250630
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.3-2-default (64-bit)
Graphics Platform: Wayland
Processors: 3 × AMD Ryzen 5 7600X 6-Core Processor
Memory: 7.7 GiB of usable RAM
Graphics Processor 1: llvmpipe
Comment 24 Bug Janitor Service 2025-07-17 03:47:23 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 25 Adam 2025-07-17 07:54:48 UTC
this issue still persists - reseting status to REPORTED