Bug 429152

Summary: Graphs can consume excessive CPU resources on platforms with weak Intel GPUs and high-resolution displays
Product: [Frameworks and Libraries] frameworks-kquickcharts Reporter: Nate Graham <nate>
Component: generalAssignee: Arjen Hiemstra <ahiemstra>
Status: CONFIRMED ---    
Severity: normal CC: ahiemstra, francoisprunier, herzenschein, kde, kde, kdelibs-bugs, peter.eszlari, plasma-bugs, till2.schaefer
Priority: NOR    
Version: 5.78.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Higher CPU usage

Description Nate Graham 2020-11-15 14:35:48 UTC
Created attachment 133360 [details]
Higher CPU usage

See attached screenshot.

Unfortunately this cuts to the core of its existence; a system monitoring app should be as lightweight as possible to avoid mutating what it's measuring.

CPU: Intel i7-10510U
GPU: Intel UHD Graphics 620
Display: 4k (perhaps taxing to the GPU which then offloads work to the CPU?)
Comment 1 Peter Eszlari 2021-01-23 07:11:08 UTC
Why was the app included in the 5.21 beta announcement, with such severe shortcoming not fixed?

https://kde.org/announcements/plasma/5/20.90/
Comment 2 David Edmundson 2021-02-04 14:37:56 UTC
230Mb is not an accurate reflection on usage. We have fixed some severe memory leaks since then.
Comment 3 Nate Graham 2021-02-04 16:27:22 UTC
This bug is about CPU usage, not memory. The memory usage has indeed been improved since this bug was filed, but the CPU usage has not for me. I'm consistently seeing double the CPU usage of KSysGuard.

I suspect it's my underpowered Intel iGPU stealing CPU power to make up for inadequate GPU power, given that the UI is now QML and benefits from hardware-accelerated rendering.
Comment 4 David Redondo 2021-02-08 09:56:55 UTC
I have an even worse CPU in my laptop, an Intel i3-7100U with HD graphics 620, and plasma-systemmonitor (going to processes page) and ksysguard both use similiar amount of CPU. Typically around 1.5%-3% sometimes plasma-systemmonitor uses more, sometimes ksysguard. But I see no huge differences just  by having both open and idling
Comment 5 Nate Graham 2021-02-08 16:01:09 UTC
I have no proof, but I suspect it happens to be related to the screen resolution. My laptop has a 4k screen which the GPU doesn't seem to be able to drive adequately on its own without offloading some of the work onto the CPU.

Of course, if this is correct, then there's nothing we can really do about it from the KSysGuard side. :/
Comment 6 Arjen Hiemstra 2021-02-08 16:13:57 UTC
It might be useful to run some performance analysis on it, but I suspect you are right. One thing you could try is setting the CPU column to not display inline charts. If that helps, at least we have confirmed GPU stuff is being moved to the CPU.
Comment 7 Peter Eszlari 2021-02-08 19:25:04 UTC
(In reply to Nate Graham from comment #5)
> I have no proof, but I suspect it happens to be related to the screen
> resolution. My laptop has a 4k screen which the GPU doesn't seem to be able
> to drive adequately on its own without offloading some of the work onto the
> CPU.

I'm certainly no GPU expert, but I'm wondering if that's really the case. Isn't a desktop environment just a bunch of "2D textures" that get moved around? Considering what kind of complex 3D games you can play even on lower spec GPUs today, it should be able to handle rendering the desktop at 60 fps.

Maybe you should benchmark Windows 10 on the same laptop to get an idea of what's possible?
Comment 8 Nate Graham 2021-02-08 22:09:47 UTC
Yep, with the inline graph disabled, CPU usage actually drops to below that of Ksysguard! Since the graph is hardware-accelerated, I guess that supports my theory.

Moving to the graphing framework.
Comment 9 Nate Graham 2021-11-10 18:36:55 UTC
*** Bug 445270 has been marked as a duplicate of this bug. ***
Comment 10 Peter Eszlari 2023-02-24 13:45:29 UTC
Maybe switching to Qt6's Vulkan backend will be enough to fix this in the future.
Comment 11 Thiago Sueto 2024-03-01 15:26:37 UTC
I have the same Intel UHD Graphics 620 and I also have a Radeon R7 M445 as dGPU on my laptop, and the CPU usage results are still bad for me on Plasma 6: starts at 15%, stabilizes between 8%-13% with a max peak of 17%.

Reducing the refresh times of all elements on the page does not help.