Bug 478974

Summary: plasma-systemmonitor uses ~70% cpu on the overview page with llvmpipe graphics driver
Product: [Applications] plasma-systemmonitor Reporter: bjorn3_gh
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal CC: ahiemstra, nate, nicolas.fella, plasma-bugs-null
Priority: NOR Keywords: qt6
Version First Reported In: 5.91.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot of the issue
Hotspot analysis

Description bjorn3_gh 2023-12-24 20:47:38 UTC
Created attachment 164429 [details]
screenshot of the issue

SUMMARY
The system monitor uses ~70% of the cpu.


STEPS TO REPRODUCE
1. Download KDE Neon unstable 2023-12-24 (neon-unstable-20231224-1120.iso)
2. Run in a qemu vm with 4 cores and 4GB of memory and virtio-gpu graphics and KVM vm hardware acceleration: `qemu-system-x86_64 -cpu max -machine q35,accel=kvm -m 4096 -smp 4 -device virtio-net,netdev=net0 -netdev user,id=net0 "$@" -cdrom ~/Downloads/neon-unstable-20231224-1120.iso -chardev stdio,mux=on,id=char0  -mon chardev=char0,mode=readline -vga virtio`
3. Run the system monitor inside the vm.

OBSERVED RESULT
The system monitor uses ~70% of the cpu.

EXPECTED RESULT
The system monitor uses at most 1-2% of the cpu.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.91.90
KDE Frameworks Version: 5.248.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION
https://bugs.kde.org/show_bug.cgi?id=475951 seems related, but that talks about cpu usage spikes, while for me it is consistently high cpu usage.
Comment 1 Nicolas Fella 2023-12-27 14:20:59 UTC
This happens when the llvmpipe graphics driver is used
Comment 2 Nicolas Fella 2023-12-27 14:22:46 UTC
Created attachment 164476 [details]
Hotspot analysis
Comment 3 Arjen Hiemstra 2024-02-01 16:44:26 UTC
The charts used by System Monitor use GPU based rendering, which means that LLVMpipe needs to emulate all the shader logic normally done by a GPU. This is pretty heavy for most CPUs, so you end up with a lot of CPU usage. There is not a whole lot we can do about that, as can be seen in the hotspot screenshot most of the time is taken by the LLVMpipe rasterizer.