[RESPONDED] How to configure thermald on Debian on 12th Gen

I have a 12th Gen, running Debian.

When even just a couple of the processors are running at 100% for about 15 seconds or more, the CPU package temp hits 100C and stays there.

I once on a video call had the system actually experience thermal shutdown.

Obviously, I’m not happy with the lappy being so hot, and I don’t need it to be.

I’ve been thinking about a solution for a little while and have slowly investigated and now have installed thermald, which does not work out of the box.

Firstly, the systemd service file has options passed to thermald which seem to stop it running, I suspect because some /proc interfaces thermald would like also are not yet present.

As such, systemctl start does not work, out of the box.

When you run it manually, from the command line, by using the “–no-daemon” option, you then fine it does not recognize the 12th Gen processor.

You can get thermald to actually run from the command line by passing in some arguments to ignore these issues, but then thermald for me has has effect; in my case, I still go to 100C just as before.

The upshot of this is that you need to create your own thermald configuration file, and then edit the systemd service file.

Creating your own thermald configuration file is not straightforward.

I looked into it, it’s a complex XML file, you have to learn quite a bit and figure out how to get detailed information from your system about what devices and cooling devices you have.

However, there is a third-party (open source) utility to create it for you.

Unfortunately, quite recently, it seems that utility has stopped being supported - but it still seemed to work just fine for me, and it created five different configuration files (this is normal - apparently sometimes this happens, I think you’re getting options about how much cooling you want) and the third of these files keeps my system at 70C.

The utility is called dpifxtract and is here;

I downloaded the zip file and simply ran it (as root, as it copies files into /etc/thermald), no arguments needed.

If you’re running on a 12th Gen, I expect you to get five config files;

. thermal-conf.xml.0
. thermal-conf.xml.1
. thermal-conf.xml.2
. thermal-conf.xml.3
. thermal-conf.xml.auto

These have also been placed in your /etc/thermald directory (and also dumped into the currency directory).

For me, only thermal-conf.xml.3 made a difference. I deleted the other files, and renamed it “thermal-conf.xml”, as this is the filename used by default by thermald.

Now, finally, we need to adjust the systemd service file for thermald, because as it was when I installed it, thermald would not start (I could run it from the command line only, with the “–no-daemon” option).

Now, I know little about systemd so there is a possibility I be going about this the wrong way.

The path to the file is /etc/systemd/system/thermald.service

Under “[Service]”, you need to edit “ExecStart”.

Mine is now as so;

ExecStart=/usr/sbin/thermald --systemd --dbus-enable --poll-interval=1

In particular, the argument “–adaptive” seems to stop thermald from starting, I suspect because of missing /proc stuff.

The default poll interval is four seconds, I’ve changed this to one, which is just my preference.

That’s it.

If you’ve done all that, on a 12th Gen running latest Debian, you should now max out at 70C.

1 Like

You know, this has helped me a lot. I have a 12th Gen i5-1240p Framework and the only thing I’m actually displeased of is the temperatures. They are just too high. After i did this exact thing i find that my temps if they go over 76C-80ish, they get dialed back a bit and preventing it from coming close to TJ Max which AFAIK is 100c for this chip. I don’t know where or how this issue will get resolved, but this definitely did it for me. I used tlp or auto-cpufreq (tlp works better for me) and thermald as somewhat of a cealing for the temps. I tested this playing countless of games with a 60fps cap and the temperatures are good, and the core frequencies seem to be stabilized around 1.50-2ghz but my games run well. I am curious to know if Framework is aware of this and if they will do some type of fix or correction.

This reply has led me to re-read my original post and there are a couple of typing errors - missing words in some cases, which significantly detract from, and render confusing, the post.

I’d like to correct all the errors, but I cannot see any way to edit the post?

1 Like

Hi @Xenophon , there should be a pencil icon at the bottom of your post, if it’s not showing click the three dotted icon to show more. :slight_smile:

1 Like

Reading this re-write i can say that in my case, using Tumbleweed, The temps (with the .3 xml that is) get around 70-86ish Celsius, More than likely due to my location, is very very hot here. As for the systemd unit file, which on TW is:
/usr/lib/systemd/system/thermald.service.
The adaptive option seems to not make the service stop so i left it as is and just added the polling option, even though i have no idea what it does but i suspect that for me personally i wont see much of a difference.

Anyways, I’m choosing to expand on this as well for anyone that may just experience this issue, and i suspect a lot of people are AFAIK, these alder lake chips are very hot. This may indeed be normal for the type of chip it is but i personally don’t feel comfortable with it being so hot on a laptop. I think something like this can be managed with some type of kernel patch? don’t know, but thank you for writing this post I really appreciate it! :smile:

PS: This heat issue is the same on Fedora

Hi @Xenophon , there should be a pencil icon at the bottom of your post, if it’s not showing click the three dotted icon to show more. :slight_smile:

Yes. The edit icon is not present - this is what prompted my question.

So, I’ve noticed recently my laptop getting up to 100C again, and I’ve concluded that at some point, this method of managing temperature has stopped working. I would guess from Debian upgrades.

I’m now trying to figure out a replacement. Thermald is difficult to work with, as it looks to me like it requires knowledge of other tools to obtain the information needed to write its complex configuration file, and those tools are not in the thermald documentation even indicated.

Couple of findings from today.

The “–adaptive” option to thermald causes the configuration file not to be loaded. In this state, I have no idea how thermald decides what temp limits to use. I speculate it could relate to the values obtained and potentially set by the sensors utility.

I’ve been trying to use sensors, to configure the max and crit temperatures for the processor package and processors. I have been unable to do so.

I can modify the adjustments made when reading or writing temperature data (the compute command), but this doesn’t give me what I need. I have not been able to actually set the high and/or crit temperatures (the sensors -s command, which applies set commands, reports errors for every set line).

BTW, this forum software is incredibly irritating as always it was. It deliberately distracts and/or interrupts with guidance/advice/popups while a user is in the middle of composition. This is absolutely crazy.

This temperature issue is critical and central to actual, normal use of the laptop.

I can’t have the temp sitting there at 100C, with the fan at maximum speed, when playing a game or a video. The laptop without thermal control cannot be used for a range of normal functions.

So, I’ve found a viable work-around.

There is a Debian package, linux-cpupower (which supersedes cpufrequtils).

This provides two commands, turbostat and cpupower.

The latter, cpupower, can be used to set the maximum clock speed of the processors. I have set this to 2.0 GHz. Temp now maxes out at about 75C.

I’ve not checked yet to see if this survives reboot.

The other change I’m thinking to max is to disable the efficiency cores. I kinda have the feeling Linux is using them as if they were normal cores - no special handling - and I suspect I may do better, overall, due to thermal constraints, with just the four full cores.

1 Like

Ah also note, I’ve read that thermald as of 2.0 (Debian currently is on 2.5) has built-in functionality to read information from the hardware/system about cooling devices, thermal zones and so on, and this is why dptfxtract was retired.

However, it is not clear to me, if you want to manually configure thermald (which seems to me currently to be the only way to set lower temperatures than the default of 100), how you enumerate all the devices/zones/etc in your system, so you can compose the thermald configuration file. So that seems a dead end.

Thermald now ATM seems to me to have no value. I’m running it with --adapative, and as far as I can see it makes no difference. I have as such disabled it. The temp limits I now have come from limiting max processor clock to 2.0 GHz.