1. Betriebssysteme >
  2. Linux Tipps >
  3. Underclocking high-end mobile CPUs for cooler, better battery life, longer lifespan ultra-thin Linux laptops - Part 1


ArabicEnglishFrenchGermanGreekItalianJapaneseKoreanPersianPolishPortugueseRussianSpanishTurkishVietnamese

Underclocking high-end mobile CPUs for cooler, better battery life, longer lifespan ultra-thin Linux laptops - Part 1

RSS Kategorie Pfeil Linux Tipps vom | Quelle: reddit.com Direktlink öffnen

Preface

If you have an ultra-thin laptop with a high-end CPU, and your laptop's temperature is constantly high (>90oC) under heavy workload, this post is for you. In this wall of text, I will discuss how to underclock your high-end mobile CPU to get a much better temperature, longer battery life and better stability. The method suggested in this post could be deployed on it own or used in tandem with other power reduction method such as undervolting.

Background

1. Thermal Design Power

Both Intel and AMD, when design their CPUs, provide the Thermal Design Power -- the power corresponding to the maximum amount of heat generated by the CPU that the cooling system can cool down. When the CPU power reaches the value specified by the TDP, a protecting mechanism kicks in to reduce the power consumption (and heat) to prevent the hardware components from getting burned. The most popular mechanism is CPU clock throttling.

(To check for CPU throttle, run following command: $ journalctl | grep 'temp.*throttled')

2. CPU power consumption

The power consumption of a CPU can be described as [1]:

Pcpu = Pdyn + Psc + Pleak

While Psc and Pleak are more related to the fabrication process, Pdyn could be controlled by end user. To estimate the dynamic power consumption Pdyn, the CPU's CMOS gate can be modeled as a switch such that:

Pdyn = CV^2f (Eq.1) 

where C is the capacitor, V is the voltage and f is operating frequency of the CPU.

3. The Culprit

There are several factors that make the CPU hot. In this post, I am discussing two main sources of heat: Turbo Boost and highly compact semiconductor area.

1) Turbo Boost

Modern CPUs have a dynamic frequency scaling mechanism, namely Turbo Boost for Intel processors, which increases the operating frequency of the CPU under high-demanding workload. Turbo Boost, when activated, raises the CPU frequency to a significantly higher value, thus heat up the CPU really fast (eq.1).

2) Extremely high CPU computing power on a small semiconductor area (die)

With the advanced fabrication process, the semiconductor size is reduced more and more. Many high-end laptop CPU are fabricated with a really small 14nm technology. This helps increase CPU computing power by putting more semiconductor gates into the same area. However, it create an adverse impact on operating temperature since there is less space to dissipate heat. Below is a comparison of the 6-core i7 8750H CPU that can be found on many ultra-thin ultrabooks (Gigabyte Aero'18, Alienware'18, System76 Oryx Pro'18, etc.) against its predecessor.

CPU i7-8750H i7-7700HQ
Base clock 100 MHz 100 MHz
Non-Turbo Boost Freq. 2,200 MHz (22x) 2,800 MHz (28x)
Turbo Boost Freq. 4,100 MHz (1 core) (41x) 3,900 MHz (6 cores) (39x) 3,800 MHz (1 core) (38x) 3,400 MHz (4 cores) (34x)
Process 14nm 14nm
Package size 42 mm x 28 mm x 1.49 mm 42 mm x 28 mm x 1.49 mm

As shown in the table, when all 6 physical cores of i7-8750H run in Turbo Boost mode, they consume huge power @3.9GHz per core x 6. To make thing worse, the 8750H has the same package dimension as its previous generation 7700HQ making the heat dissipation a little more challenging. (a more accurate comparison should be done on the gate size of the 8750H vs 7700HQ, but I can't find such info for the latter)

Heat Reduction Solutions for Powerful yet Ultra-thin Laptops

From Eq.1, the power consumption and heat generation can be reduced by:

  • Reduce CPU operating voltage (undervolting)
  • Reduce CPU operating frequency (underclocking)

Also, the power consumption can be reduced by turning off Turbo Boost, which is the easiest yet one the most ineffective ways to battle CPU heat generation.

Undervolting: voltage and power consumption has a quadratic relation, so reducing voltage is an effective way to reduce power to an extent. However, there are some limitation of undervolting:

  • Only able to reduce the power to a certain degree because the amount of reduction must be small enough to not destabilize the CPU operation
  • It is also required specific tool to perform undervolting in Linux (but doable)
  • Cannot be adaptively applied to various power profiles such as performance (AC), powersave (battery), etc

Underclocking Method in Linux

First, we start with a manual method to underclock CPU in Linux. The automatic method to adaptive underclock CPU will be covered in another post.

There are three frequencies of interest for a CPU: maximum frequency, minimum frequency and running frequency. Below is the minium and maxium allowed operating frequency of an i7 8750H

$ lscpu |egrep "Model name|MHz" Model name: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz CPU MHz: 899.980 CPU max MHz: 4100.0000 CPU min MHz: 800.0000 

When Turbo Boost kicks in, the CPU frequency of all the cores may raise to its maximum (4.1GHz for 1 core or 3.9GHz for 6 cores of the 8750H). We want to reduce this maximum threshold to an empirical value such that it only neglectedly drops the laptop performance while keeping power consumption (and temperature) well below TDP.

To alter CPU freq thresholds, we use cpupower with two main steps.

First, we need to specify a governing power profile that we want to associate our modified CPU freq thresholds:

$ sudo cpupower frequency-set -g performance # set governor profile to performance 

There are several power profiles that one can set. I am using 2 main profiles: performance when on AC and powersave when on battery. There are more profiles in [4].

Then set the new maximum freq for performance profile:

$ sudo cpupower frequency-set --max 3400000 # set Turbo Boost max CPU freq to 3.4GHz 

You should do some experiments and choose the best max freq based on your laptop hardware, cooling system. With 3.4GHz as a new max freq, my laptop CPU temperature is around 65-75oC under heavy work loads (it also has a 1070 GTX with MAX-Q with 90% utilization). Without underclocking, it was 95oC before.

Finally, check if we have done correctly by tlp:

$ sudo tlp-stat -p | grep 'scaling_max_freq' /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu10/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu11/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu8/cpufreq/scaling_max_freq = 3400000 [kHz] /sys/devices/system/cpu/cpu9/cpufreq/scaling_max_freq = 3400000 [kHz] 

We are all set!

F.Y.I: without underclocking, my CPU used to throttle a lot under heavy tasks:

$ journalctl | grep 'temp.*throttled' ... Sep 28 22:00:25 oryx kernel: CPU1: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU10: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU11: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU5: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU3: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU9: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU4: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU7: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU0: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU6: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU8: Package temperature above threshold, cpu clock throttled (total events = 5924) Sep 28 22:00:25 oryx kernel: CPU2: Package temperature above threshold, cpu clock throttled (total events = 5924) 

Conclusion

Few months ago, I purchased a powerful Linux ultrabook with 6-core CPU and a GTX 1070 MAX-Q. Upon using it, I was quite disappointed by how hot this laptop was under heavy loads. Therefore, I had been on lookout for effective methods to keep the heat under control. After a while, I figured out that underclocking gets the job done nicely for me. I hope you will find it useful for you, too.

P/S: I have discussed an underclocking method to manually reduce heat dissipated by high-end CPUs in ultra-thin laptops. In the next post, I will show how to automate the process on AC plugged in and battery. Of course, if I have time, and you guys find this post useful :).

P/S: the model name of my laptop is Sytem76 Oryx Pro 4, primary OS: Ubuntu 18.04 (pre-installed). Secondary OS: Windows 10.

Reference

[1] CPU power dissipation, https://en.wikipedia.org/wiki/CPU_power_dissipation

[2] Intel i7-8750H, https://en.wikichip.org/wiki/intel/core_i7/i7-8750h

[3] Intel i7-7700HQ, https://en.wikichip.org/wiki/intel/core_i7/i7-7700hq

[4] Underclocking, https://en.wikipedia.org/wiki/Underclocking

submitted by /u/wwolfvn
[link] [comments] ...

Webseite öffnen Komplette Webseite öffnen

Newsbewertung

Kommentiere zu Underclocking high-end mobile CPUs for cooler, better battery life, longer lifespan ultra-thin Linux laptops - Part 1






Ähnliche Beiträge

  • 1. Underclocking high-end mobile CPUs for cooler, better battery life, longer lifespan ultra-thin Linux laptops - Part 1 vom 383.96 Punkte ic_school_black_18dp
    Preface If you have an ultra-thin laptop with a high-end CPU, and your laptop's temperature is constantly high (>90oC) under heavy workload, this post is for you. In this wall of text, I will discuss how to underclock your high-end mobile CPU to g
  • 2. USN-4041-1: Linux kernel update vom 342.23 Punkte ic_school_black_18dp
    linux, linux-aws, linux-aws-hwe, linux-azure, linux-gcp, linux-gke-4.15, linux-hwe, linux-kvm, linux-oem, linux-oracle, linux-raspi2, linux-snapdragon update A security issue affects these releases of Ubuntu and its derivatives: Ubuntu 19.04 Ubuntu 18.10 Ubunt
  • 3. USN-4017-1: Linux kernel vulnerabilities vom 315.62 Punkte ic_school_black_18dp
    linux, linux-aws, linux-aws-hwe, linux-azure, linux-gcp, linux-hwe, linux-kvm, linux-oem, linux-oracle, linux-raspi2, linux-snapdragon vulnerabilities A security issue affects these releases of Ubuntu and its derivatives: Ubuntu 19.04 Ubuntu 18.10 Ubunt
  • 4. USN-3256-1: Linux kernel vulnerability vom 214.21 Punkte ic_school_black_18dp
    Ubuntu Security Notice USN-3256-1 4th April, 2017 linux, linux-aws, linux-gke, linux-raspi2, linux-snapdragon, linux-ti-omap4 vulnerability A security issue affects these releases of Ubuntu and its derivatives: Ubuntu 16.10 Ubuntu 16.04 LTS Ubuntu 14.04 LTS
  • 5. Improving Battery Life of Ultra-thin Ultrabooks - Part 2 vom 204.59 Punkte ic_school_black_18dp
    Greetings, ​ This is the second part of the power saving methods based on dynamic frequency down-scaling with Intel p_state. Link to the first part. Preface I decided to grab a mobile workstation for my computer vision work. The laptop I bought has worked great; however, its battery capacity i
  • 6. USN-3328-1: Linux kernel vulnerabilities vom 200.27 Punkte ic_school_black_18dp
    Ubuntu Security Notice USN-3328-1 19th June, 2017 linux, linux-meta vulnerabilities A security issue affects these releases of Ubuntu and its derivatives: Ubuntu 16.04 LTS Summary Several security issues were fixed in the Linux kernel. Software descriptio
  • 7. util-linux bis 2.31 erweiterte Rechte [CVE-2018-7738] vom 164.78 Punkte ic_school_black_18dp
    In util-linux bis 2.31 wurde eine kritische Schwachstelle ausgemacht. Dabei geht es um eine unbekannte Funktion. Mittels dem Manipulieren mit einer unbekannten Eingabe kann eine erweiterte Rechte-Schwachstelle ausgenutzt werden. CWE definiert das Problem als
  • 8. util-linux bis 2.25 Blkid blkid.c Pufferüberlauf vom 141.94 Punkte ic_school_black_18dp
    Es wurde eine problematische Schwachstelle in util-linux bis 2.25, ein Betriebssystem, gefunden. Betroffen hiervon ist eine unbekannte Funktion der Datei blkid.c der Komponente Blkid. Durch Manipulieren mit einer unbekannten Eingabe kann eine Pufferüberlauf-Sc
  • 9. USN-3619-1: Linux kernel vulnerabilities vom 128.02 Punkte ic_school_black_18dp
    linux, linux-aws, linux-kvm, linux-raspi2, linux-snapdragon vulnerabilities A security issue affects these releases of Ubuntu and its derivatives: Ubuntu 16.04 LTS Summary Several security issues were fixed in the Linux kernel. Software Description li
  • 10. USN-3335-1: Linux kernel vulnerabilities vom 126.75 Punkte ic_school_black_18dp
    Ubuntu Security Notice USN-3335-1 19th June, 2017 linux, linux-meta vulnerabilities A security issue affects these releases of Ubuntu and its derivatives: Ubuntu 14.04 LTS Summary Several security issues were fixed in the Linux kernel. Software descriptio
  • 11. Get the best out of you battery on linux vom 116.96 Punkte ic_school_black_18dp
    If you dual boot Linux with Windows you definitely already noticed that Linux uses MUCH more battery and drain the battery much faster than windows. I noticed that battery life in Linux (Linux Mint 19 Cinnamon in my case) is WAY worse than in windows
  • 12. HP's Spectre x360 13 Promises Up To 16 Hours of Battery Life in a Faster, Cooler Design vom 116.42 Punkte ic_school_black_18dp
    From a report: The HP Spectre x360 13 is already one of the most popular 360-degree convertible laptops, and it's about to get faster and cooler, thanks in part to Intel's latest 8th-generation Core CPUs. Announced Wednesday, the refreshed Spectre x360