Fans speed up when screen locks on KDE plasma

(Manjaro Linux, updated today, KDE Plasma 6.2.5, KDE framework 6.10.0, kernel 6.12.12-2-manjaro, Framework Laptop 16 AMD Ryzen 9 7940HS w/ Radeon 780M)

The system is working great, fans are around 1000 rpm on normal load when the system is in use:

inxi -s
Sensors:
System Temperatures: cpu: 61.9 C mobo: 48.9 C
Fan Speeds (rpm): fan-1: 1083 fan-2: 1081
GPU: device: amdgpu temp: N/A device: amdgpu temp: 38.0 C fan: 0

However, when I manually lock the system or wait for the screen lock/blanking to kick in, the fans speed up and stay there until the screen is unlocked again. Here the output of inxi right after unlocking the laptop:

inxi -s
Sensors:
System Temperatures: cpu: 60.9 C mobo: 42.9 C
Fan Speeds (rpm): fan-1: 2708 fan-2: 2593
GPU: device: amdgpu temp: 30.0 C fan: 0 device: amdgpu temp: N/A

As you can see, no change in temperature, but the fan speeds more than double.

Any idea what causes this?

I did check baloo btw, it says indexing is done - and also completely halting it before locking the machine does not help.

Logging the process activity while locked also suggests it is not any actual CPU activity that leads to increased fan speed. And the general journal log also gives no clues. The increased fan speed also starts immediately after the login screen disappears from the lock screen and continues unchanged until successfully logging back in. Moving the mouse or keyboard inputs do not affect it, screen blank or not does not affect it.

Is there a subsystem that I can tell to increase logging verbosity or something like that to get some more info on what is influencing the fan speed?

Is KDE/Plasma actively controlling the fan speed and stops doing that when locked? To my knowledge there is now a kernel module that takes care of fans and overheating, right? It has been years since I had to actively do anything about that on linux, using lm_sensors I remember, so I thought that was not necessary anymore?

Thanks for any help!

It is not clear whether the fan speed increase is spontaneous or due to CPU load and temps increase. My guess is a process is ramping CPU usage when the screen is locked, seem more likely.

You can use plasma-systemmonitor with its history tab to see the evolution over time. And process view and application views have graphs pre-app/process for CPU usage. That should allow you to determine what is causing the issue.
Plasma-systemmonitor became less CPU consumming in Plasma 6.3, like from ~10%CPU to 0.5-2.5% CPU.

There is also Mission Center, that people have reported like a good option.

Your cpu frequency scaling might also be an explanation.

1 Like

Thanks @meven I did some more investigation: plasma-systemmonitor did actually show an overall increase in CPU usage that I didn’t notice with my previous checks, and after some logging with ps --sort=-cpu I eventually found this unresolved bug:

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

This fits, and while unresolved there are workarounds like switching to a console tty (Ctrl-Alt-F1) while the screen is locked or triggering a restart of kwin_x11 once during a session with systemctl --user restart plasma-kwin_x11.service

Quoting 489230 – Excessive amount of _NET_DESKTOP_GEOMETRY PropertyChange slow down the entire Xorg

The XCB_RANDR_NOTIFY_OUTPUT_CHANGE events come directly from Xorg, it doesn’t appear like Qt or KWin do something wrong with the events. I suspect that it might be a Xorg bug.

This seems like a tricky one to solve :upside_down_face:

Yep. I will try switching to wayland again when I get some time :upside_down_face: