Ubuntu – Imac with Ubuntu (Lubuntu 20.04) – Controlling fan speed

fancontrolmac

The situation

I switched an old Imac (2008) to Lubuntu. While it runs smoothly for all I need to do, 20 minutes after starting the CPU fan starts to get super loud. Here is a screenshot of psensor: psensor screenshot
psensor screenshot

Basically, 2 sensors, TD0D and temp1 see an increase in temperature until reaching 105°C, which triggers the increase of the CPU fan speed. This fan gradually accelerate until its max, 3600 RPM, which makes the imac very loud. This do lower the temp of these 2 sensors, until aournd 80°C, but this is not cool enough to reduce the fan speed.

This is annoying because I think with a fix speed set to 2000 RPM for example, the temp would stabilise at an acceptable temperature, hopefully below 90°C, while the noise would still be acceptable.

What I tried so far

I tried to follow the steps described here: How to control fan speed?, so basically set up lm-sensors, then set up fancontrol with the help of pwmconfig But pwmconfig answers: There are no pwm-capable sensor modules installed Even after adding the module applesmc to /etc/modules and rebooting, no chance.

I also tried to install mbpfan: https://github.com/linux-on-mac/mbpfan But it is meant for macbooks and not for imacs, with the result that only one sensor seems to be taken into account, then all fan speed are raised simultaneously, which is not helping in my case (see https://github.com/linux-on-mac/mbpfan/issues/211)

What I think could work but not sure how

pwmconfig is "just" a helper to create the fancontrol settings file. So I could simply make this settings file myself and set up a min speed of 200 RPM for the CPU fan. But I am not sure this can work, because maybe fancontrol can only control PWM fans and somehow imac fans are not PWM. Also, if it can work, I am unsure what should be the path of each fan to put in that file and whre I could find an example of settings file.

So: can fancontrol work? if not, do you have any other ideas?

Actually, I realise the problem seem to come from the GPU, since temp1 seems to be in the Radeon PCI section. My imac has a Radeon RV630 Graphic Card. Could it be that there is a better driver somewhere that would lead to it heating less? This is happening while browsing internet or even not doing anything, so it's not linked to complex graphics calculations…

here is the output of sensors if that helps

applesmc-isa-0300
Adapter: ISA adapter
ODD :         698 RPM  (min =  700 RPM, max = 4800 RPM)
HDD :        1229 RPM  (min = 1200 RPM, max = 5900 RPM)
CPU :        3602 RPM  (min = 1200 RPM, max = 3600 RPM)
TA0P:         +27.8°C  
TC0D:         +50.5°C  
TC0H:         +49.8°C  
TC0P:         +50.0°C  
TG0D:         +78.8°C  
TG0H:         +66.2°C  
TG0P:         +71.0°C  
TH0P:         +57.8°C  
TL0P:         +58.0°C  
TO0P:         +49.8°C  
ERROR: Can't get value of subfeature temp11_input: I/O error
TW0P:             N/A  
Tm0P:         +53.2°C  
Tp0P:         +82.8°C  

radeon-pci-0100
Adapter: PCI adapter
temp1:        +80.0°C  

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +49.0°C  (high = +105.0°C, crit = +105.0°C)
Core 1:       +59.0°C  (high = +105.0°C, crit = +105.0°C)

Thanks a lot for the help!

Best Answer

OK, I advanced a bit on my side, replying here in case it is one day helpful for someone else.

I found a way to control all 3 fans of my imac (cpu, HD, Optical Drive): macfanctld (see http://manpages.ubuntu.com/manpages/bionic/man1/macfanctld.1.html) I recompiled it with the change proposed here https://github.com/MikaelStrom/macfanctld/pull/11 because it was otherwise not controling the CPU fan.

So I can now control my 3 fans, set a min speed, a floor and a ceiling, which is a success!

But even with a high initial speed, I still get a burst some times after booting when the Tp0P sensor reaches 84 degrees. The CPU fan then increase its speed until the temp reduces, but there is a long delay for it to be effective, so usually 10 really loud minutes. I don't think I can change this value anywhere, which is sad because I think it really would not go much higher than this.

So I guess I will rather work on the cause: It is the Power Supply Unit (PSU) that is overheating, not the GPU as I previously stated. I am thinking about making holes in the case to reduce the heat passively, or to somehow install a new fan directly on the PSU. Doing a deep cleaning of the case and the PSU already won a few degrees.

Related Question