The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.
← Previous pageNext page →

    undervolting (e.g. skylake) in linux

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

  1. _pk

    _pk Notebook Enthusiast

    Reputations:
    5
    Messages:
    10
    Likes Received:
    12
    Trophy Points:
    6
    Okay, so after testing it on my laptop with i5-4300M, it seems like the values are the same, but of course additionally it has one extra slider enabled.

    FIVRVoltage40 = analog i/o //checked it because it was missing above
    FIVRVoltage50 = digital i/o

    Additional one number, because it's what I'm using there (yea sad it can't go lower, I think it even eats more power than 6440HQ)
    -70.3 = F70

    -1, -2, +3, -4 gave same results as @conker_ts 's, and rest FIVRVoltageXY numbers match.
     
    conker_ts, alfazaz and Vasudev like this.
  2. tincmulc

    tincmulc Notebook Enthusiast

    Reputations:
    7
    Messages:
    10
    Likes Received:
    18
    Trophy Points:
    6
    I did a few experiments and I am pretty sure my initial observation were a bit off. I now believe the offset is actually an 11bit number. This makes steps about 1mV (1/1024 V - as posted by unclewebb).

    I noticed that all of the numbers observed in TS were even. So I then proceeded to try and set an odd offset with wrmsr - the computer instantly locked up. I tried it again a few times and each time I gave it an odd number it locked up. So I think the offset is actually only 11 bits and the 12th bit is something else (and setting it to 1 makes something go horribly wrong). Since most of us were just copying offsets from TS we never had that bit set, but someone following the formula might have.

    The "formula" changes to:

    hex((round(mv*1.024)<<21)+16**8)
     
    conker_ts, alfazaz and _pk like this.
  3. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Maybe that extra bit is signed bit.
     
  4. _pk

    _pk Notebook Enthusiast

    Reputations:
    5
    Messages:
    10
    Likes Received:
    12
    Trophy Points:
    6
    You sure 16^8 is needed? Its 0x1 00000000 (1 and eight 0's) in hex, seems like it changes nothing. With my C floor code it seems to always give even numbers, with or without the 16^8.
     
  5. tincmulc

    tincmulc Notebook Enthusiast

    Reputations:
    7
    Messages:
    10
    Likes Received:
    18
    Trophy Points:
    6
    No, the "negativnes" is already represented by the standard binary way (2's complement).

    This is just python specific as without it python prints negative numbers with a negative sign (eg. '-0x6600000') and you need the actual binary representation of the negative number.
    It doesn't work with positive offsets (you get an extra 1 (eg 0x1xxxxxxxx)). Here is a fixed version that also handles positive offsets:

    format(round(mv*1.024)<<21, '08x') if (round(mv*1.024)<<21)>0 else format((round(mv*1.024)<<21)+16**8, '08x')

    Python really isn't fit for this binary manipulation kind of stuff, but it's not practical to put C code in the guide as it can't be run as easily.
     
    _pk and alfazaz like this.
  6. _pk

    _pk Notebook Enthusiast

    Reputations:
    5
    Messages:
    10
    Likes Received:
    12
    Trophy Points:
    6
    @up
    Oh okay, I never used Python so I dunno, but it seemed weird. Now it makes sense, and seems to work correctly. And it's nice to see people still improving undervolting.


    I hope you don't mind that I stole your code to write it in JS (I don't know Python, but I do know JS a bit). Use @tincmulc code, this one might be error prone.
    Code:
    var mV = 3;
    var result = (((Math.round(mV*1.024)<<21)& 0xFFF00000)>>>0).toString(16);
    '0'.repeat(8 - result.length) + result;
    
     
  7. conker_ts

    conker_ts Notebook Guru

    Reputations:
    7
    Messages:
    51
    Likes Received:
    41
    Trophy Points:
    26
    Woa, ok, at least I wrote a disclaimer in my post :rolleyes:
    Thank you for testing. Looking at it like this, it makes even more sense, why we see saw only even numbers ...

    Haha, yes, Python is awesome in general, but this binary stuff is incovenient. At least JS is as bad o_O (no offense @_tk ^^)
    One advantage is, that you have lot's of possibilites to run the Python code. In Linux it's usually preinstalled, and even if you don't have it on your device, you can paste it in online terminals and evaluate the code instantly.

    Hm, I feared that something like different cases and format are needed. This 2 complement is really annoying (and the prefix 1 in the positive offsets).
    You can at least change the middle part to mv>0 in your version
    or try my version:
    (I'm not 100% sure with this manual 2's complement 'magic' with &0xFFF, but it works with all the numbers I tested)
    Combine it in one, and select the needed bits with &
    format(0xFFE00000&( (round(mv*1.024)&0xFFF) <<21), '08x')
     
    Last edited: Aug 28, 2017
    Vasudev and _pk like this.
  8. tincmulc

    tincmulc Notebook Enthusiast

    Reputations:
    7
    Messages:
    10
    Likes Received:
    18
    Trophy Points:
    6
    Much better, thanks.
     
  9. conker_ts

    conker_ts Notebook Guru

    Reputations:
    7
    Messages:
    51
    Likes Received:
    41
    Trophy Points:
    26
    I just got curious, why it crashed when setting bit 20.
    And I guess this could be prevented, just by reading the older messages and sticking to them:

    The more exact post would be https://forums.anandtech.com/threads/what-controls-turbo-core-in-xeons.2496647/page-40#post-38971756
    I didn't plan to even test the absolute voltages, as I currently don't see where the benefits are (except during OC)
    The this part is the most interesting:
    Code:
    Command 0x10 Read Voltages and ratios, 0x11 Set Voltages and ratios
    Bit(s)
    7:0    Ratio limit
    19:8   Static Voltage   ( V / 1024)
    20     0 = Dynamic Voltage, 1 = Fixed Voltage
    31:21  Offset Voltage, -1024 to 1023 (-1V to +0.999V)

    By setting bit 20, it switched to static voltage, and as this was in the previous range (and probably 0), the CPU had voltage 0 and the system froze, makes sense. At least you can be sure, you didn't fry anything. Kudos to Intel Devs, they probably expected this :p

    But in general this was also a really valuable lesson: So when you see only even numbers, your binary starting point may be wrong :cool:
     
    Last edited: Aug 28, 2017
    _pk, alfazaz, Vasudev and 1 other person like this.
  10. alfazaz

    alfazaz Newbie

    Reputations:
    0
    Messages:
    9
    Likes Received:
    9
    Trophy Points:
    6
    I underclock now my i7 7700HQ under linux... Great ! Thanks !
     
    Vasudev likes this.
  11. tincmulc

    tincmulc Notebook Enthusiast

    Reputations:
    7
    Messages:
    10
    Likes Received:
    18
    Trophy Points:
    6
    Yeah, I now wish I took the time to thoroughly read the thread before posting my mostly wrong conclusions about the oc mailbox.
    On the other hand it feels good that we eventually came to the correct answer (well at least as far offset undervolting is concerned) without help.
     
    Vasudev likes this.
  12. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    I did undervolt to -120.2mV using TS ini file. Temps reduced by 2C. 38C -> 36C. Maybe because I used powertop to calibrate power usage and optimise the temps by 10C, earlier it idles at 48C. Anyone had luck in manipulating the fan speed on Alienware on Linux?
     
  13. leeloyd

    leeloyd Notebook Consultant

    Reputations:
    86
    Messages:
    257
    Likes Received:
    206
    Trophy Points:
    56
    Skylake and Kabylake aren't that easy to OC/UV.

    I followed the hints from there :
    https://forums.anandtech.com/threads/what-controls-turbo-core-in-xeons.2496647/page-40#post-38971756

    If i boot straight in Linux, MSR0x150 seems to have some contexts locked.

    Code:
    $ sudo wrmsr 0x150 0x8000000100000000
    $ sudo rdmsr 0x150
    0000000000000753
    
    $ sudo wrmsr 0x150 0x8000001000000000
    $ sudo rdmsr 0x150
    0
    If I boot first in Windows, than reboot in Linux. I can access all context (CPU,Cache,etc...).

    Code:
    $ sudo wrmsr 0x150 0x8000000100000000
    $ sudo rdmsr 0x150
    0000000000000753
    
    $ sudo wrmsr 0x150 0x8000001000000000
    $ sudo rdmsr 0x150
    0000000000000024
    CPU : I7 6820HK.

    Edit : Never mind, setting an undervolt works. Even when I boot straight too Linux.

    Ok next step : OC.
     
    Last edited: Sep 3, 2017
    Vasudev likes this.
  14. conker_ts

    conker_ts Notebook Guru

    Reputations:
    7
    Messages:
    51
    Likes Received:
    41
    Trophy Points:
    26
    That's strange, the read command looks corrent. So what was the problem exactly ?
    I'd still guess, this write-read cycle is not that stable, b/c there is too much time/ many cpu cycles in between ...

    Did you mean undervolt ? ^-^

    Hm, that's strange ...
    Does Powertop have similar CPU Package Power field as in TS/Aida ?
    This should be probably documented in the Intel Docs, which MSR to read for the current Power drain in Watts. Then we may have a better indication, if the UV did work ...
     
  15. alfazaz

    alfazaz Newbie

    Reputations:
    0
    Messages:
    9
    Likes Received:
    9
    Trophy Points:
    6
    Oups, sorry : yes ! I undervolt... It works very well.
     
  16. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Install powertop using synaptic pkg manager from ubuntu repos.
     
  17. leeloyd

    leeloyd Notebook Consultant

    Reputations:
    86
    Messages:
    257
    Likes Received:
    206
    Trophy Points:
    56
    Maybe because the oc_mailbox, wasn't already used to change OC parameters. In Windows, I thing TS or xtu must change ratio to default at start-up.
     
    Last edited: Sep 8, 2017
    Vasudev likes this.
  18. ngoonee

    ngoonee Newbie

    Reputations:
    0
    Messages:
    3
    Likes Received:
    3
    Trophy Points:
    6
    I've got an i7-8550 based laptop (HP Envy 13), doesn't seem like anyone has tried this out on the Kaby Lake Refresh chips yet? Still have my windows install (shrunk considerably) here, and running Arch Linux. Will be following the guide, but is there anything I can check to see if the MSR codes have changed between Kaby Lake and Kaby Lake R?
     
    Vasudev likes this.
  19. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Did you try ThrottleStop first?
     
  20. ngoonee

    ngoonee Newbie

    Reputations:
    0
    Messages:
    3
    Likes Received:
    3
    Trophy Points:
    6
    Yes, am playing with that now. Certainly quite a bit of headroom for undervolting, -50mV without artifacts so far.

    EDIT: Okay seem to have reached the safe limit at -110mV, -120mV gave me the BSOD. Running Prime95 now, will leave it for the rest of the workday.

    The ThrottleStop.ini contents are as mentioned on https://github.com/mihic/linux-intel-undervolt

    FIVRVoltage00, FIVRVoltage10, and FIVRVoltage20 contain the changes I made (CPU Core, Intel GPU, CPU Cache). So no change from skylake/kaby lake I think.

    Also just did a quick check of the manual offset calculation, and it was spot on.

    Will report back when I've done Prime95 stress testing and get round to applying settings in Linux.

    EDIT2: Well got an error after a few hours on -110, now on -105. Applied it to Linux, i7z does show a clear drop in VCore. mprime seems to run slower compared to on Windows though (getting 1.6GHz rather than the 2.4GHz I was getting under Windows). Would chalk that up to different boost settings. At least there's a clear VCore change and my theoretical power usage should be lower.
     
    Last edited: Oct 26, 2017
    Vasudev likes this.
  21. ngoonee

    ngoonee Newbie

    Reputations:
    0
    Messages:
    3
    Likes Received:
    3
    Trophy Points:
    6
    Opened an issue on github, I think the second index is your ThrottleStop profile.
     
    Vasudev likes this.
  22. jeanne.morreau

    jeanne.morreau Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    Hey guys,

    First I gotta say thank you all for your efforts and your researchs, I've been literally waiting for YEARS for someone to write such a guide, as Intel seemed to have decided Linux wasn't worth writing the XTU thing. Anyway, I've come to share my results.

    SO my laptop is a HP Chromebook 14 with Celeron 2955U CPU, 4 years old now, and I had Linux replacing Chrome OS. Windows couldn't really be put on it, so no Throttlestop for me, I had to blindly find the suitable values. Nor could I use i7z to check the voltages since the software wouldn't recognize my hardware :

    wrmsr 0x150 0x80000011ef600000

    Set an -130mV offset to the CPU it seems if I did the right thing. It's stable for now and the benchmark performance stays the same. -140mV would instantly freeze and force to reboot.

    wrmsr 0x150 0x80000111f0a00000

    Then I set an -120mV offset to the iGPU it seems. I tried -140mV but the screen also froze, and -130mV I had little artefacts.

    Finally I set -130mV to the other voltage planes, although I had absolutely no idea whether it would do anything since I can't run Windows to check the compatibily of my CPU. Anyway everything runs perfectly fine and I put the commands in /etc/rc.local to have the undervolt on startup. Also I'd say I have a -2 or -3°C temperature difference now, not that my laptop was hot to begin with.

    EDIT : also you have to load the msr module. sudo modprobe msr or just add msr in /etc/modules on Ubuntu anyway
     
    Last edited: Nov 11, 2017
  23. JanW7

    JanW7 Newbie

    Reputations:
    5
    Messages:
    3
    Likes Received:
    2
    Trophy Points:
    6
    Thank you Thank you Thank you to conker_ts, unclewebb, _pk, tincmulc and everyone else for this thread! This is a stripe of light on the horizon for me.

    I have a Dell Precision 5520 with an i7-7820HQ and Nvidia Quadro M1200 which runs hot as hell. So with the help of this thread I can get a stable undervolt of -120mV across the five voltage planes (not fine-tuned yet). Even though it seems I didn't get too lucky with the silicon lottery, being able to undervolt is great!! I had given up on doing it under Linux on this machine and was actually thinking about reselling it.

    Under heavy load, throttling is reduced (but not eliminated, depending on load). Minimal fps on DiRT Rally Benchmark (3 loops, 1080p, high settings) is up from 23 fps (no undervolt) to 44 fps (-120mV) (average up from 61 to 63 fps). Temperatures still hit 90°C on the CPU and GPU (up to 96°C on the CPU without undervolt).

    What I do not get, is that idle temperatures do not change at all. According to i7z, my nominal undervolt of -120 mV brings voltage down from about 0.662V to 0.557V (a drop of 105mV) when the computer is idle (CPU at 800MHz). That's a drop by about 16%. Power consumption should go down by a factor of (0.557/0.662)²=0.71, which is almost 30% down. How can this not affect idle temperature? At first I was thinking this was maybe due to a steep fan curve, but the fans actually never go below 2500rpm, and stay there at idle, whether the CPU is undervolted or not, so cooling should be strictly identical. Long term idle CPU temperature is 35°C, independent of voltage (40°C with even the most minimal activity such as editing this post). What am I missing?

    The next step would be to undervolt the Nvidia Quadro M1200. Does anyone have a pointer on how to achieve that under Linux (no Windows here)? I've tried to search for GPU undervolting, and I get very few hits for Linux, most of which talk about hacking the BIOS of AMD graphics cards and none that give any detail about the procedure.

    I already repasted CPU and GPU, with little improvement.

    Thanks again to everyone for this thread! I may actually keep this laptop after all.
     
    Vasudev likes this.
  24. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Ambient temps plays an important role. Your idle temps looks okay to me. Elevate the back of the laptop using a ventilated stand from amazon basics or Steklo X stand for maximum airflow.
    I thought Dell Precision didn't have overheating issue considering you are paying twice the cash than a gaming laptop!
     
  25. JanW7

    JanW7 Newbie

    Reputations:
    5
    Messages:
    3
    Likes Received:
    2
    Trophy Points:
    6
    I absolutely agree, Vasudev, the Precision should definitely offer better cooling for the price premium. But sadly the chassis and cooling solution really seem to be identical to the XPS. Maybe I should still consider contacting Dell support on this.

    And yes, my absolute idle temperatures might be considered acceptable (even though they increase too fast for my taste on _very_ low loads). What is surprising to me, is that there is no difference at all between undervolt and no undervolt. I repeated the idle test, trying to reduce consumption of the other components, thinking that maybe they were heating the CPU: I disabled the Nvidia graphics, unplugged the TB3->Ethernet adapter, disabled wireless network. Temps dropped to 30°C over night, and the fans actually switched off, but still no difference whatsoever between undervolted CPU and stock voltages. I guess the CPU is just doing an incredibly good job to consume close to no power at all at idle, undervolt or not, and idle temperatures are dominated by the other system components heating the chassis.

    So now that that's sort of elucidated, I guess the only hope is to undervolt the Nvidia graphics. Is there any hope for that?
     
  26. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Maxwell GPU can't be undervolted. Do you use it for development? Which distro?
    I had these issues on my PC too, I used TLP to reduce heat on my lappie and whilst web browsing it consumes just 10W on wifi giving 7-8+ hrs on battery. I disabled Turbo boost and increased max cpu usage %age from 30-70.
    IN addition to that use powertop to tweak/calibrate sensors and power usage metrics for even more reduction in heat.
    Sadly nvidia gpu consume too much energy than Windows drivers and mine usually idles at 60C whilst CPU stays at 30-50C on light usage and fans doesn't turn on unless the cpu temps cross 85C.
    I think you can work ur GPU in headless mode and use Intel iGPU for most tasks and offload computation to nvidia card simultaneously. I'm unsure how your card works, I think it has Optimus.
     
    JanW7 likes this.
  27. JanW7

    JanW7 Newbie

    Reputations:
    5
    Messages:
    3
    Likes Received:
    2
    Trophy Points:
    6
    That's a bummer. Can't be as in "impossible to do because the hardware does not support it at all", or as in "no one has succeeded so far under Linux"?

    I plan to: this will be for Matlab / CUDA work. For now the computer is quite new and I'm still trying to set things up. And playing a few games in the meantime ;)
    I've installed Ubuntu 16.04 + KDE, because that's what I have on most of my other machines now. My main computer for development of CUDA stuff is Windows, though, so I'll have to see how much pain it is to port that part. And yes, my card has Optimus.

    I have installed powertop and TLP, but not tweaked much yet - that's still on my TODO list. As well as looking more closely at power consumption with my trusty power meter. I will have to look into the fan curve as well. Thanks for all the pointers!
     
    Vasudev likes this.
  28. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    See if you can get TCC mode or Headless mode using Nvidia drivers. Windows is simply superior to Linux in IDE support and VS simply produces a faster binary file. Linux on nvcc is fast but not comparable to Windows. For python and CUDA, Linux is somewhat better because it setups env. variable correctly w/o any hassles.
    I doubt Optimus will allow Windows like flexibility, you need to use only nvidia prime because Bumblebee and similar can't offload everything like Win 10. KDE is heavier I always use Xfce or Lxde. Personally using Xubuntu 16.04.3 with custom kernel upgrade to 4.13 official version for better battery and performance. Maybe I use teamviewer to tweak your system. Use either CUDA7.5 or CUDA 8.x
     
  29. Mr.Koala

    Mr.Koala Notebook Virtuoso

    Reputations:
    568
    Messages:
    2,307
    Likes Received:
    566
    Trophy Points:
    131
    A note for people who want a efficient Linux system under low load:

    The modern Linux kernel runs the Intel PState CPU governor on Intel platforms by default. The Intel engineers do understand their own hardware, but even the "powersave" profile is too aggressive. Try playing with CPUfreq, especially the new schedutil governor if you use the system mostly for low-load tasks like text work and normal browsing. You can get a noticeable drop in average power draw and temperature, but hardly any impact on UI responsiveness. Also consider making a few scripts to quickly switch among governors and settings if you plan to do demanding work from time to time. (No switching between PState and CPUfreq on the fly though.)

    On modern Intel mobile CPUs the power draw from CPU core/cache appears to only account for a small proportion of the whole-package power budget when idling. The voltage planes you're controlling simply don't do much.

    I have a Clevo W230SD whose cooling is completely passive under low/intermediate load, so there's no interference from fan control. I run a 100mV undervolt on core/cache/GPU and even in a room where the air temperature is well regulated by a powerful AC I can't see systematic difference in idle CPU temperature at all.
     
    Last edited: Nov 22, 2017
    Vasudev likes this.
  30. Vincent_Tran

    Vincent_Tran Newbie

    Reputations:
    0
    Messages:
    7
    Likes Received:
    3
    Trophy Points:
    6
    I'm a fan of undervolting although what I basically know is to tune the voltage offsets in TS and stress test my laptop xD

    My CPU model is i5-7200U.

    So... here are my voltage offsets and their values in Throttlestop.ini
    • CPU Core: -90.8 mV and 0xF4600000
    • Intel GPU: -80.1 mV and 0xF5C00000
    • CPU Cache: -90.8 mV and 0xF4600000
    • System Agent: None
    • Analog I/O: None
    I hope these will help.
     
    hmscott likes this.
  31. Mr.Koala

    Mr.Koala Notebook Virtuoso

    Reputations:
    568
    Messages:
    2,307
    Likes Received:
    566
    Trophy Points:
    131
    To those who have undervolted successfully, when you read the setting with rdmsr, what kind of output do you see for voltage panels above 0 (CPU core)?

    This is shown in the GitHub repo:
    Code:
    # wrmsr 0x150 0x8000001000000000
    # rdmsr 0x150
    ecc00000
    # wrmsr 0x150 0x8000011000000000
    # rdmsr 0x150
    f0000000
    # wrmsr 0x150 0x8000021000000000
    # rdmsr 0x150
    ecc00000
    But my readings have an extra prefix for non-zero voltage panels:
    Code:
    # for p in `seq 0 2`; do
    #     wrmsr 0x150 0x80000"$p"1000000000
    #     rdmsr 0x150
    # done
    f3400000
    100f3400000
    200f3400000
     
    Vasudev likes this.
  32. jeanne.morreau

    jeanne.morreau Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    I've got those prefixes too for voltages other than CPU core, doesn't matter at all
     
  33. Vincent_Tran

    Vincent_Tran Newbie

    Reputations:
    0
    Messages:
    7
    Likes Received:
    3
    Trophy Points:
    6

    So I tried the method..

    Code:
    sudo wrmsr 0x150 0x80000011f4600000
    sudo wrmsr 0x150 0x80000111f5c00000
    sudo wrmsr 0x150 0x80000211f4600000
    sudo wrmsr 0x150 0x8000031100000000
    sudo wrmsr 0x150 0x8000041100000000
    sudo wrmsr 0x150 0x8000051100000000
    And then read

    Code:
    for p in `seq 0 5`; do sudo wrmsr 0x150 0x80000"$p"1000000000; sudo rdmsr 0x150;  done
    f4600000
    f5c00000
    f4600000
    0
    0
    500000000
    I don't have those prefixes as yours. But my last value looks kinda weird. Can someone also check it to see if it's huge like that?

    Also, should I put the undervolt script into rc.local ? Or just add that script at startup? (I'm new to Ubuntu)
     
    Last edited: Dec 28, 2017
  34. Mr.Koala

    Mr.Koala Notebook Virtuoso

    Reputations:
    568
    Messages:
    2,307
    Likes Received:
    566
    Trophy Points:
    131
    Start up scripts set in the GUI don't have root. Using rc.local will do. Well, you could add a NOPASSWD entry to sudoers if you really want to, but that's another thing to manage.

    The undervolt setting won't stick after S3/S4, so you'll also need this.
     
    Vincent_Tran likes this.
  35. tiziw

    tiziw Newbie

    Reputations:
    5
    Messages:
    1
    Likes Received:
    5
    Trophy Points:
    6
    I've taken the time to make an utility to automate the undervolting process, here's the github link https://github.com/tiziw/iuvolt. It's all in bash, I've also looked how to make it work on boot and sleep with systemd. Improvements are welcome, I'm not very good at bash, but it gets the job done.
     
    Last edited: Dec 31, 2017
    conker_ts, moson, leeloyd and 2 others like this.
  36. moson

    moson Newbie

    Reputations:
    5
    Messages:
    3
    Likes Received:
    3
    Trophy Points:
    6
    Great thread. Thanks tiziw for the iuvolt prog.

    Just bought a Lenovo T480s and undervolted the i7-8650U by -100mv.

    Also I increased TDP to 44 W instead of 15 W.
    Actually in windows it is @44W by default, but in linux you'll have to play around with devmem2 change values @ memory address 0xFED159A0 / 0xFED159A4

    Now it can even beat a 7700HQ :)

    If someone wants to play around with this, the powerlimit msr register is 0x610.
    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 I was still limited to 15W, since there is another place to limit the power consumption in the MCHBAR registers. But with devmem2 i succeeded to change that...

    regards,
    moson
     
    Vasudev likes this.
  37. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Is it persistent even after reboot?
    I want to increase TDP limits of 6700HQ too.
     
  38. moson

    moson Newbie

    Reputations:
    5
    Messages:
    3
    Likes Received:
    3
    Trophy Points:
    6
    Last edited: Mar 19, 2018
  39. Vasudev

    Vasudev Notebook Nobel Laureate

    Reputations:
    12,035
    Messages:
    11,278
    Likes Received:
    8,814
    Trophy Points:
    931
    Stock vs Stock the difference is minimal, once you OC the difference will be massive!
    You just beat my cpu like it was cheap low end chip. :tears:
     
  40. chigro

    chigro Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
  41. 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 00DD8 078

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

    So i changed it to 00DD8 160

    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.
  42. chigro

    chigro Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    Amazing! Thank you, moson!
     
  43. 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?
     
  44. 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.
  45. 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
  46. 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.
  47. senso

    senso Notebook Deity

    Reputations:
    560
    Messages:
    1,645
    Likes Received:
    788
    Trophy Points:
    131
    What is your chipset?

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

    indianahorst Newbie

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

    Chipset is Intel QM77 Express.
     
  49. QuantumCakeIsALie

    QuantumCakeIsALie Notebook Enthusiast

    Reputations:
    2
    Messages:
    36
    Likes Received:
    12
    Trophy Points:
    16
    EDIT: See update at the end!

    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 (-90, -60, -90) 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?

    EDIT:

    I think it was resetting because of thermal throttling, Full Turbo made the CPU reach 98°C in an instant. So I did limit the turbo frequency as well. To limit to 3.0 GHz, I run "wrmsr 0x1ADH 0x1e1e1e1e". I get 80°C to 85°C on sustained 4-cores 100% load at 3.0 GHz without a cooling pad, which I think is pretty good, I might lower the max Turbo frequency further to 2.7 GHz if I plan on letting it run for several hours. Sometimes, less is more!

    So, for a "Long Term Performance" setup with my i7-8550U, this is what I had to do (run as root):

    Code:
    # -90, -60, -90 mV undervolt; CPU Core, iGPU, CPU Cache
    wrmsr 0x150 0x80000011f4800000  
    wrmsr 0x150 0x80000111f8600000  
    wrmsr 0x150 0x80000211f4800000
    
    # 3.0 GHz Turbo for 4/3/2/1 cores
    wrmsr 0x1ADH 0x1e1e1e1e
    
    # Unlock full 44 watts TDP
    wrmsr 0x610 0x42016000dd8160
    devmem2 0xFED159A0 w 0xDD8160
    On a 4-cores/8-threads benchmark, I get 27% to 60% performance increase depending on the specifics of the computation. Not too bad!

    Note: I did put some thermal pads between the CPU heat-sink and the chassis of the laptop to better dissipate heat. I also use a cooling pad for long term computation/gaming that lowers the idle temperature by ~5°C (I didn't test under load). What I posted here is only a guide of what worked specifically for me, use at your own risk.
     
    Last edited: Oct 15, 2018
    conker_ts likes this.
  50. conker_ts

    conker_ts Notebook Guru

    Reputations:
    7
    Messages:
    51
    Likes Received:
    41
    Trophy Points:
    26
    Your tool saves a lot of hassle, this is great.

    It has been a while since I was here the last time. It's really awesome how the thread developed.
    A big thank you for all people who contributed !
     
    Vasudev likes this.
← Previous pageNext page →