Manjaro Difference between revisions of "Undervolt intel CPU"

Difference between revisions of "Undervolt intel CPU"

From Manjaro
imported>Yoy0
(Marked this version for translation)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Introduction =
<languages/>
__TOC__
<translate>
= Introduction = <!--T:1-->


== Undervolt ==
== Undervolt == <!--T:2-->
Undervolting your CPU reduce its power consumption and heat without harming performance if well done.
Undervolting your CPU reduce its power consumption and heat without harming performance if well done.


<!--T:3-->
If voltage is set too low it can lead to error, crash and reboot.
If voltage is set too low it can lead to error, crash and reboot.


It's not a trivial thing to do, used software can physically harm your computer if wrong value are set.
<!--T:4-->
{{warning|It's not a trivial thing to do, used software can physically harm your computer if wrong value are set.}}


== Intel P-state vs cpufreq ==
== Intel P-state vs cpufreq == <!--T:5-->


<!--T:6-->
"CPUfreq — also referred to as CPU speed scaling — is the infrastructure in the Linux kernel that enables to scale the CPU frequency in order to save power." ''Redhat.com docs.''
"CPUfreq — also referred to as CPU speed scaling — is the infrastructure in the Linux kernel that enables to scale the CPU frequency in order to save power." ''Redhat.com docs.''


<!--T:7-->
"intel_pstate is a part of the CPU performance scaling subsystem in the Linux kernel (CPUFreq). It is a scaling driver for the Sandy Bridge and later generations of Intel processors." ''Kernel.org docs''
"intel_pstate is a part of the CPU performance scaling subsystem in the Linux kernel (CPUFreq). It is a scaling driver for the Sandy Bridge and later generations of Intel processors." ''Kernel.org docs''


<!--T:8-->
Method to undervolt differ depending on which "scaling" is used by your processor, Intel PState start with 2nd gen Intel Core i3/5/7 (Sandy Bridge).
Method to undervolt differ depending on which "scaling" is used by your processor, Intel PState start with 2nd gen Intel Core i3/5/7 (Sandy Bridge).


== Method / Software / History ==
== Method / Software / History == <!--T:9-->


<!--T:10-->
1. For CPUfreq, PHC is used and method is well documented on arch wiki (https://wiki.archlinux.org/index.php/PHC), I will not focus on it as I got no experience with it and no hardware to acquire it.
1. For CPUfreq, PHC is used and method is well documented on arch wiki (https://wiki.archlinux.org/index.php/PHC), I will not focus on it as I got no experience with it and no hardware to acquire it.


<!--T:11-->
2. For PState, a method appeared in August 2017 (https://github.com/mihic/linux-intel-undervolt) and shortly after a python soft got written (https://github.com/xdever/linux-intel-undervolt-tool).
2. For PState, a method appeared in August 2017 (https://github.com/mihic/linux-intel-undervolt) and shortly after a python soft got written (https://github.com/xdever/linux-intel-undervolt-tool).


= PState undervolt =
= PState undervolt = <!--T:12-->


== Method description ==
== Method description == <!--T:13-->


<!--T:14-->
I will take the example of a 0.175V '''decrease''': '''- '''0.175V.
I will take the example of a 0.175V '''decrease''': '''- '''0.175V.


<!--T:15-->
To achieve that I will need two commands, one for '''CPU Core''' and the other for '''CPU Cache'''. (CPU Core and Cache share the voltage plane on my machine, that's why two commands instead of one).
To achieve that I will need two commands, one for '''CPU Core''' and the other for '''CPU Cache'''. (CPU Core and Cache share the voltage plane on my machine, that's why two commands instead of one).


<!--T:16-->
{{warning|These commands are shown for illustrative purpose.}}
{{warning|These commands are shown for illustrative purpose.}}
  sudo wrmsr 0x150 0x80000011E9A00000
  sudo wrmsr 0x150 0x80000011E9A00000
  sudo wrmsr 0x150 0x80000211E9A00000
  sudo wrmsr 0x150 0x80000211E9A00000


<!--T:17-->
explanation:
explanation:
  # wrmsr is a tool used for writing values to a CPU's machine specific registers (MSR).
  # wrmsr is a tool used for writing values to a CPU's machine specific registers (MSR).
Line 61: Line 75:
         # 0xE9A00000
         # 0xE9A00000


== Software ==
== Software == <!--T:18-->


=== kernel module ===
=== kernel module === <!--T:19-->
You need to have module '''msr''' enabled for '''wrmsr''' to work
You need to have module '''msr''' enabled for '''wrmsr''' to work
  modprobe msr
  modprobe msr


=== wrmsr/rdmsr ===
=== wrmsr/rdmsr === <!--T:20-->
wrmsr is provided by package '''msr-tools''' in '''AUR'''
wrmsr is provided by package '''msr-tools''' in '''AUR'''


=== The python soft I mentioned earlier ===
=== The python soft I mentioned earlier === <!--T:21-->
If you don't want to make the calculation yourself or want to automate undervolt at boot you can use: https://github.com/xdever/linux-intel-undervolt-tool
If you don't want to make the calculation yourself or want to automate undervolt at boot you can use: https://github.com/xdever/linux-intel-undervolt-tool


<!--T:22-->
It's not heavily used and <strike>not available as a package for now</strike> it got forked https://github.com/hedgepigdaniel/linux-intel-undervolt-tool/ and is available in '''AUR''' as '''linux-intel-undervolt-tool'''.
It's not heavily used and <strike>not available as a package for now</strike> it got forked https://github.com/hedgepigdaniel/linux-intel-undervolt-tool/ and is available in '''AUR''' as '''linux-intel-undervolt-tool'''.


<!--T:23-->
My quick look at '''linux-intel-undervolt-tool''' files and behaviour:
My quick look at '''linux-intel-undervolt-tool''' files and behaviour:
  /usr/bin/undervolt
  /usr/bin/undervolt
Line 89: Line 105:
  /etc/modules-load.d/undervolt-msr.conf
  /etc/modules-load.d/undervolt-msr.conf
   # load msr module at startup
   # load msr module at startup
== Hardware known to work == <!--T:24-->
{| class="wikitable centre" width="100%"
|-
! scope=col | Manufacturer
! scope=col | Model
! scope=col | CPU
! scope=col | Info source
|-
| width="10%" |
MSI
| width="10%" |
GS40 6QE
| width="10%" |
I5-6300HQ
| width="70%" |
https://forum.manjaro.org/t/undervolt-recent-intel-cpu/41948/5    (This wiki page author)
|-
| width="10%" |
DELL
| width="10%" |
XPS 15 9560
| width="10%" |
I7-??????
| width="70%" |
https://github.com/xdever/linux-intel-undervolt-tool    (linux-intel-undervolt-tool author)
|-
| width="10%" |
???
| width="10%" |
???
| width="10%" |
I7-6700HQ
| width="70%" |
https://github.com/mihic/linux-intel-undervolt    (undervolt method author)
|}
Feel free to report [https://forum.manjaro.org/t/undervolt-recent-intel-cpu/41948 here] with "@Yoy0" if you want me to append this list.
</translate>
[[Category:Contents Page{{#translation:}}]]

Latest revision as of 18:56, 7 September 2021

Other languages:
English • ‎Türkçe • ‎русский

Introduction

Undervolt

Undervolting your CPU reduce its power consumption and heat without harming performance if well done.

If voltage is set too low it can lead to error, crash and reboot.


Warning
It's not a trivial thing to do, used software can physically harm your computer if wrong value are set.

Intel P-state vs cpufreq

"CPUfreq — also referred to as CPU speed scaling — is the infrastructure in the Linux kernel that enables to scale the CPU frequency in order to save power." Redhat.com docs.

"intel_pstate is a part of the CPU performance scaling subsystem in the Linux kernel (CPUFreq). It is a scaling driver for the Sandy Bridge and later generations of Intel processors." Kernel.org docs

Method to undervolt differ depending on which "scaling" is used by your processor, Intel PState start with 2nd gen Intel Core i3/5/7 (Sandy Bridge).

Method / Software / History

1. For CPUfreq, PHC is used and method is well documented on arch wiki (https://wiki.archlinux.org/index.php/PHC), I will not focus on it as I got no experience with it and no hardware to acquire it.

2. For PState, a method appeared in August 2017 (https://github.com/mihic/linux-intel-undervolt) and shortly after a python soft got written (https://github.com/xdever/linux-intel-undervolt-tool).

PState undervolt

Method description

I will take the example of a 0.175V decrease: - 0.175V.

To achieve that I will need two commands, one for CPU Core and the other for CPU Cache. (CPU Core and Cache share the voltage plane on my machine, that's why two commands instead of one).


Warning
These commands are shown for illustrative purpose.
sudo wrmsr 0x150 0x80000011E9A00000
sudo wrmsr 0x150 0x80000211E9A00000

explanation:

# wrmsr is a tool used for writing values to a CPU's machine specific registers (MSR).

# First value is the register number.
    # It's always 0x150

# Second value is where and what we write in it.
    # 0x mean hexadecimal.
    # 80000 is constant, meaning is unknown.
    # X <- It's the plane index, it can be (not exhaustive):
        # 0 CPU Core
        # 1 GPU
        # 2 CPU Cache
    # 1 is constant, meaning is unknown.
    # 1 write/read <- I don't know what that mean.
    # E9A00000 offset, it's -0.175V after some magic calculation.
        # -175*1.024 = -179.2 -> -179
        # 179  = 1011 0011
        # -179 = 0100 1101         # invert bits+1 to get negative value.

        # Bits tagged with "c" are constant value, bits tagged with "o" are the calculated offset.
        # ccco oooo oooc cccc cccc cccc cccc cccc
        # 1110 1001 1010 0000 0000 0000 0000 0000
        #    E    9    A    0    0    0    0    0

        # 0xE9A00000

Software

kernel module

You need to have module msr enabled for wrmsr to work

modprobe msr

wrmsr/rdmsr

wrmsr is provided by package msr-tools in AUR

The python soft I mentioned earlier

If you don't want to make the calculation yourself or want to automate undervolt at boot you can use: https://github.com/xdever/linux-intel-undervolt-tool

It's not heavily used and not available as a package for now it got forked https://github.com/hedgepigdaniel/linux-intel-undervolt-tool/ and is available in AUR as linux-intel-undervolt-tool.

My quick look at linux-intel-undervolt-tool files and behaviour:

/usr/bin/undervolt
  # program written in python
  # if run without elevated right it give command to apply yourself with wrmsr
  # options:
    '-gpu', type=int, help='Undervolt GPU by this amount of millivolts. Must be negative.'
    '-cpu', type=int, help='Undervolt CPU by this amount of millivolts. Must be negative.'
    '-config', type=str, help='Config file to load. Other flags has priority over -config.'
/etc/undervolt.json
  # contain voltage parameters "cpu" and "gpu"
/usr/lib/systemd/system/undervolt.service
  # a systemd service enabled and started which restart after suspend/hibernate/hybrid-sleep with: -config /etc/undervolt.json
/etc/modules-load.d/undervolt-msr.conf
  # load msr module at startup

Hardware known to work

Manufacturer Model CPU Info source

MSI

GS40 6QE

I5-6300HQ

https://forum.manjaro.org/t/undervolt-recent-intel-cpu/41948/5 (This wiki page author)

DELL

XPS 15 9560

I7-??????

https://github.com/xdever/linux-intel-undervolt-tool (linux-intel-undervolt-tool author)

???

???

I7-6700HQ

https://github.com/mihic/linux-intel-undervolt (undervolt method author)

Feel free to report here with "@Yoy0" if you want me to append this list.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.