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

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 :-) May 27 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.
    – crow
    Jun 3 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.
    – crow
    Jun 7 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. Jun 7 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?
    – crow
    Jun 7 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.