undervolting (e.g. skylake) in linux

Discussion in 'Hardware Components and Aftermarket Upgrades' started by conker_ts, Aug 13, 2017.

  1. moson

    moson Newbie

    Reputations:
    5
    Messages:
    3
    Likes Received:
    3
    Trophy Points:
    6
    Well, there is no such command that just works on every notebook.
    Also be aware that you can easily kill you machine with manipulations like this.


    First, you'll have to check how TDP is limited on your rig.
    There can be a limit via MSR (check 0x610) or MCHBAR register or EC or whatnot.

    Check our the following pages to get more details on that:

    http://forum.notebookreview.com/threads/the-throttlestop-guide.531329/page-737
    http://forum.notebookreview.com/threads/the-throttlestop-guide.531329/page-566
    http://forum.notebookreview.com/threads/the-throttlestop-guide.531329/page-744
    http://forum.notebookreview.com/threads/the-throttlestop-guide.531329/page-745

    Could also be that those settings are locked and you can't write to the appropriate registers.

    Install and run turbostat and have a look what is displayed in the lines for the power limit:
    (this is the register throttlestop is reading/manipulating in the TLP section of the tool)

    Code:
    cpu0: MSR_PKG_POWER_LIMIT: 0x42816000dd8160 (UNlocked)
    cpu0: PKG Limit #1: ENabled (44.000000 Watts, 28.000000 sec, clamp ENabled)
    cpu0: PKG Limit #2: ENabled (44.000000 Watts, 0.002441* sec, clamp DISabled)
    
    In my case the limit was already at 44W, but it wasn't reaching this limit (well, it did, but after a short while it fell back to 15W max).
    So I further had a look for the FED159A0 and FED159A4 memory addresses and voila, there was another limit.

    You can read / write those with a tool "devmem2"
    Found it in this github repo: https://github.com/pavel-a/devmemX
    Check the wiki for usage.

    In my case in FED159A0 had a value 00DD8078

    last 3 digits hex (078) in dec = 120
    this 120 * 0.125 = 15 = 15 W

    So i changed it to 00DD8160

    hex 160 = dec 352
    352 * 0.125 = 44 W

    [​IMG]

    regarding the startscript, I just changed the iuvolt startscript (check tizwiz's post on this page) and added one line before installing it.
    So just after running the undervolting script, it runs the devmem command to increase to TDP limit...

    "ExecStartPost=/usr/bin/devmem2 0xFED159A0 w 0x00DD8160"


    But again. copy/pasting my stuff won't work for you. In the worst case you'll damage your hardware.
    So do this at your own risk.

    regards,
    moson
     
    leeloyd and Vasudev like this.
  2. chigro

    chigro Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    Amazing! Thank you, moson!
     
  3. bruntik

    bruntik Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    Has anyone successfully undervolted in Fedora? I'm on Fedora 27 with all the current updates, but "wrmsr" doesn't work for me. "rdmsr" works, but with "wrmsr" I'm always getting permission errors, no matter if I do it with sudo or switching to root with su ("wrmsr: pwrite: Operation not permitted"). I tried it with the iuvolt script from tiziw (thank you for that) and with the command itself, no luck. The msr files all have read and write permissions for the owner (root).
    Apparently Fedora has the msr module built into the kernel, so there is no separate module for it, maybe it has something to with that? Does anybody know how to deal with this?
     
  4. Neoyell

    Neoyell Newbie

    Reputations:
    0
    Messages:
    1
    Likes Received:
    3
    Trophy Points:
    6
    Undervolting works fine with Fedora 27 and iuvolt. You should disable secure boot, seems with enabled secure boot the wrmsr command doesn't work.

    I5-8250U (HP ProBook 450 G5)
    Set an -90mV offset to the CPU and seems stable, with -100mV my system immediately freeze.
     
    bruntik, Vasudev and hmscott like this.
  5. bruntik

    bruntik Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    Ah thank you so much, that was it! I didn't think of that. Is there a way to make wrmsr work with secure boot enabled though, some module that needs to be signed or something?

    EDIT: In case anybody is interested in this as well, I have found a guide to allow msr writes from user space with secure boot enabled by modifying and re-building the msr module (or, in case of distros like Fedora with the module built in, re-compiling the whole kernel) here: https://github.com/intel/intel-cmt-cat/wiki/UEFI-Secure-Boot-Compatibility
    I haven't tried it though.
     
    Last edited: Apr 22, 2018
  6. indianahorst

    indianahorst Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    6
    Has anybody tested if the tool works with a Ivy Bridge CPU?

    I have a Thinkpad T430 with an i5-3320M under Arch Linux and I get the following error when using the intel-undervolt tool:

    Code:
    $ sudo intel-undervolt read
    Failed to write MSR
    Failed to read value for CPU (0)
    Failed to write MSR
    Failed to read value for GPU (1)
    Failed to write MSR
    Failed to read value for CPU Cache (2)
    Failed to write MSR
    Failed to read value for System Agent (3)
    Failed to write MSR
    Failed to read value for Analog I/O (4)
    
    Edit: yes, the MSR module is loaded!

    Code:
    $ lsmod | grep msr
    msr                    16384  0
    
     
    Vasudev likes this.
  7. senso

    senso Notebook Evangelist

    Reputations:
    169
    Messages:
    509
    Likes Received:
    75
    Trophy Points:
    76
    What is your chipset?

    If I recall correctly, not all Ivy/chipset combos allow for undervolting.
     
    Vasudev likes this.
  8. indianahorst

    indianahorst Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    6

    Chipset is Intel QM77 Express.
     
  9. QuantumCakeIsALie

    QuantumCakeIsALie Notebook Enthusiast

    Reputations:
    0
    Messages:
    23
    Likes Received:
    5
    Trophy Points:
    6
    Ok, so I managed to increase the TDP of my 8550U given the information you gave, but it always gets back to the original value...

    For me the original value is 0x42016000dd8040. I set it to 0x42016000dd8160 using wrmsg and in memory via "devmem2 0xFED159A0 w 0xDD8160". Turbostats reports everything allright and performance is increased for a while (similar to Windows where it seems like it's already at 44W?). But after a while performance degrades and the 0x610 msr is back to 0x42016000dd8040, I've even seen 0x42016000dc8040 and 0x43816000dd8024 somehow... Maybe it's thermal throttling?

    Undervolting works allright (-85, -60, -85) and only reset when waking from sleep, so I got a script to re-enable it when waking up.

    Any pointers to help me out a little?
     
    Last edited: Oct 12, 2018 at 8:17 AM
Loading...

Share This Page