1

I am using Debian 10 (buster), 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux on my Lenovo T530 laptop which has a i7-3630QM. It has been many years since I bothered with frequency scaling and temperature but as of late it has become a bit of a problem.

When I try to run CPU intensive applications the CPU can get very hot for longer periods of time, I am talking above 100°C. Now this laptop is more than eight years old and I'm not sure how much longer it's going to last so I want to

  1. Have it last as long as possible and
  2. Reduce the noise pollution since the fan gets rather loud at high loads and temperatures.

Years ago there were several governors that could be used to do this so I was surprised that now there is only powersave and performance. I tried to use cpupower to set a maximum frequency of e.g. 2.4GHz: cpufreq-set -u 2.4GHz.

Unfortunately that does not seem to really work. cpupower frequency-info reports

 current policy: frequency should be within 1.20 GHz and 2.40 GHz. The governor "powersave" may decide which speed to use within this range. 

but when I start a CPU intensive applications (especially one that is in need of 3D graphics acceleration), in my case the game "Stellaris", the CPU gets really hot nevertheless, which is not surprising since cpupower frequency-info reports

 hardware limits: 1.20 GHz - 3.40 GHz available cpufreq governors: performance powersave current policy: frequency should be within 1.20 GHz and 2.40 GHz. The governor "powersave" may decide which speed to use within this range. current CPU frequency: Unable to call hardware current CPU frequency: 3.30 GHz (asserted by call to kernel) 

which actually contradicts itself.

Now this issue has been discussed e.g. in this issue and the author resolves it in his answer. However, some people have commented that this does not work. In my case it does not work either. Another poster in this issue writes in his answer that this does not work either and actually links to a kernel document where it states that it is actually not possible to reliably set the frequency.

The fans of my laptop have been cleaned recently and new thermal paste has been applied but as I stated this machine is old and gets hot nevertheless. A different poster suggested setting the maximum load to a lower percentage, which actually works but does not rectify my problem since the CPU gets really hot nevertheless.

Does anyone know of a different, reliable way to limit the CPU frequency? In the aforementioned example, Stellaris, I think I noticed that the CPU tried to limit the frequency to the set value of 2.4GHz while the game was loading and while I was in the main menu. Once I loaded a save file and was in the game itself it spiked to its maximum frequency. Is it possible that the application itself overrides these values?

Does anyone know of any other way to throttle the CPU from reaching such high temperatures? E.g. is it possible to set a lower temperature threshold for when the CPU starts throttling itself?

10
  • 1
    Please try this script: github.com/birdie-github/useful-scripts/blob/master/cpumode via cpumode -s It's written by me, it's safe to use. Commented May 22, 2021 at 12:53
  • 1
    If you don't mind installing an extra package, I can recommend corectrl. Commented May 22, 2021 at 18:34
  • 1
    Try using acpi-cpufreq intead of intel_pstate : silvae86.github.io/2020/06/13/switching-to-acpi-power Commented May 24, 2021 at 18:46
  • 1
    You may want to file a bug report against intel_pstate along with the steps to repro the issue: bugzilla.kernel.org/enter_bug.cgi?product=Power%20Management Other users of similar CPUs will be grateful. Either the driver is not compatible with your IvyBridge CPU or it's missing something to support it. In any case, a bug report is really important. Commented May 25, 2021 at 17:50
  • 1
    Intel claims the intel_pstate driver supports all Intel Core CPUs starting with Sandy Bridge which is clearly not the case for you. A bug report could be useful. Commented May 25, 2021 at 20:28

1 Answer 1

4

Thanks to Artem S. Tashkinov I was able to resolve the problem. He wrote in a comment

Try using acpi-cpufreq intead of intel_pstate : https://silvae86.github.io/2020/06/13/switching-to-acpi-power

and that did the trick.

I had to install the acpi_cpufreq driver (in my case it was already installed) via apt-get

apt-get install acpi-support acpid acpi 

and edit /etc/default/grub by adding intel_pstate=disable to GRUB_CMDLINE_LINUX_DEFAULT, like so (in my case):

GRUB_CMDLINE_LINUX_DEFAULT="quiet nosplash debug intel_pstate=disable" 

Then run update-grub and restart the machine. Consequently the intel_pstate driver is not used anymore and acpi_cpufreq is used in its stead. Apart from having many more governors to chose from (you can read here about them) and most of all I can now turn on the ondemand governor and set a minimum and maximum frequency. And it is kept that way. In my case I used

cpupower frequency-set -g ondemand -d 1.2GHz -u 2.0GHz 

and so far the machine hasn't gotten too hot.

[edit] After still experiencing temperature problems I figured out what the problem is. It's the GPU frequency and the fact that this problem still occurred when using 3D applications. In /sys/kernel/debug/dri/0/i915_ring_freq_table you can see the max frequency the GPU can run at corresponding to a max CPU frequency. After setting the CPU frequency the GPU frequency has to be adjusted as well in /sys/class/drm/card0/gt_max_freq_mhz and in /sys/class/drm/card0/gt_boost_freq_mhz.

6
  • 1
    I'm still looking forward to a bug report from you :-) Commented May 27, 2021 at 15:55
  • Unfortunately it looks like switching to acpi_cpufreq did not solve this problem. I now upgraded to Debian testing where I have also access to cpupower-gui and the system just disregards what I choose. I can switch to powersave, 1.2 GHz to 2.0 GHz and it does not work. The CPU still clocks at maximum. Commented Jun 3, 2021 at 16:37
  • I think I finally found the problem. This behaviour occurs when using 3D applications, i.e. when the internal GPU is being used. The problem was the GPU frequency. In /sys/kernel/debug/dri/0/i915_ring_freq_table you can see the max frequency the GPU can run at corresponding to a max CPU frequency. After setting the CPU frequency the GPU frequency has to be adjusted as well in /sys/class/drm/card0/gt_max_freq_mhz and in /sys/class/drm/card0/gt_boost_freq_mhz. Commented Jun 7, 2021 at 6:46
  • 1
    This sounds quite ... unusual. I've had lots of laptops and PCs with Intel integrated graphics and CPU frequency could always be regulated independently from iGPU frequency. Commented Jun 7, 2021 at 8:54
  • I agree, it's quaint. The CPU freq I set is considered when not running 3D applications that use the video card. That is what lead me to this issue and this link as well as this issue. GPU clock is tied to CPU for some reason and certain GPU clocks can be only achieved by a min. CPU clock. Is that a bug/feature? Shall I still file that bug report? Commented Jun 7, 2021 at 12:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.