Undervolt/Disable Turbo boost for increasing battery life of Macbook and Hackintosh

Discussion in 'Hardware Components and Aftermarket Upgrades' started by tqbinh, Jul 20, 2018.

Thread Status:
Not open for further replies.
  1. tqbinh

    tqbinh Notebook Enthusiast

    Reputations:
    92
    Messages:
    44
    Likes Received:
    32
    Trophy Points:
    26
    A. Introduction
    Hi everbody,
    Following my series of undervolting laptop and saving power consumption in my previous threads:
    - Enable ASPM in T61
    - Undervolting nVidia GPU in T61
    - Make battery life in Windows 10 Bootcamp comparable to OS X
    Today, I will introduce a way to disable Intel Turbo Boost and undervolt CPU/GPU in OS X for both Macbook running native OS X and Hackintosh.
    I spent a lot of my time for searching software in OS X that equivalent to ThrottleStop or Intel XTU in Windows. I had found two apps but both of them are unsatisfactory to me:
    - Turbo Boost Switcher: it can disable turbo boost, but can not undervolt. The use of its free version is not very convenient. This link provides an instruction of using kext load method that is more convenient.
    - Volta: it is advertised as a undervolt software for contemporary Macs. But I never get it working (trial version). May be I don't have enough knowledge to run it :)
    Recently, I found a simple OS X app that can undervolt Haswell and later CPUs, it can also read/write CPU MSR registry. The app is VoltageShift, you can read a brief manual and download it from here and here. My biggest thank to SI Creative for this very fine open source software!!!

    Now, the guide how to use VoltageShift to Undervolt/Disable Turbo Boost.
    Note:
    - Don't do it on pre-Haswell Macs/Hackintoshes (like Ivy Bridge, Sandy Bridge, etc.).
    - This guide was tested on my Macbook Pro Late 2013 (model ME865) and Lenovo Thinkpad T440s (Hackintosh using Clover). Both run OS X High Sierra 10.13.3.

    B. The Guide
    1a. Disable SIP if you are running El Capitan (10.11) and later version on Macbook. The are a lot of web pages about SIP and how to disable it, for example this page. Note: instead of command "csrutil disable" it is better to use this: csrutil enable --without kext
    1b. If you are running Hackintosh using Clover, it's likely that SIP is already disabled, so you don't need to do step 1a.

    2. Download VoltageShift from this page or from this post attachment. Extract and copy it to some folder, in this guide it is the Applications folder.

    3. Set permission to run VoltageShift and it's kext by running these commands in Terminal:
    cd /Applications/voltageshift
    sudo chmod -R 755 VoltageShift.kext
    sudo chown -R root:wheel VoltageShift.kext


    4. VoltageShift is ready to run.
    You can get info about current system state by running this command in terminal
    sudo ./voltageshift info
    or undervolt CPU by 50mV and GPU by 100mV:
    sudo ./voltageshift offset -50 -100
    Note:
    - I assume that current folder Applications/voltageshift, if not, run cd /Applications/voltageshift to go to it.
    - From my experience, all Haswell CPUs are stable when undervolted by -50mV and -100mV. My MBP ME865 also stable at -80mV/140mV. My previous ME866 even can do -110mV/150mV.

    5. Disable Turbo boost using VoltageShift:
    VoltageShift can not disable Turbo Boost directly. However, it has a very powerful feature to read/write CPU's MSR registry. Using this feature, you can play virtually everything with your CPU.
    It is well known that for Core i CPU, Turbo Boost can be enabled/disabled using control bit #32 of registry 0x1a0 (hex value notation of 1a0, with 0x prefix). Setting this bit to 1 will disable Turbo Boost.
    You can use Terminal command: sudo ./voltageshift read 0x1a0 to read the current value of this registry, change it's 32th bit to 0 or 1 to enable/disable Turbo Boost, and then write the modified value using sudo ./voltageshift write 0x1a0 NEW_VAL back to MSR registry. However, it is very complicated to a non-programmer. To overcome this, I wrote a simple MSR_mod.sh helper script to simplify this process. MSR_mod takes three parameters:
    V_ADDRESS: the MSR registry address
    V_OPERATION: bitwise operation (OR for setting to 1, AND for setting to 0, XOR for toggling bit) to be applied to read value.
    V_MODIFICATION_VALUE: the value to do bitwise operation with the read MSR value
    Note: default modification value is 0, default operation is OR, therefore by default, if you omit these parameters, MSR value won't be changed when running the script.

    The substep to manipulate Turbo Boost are as following:
    5a. Download a attached file MSR_mod.zip and extract and copy it to voltageshift folder. In OS X, an app is a folder containing all files to run the app. To open app folder, in Finder right click on app and select Show Package Contents.
    5b. Run the following Terminal commands to disable Turbo Boost:
    cd /Applications/voltageshift
    ./MSR_mod.sh 0x1a0 OR 0x4000000000

    5c. Or run the following Terminal commands to enable Turbo Boost:
    cd /Applications/voltageshift
    ./MSR_mod.sh 0x1a0 AND 0xFFFBFFFFFFFFF


    6. Script to undervolt and disable Turbo Boost:
    To simplify the above procedure, you can download the Undervolt.sh script (in zip file), change undervolt values that suitable to your system (if needed) and then doulbe click it to do undervolting and disabling Turbo Boost.
    The above script need to run when:
    - At start up
    - After resuming from standby
    To auto run script at startup, you can use launchd feature of OS X. Read information about launchd here. I also attached my configuration file (com.tqbinh.undervolt.plist) for auto running script at startup. I put it in folder /Library/LaunchDaemons

    C. Discussion
    1. My Macbook Pro Retina ME865 run much cooler when browsing web pages. But I did not measure power consumption impact of undervolt and disabling Turbo Boost. If you have some data, please, post them in this thread.
    2. To test the system stability, I use Prime 95 (for CPU) and RthDribl (for GPU), both in Windows using Bootcamp. You can download Prime 95 for Mac and other GPU testing software for Mac if you don't have Windows installed.
    3. Besides CPU and GPU voltage offset, there are other four voltage offsets (like UnCore offset,...) but they have a very small impact on power consumption, so you don't need to bother about them, though VoltageShift can manipulate them.
    3. For Mac system, subjectively, GPU voltage undervolt has more impact on power consumption than CPU undervolt. May be due to high resolution of screen and Retina scaling mechanism in OS X.

    Edit (31/7/2018): the above method works only on Haswell and Broadwell CPUs (i.e. Macbook from Late 2013 up to Early 2015 models)
     

    Attached Files:

    Last edited: Jul 31, 2018
  2. Mastermind5200

    Mastermind5200 Notebook Virtuoso

    Reputations:
    370
    Messages:
    2,144
    Likes Received:
    820
    Trophy Points:
    131
    Most laptops can disable turbo boost in BIOS, but congrats on finding a way to undervolt a Mac, impressive. This would do wonders on the new i9
     
  3. jaug1337

    jaug1337 de_dust2

    Reputations:
    2,135
    Messages:
    4,862
    Likes Received:
    1,030
    Trophy Points:
    231
    Impressive, well done!
     
  4. SolidZero

    SolidZero Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    What happens if you apply too much of an undervolt? Will you be able to boot your computer and back off the offset or is it bricked? I’m getting a macbook pro 13” and see that undervolting in general is a great way to improve thermals and battery life and just want to make sure I don’t brick my brand new laptop.. Thanks for understanding :)
     
  5. tqbinh

    tqbinh Notebook Enthusiast

    Reputations:
    92
    Messages:
    44
    Likes Received:
    32
    Trophy Points:
    26
    In general, undervolt is safe. If you set to much voltage offset, the computer will crash, but after turning off the computer, all the voltage settings will reset to default (factory) values.
    However, when the computer seriously crashes, there is a (small) probability that some files of your operating system will be corrupted. So, try to decrease voltage step by step (-5mV in each step is safe).
    By the way, yesterday I have found a way to limit CPU TDP to some small values, say 10W, to make my mac very cool. But I need time to test before posting here.
     
    duttyend likes this.
  6. SolidZero

    SolidZero Newbie

    Reputations:
    0
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    5
    Cool!
    What’s a safe value to start at? -50/-100 CPU/GPU?
     
  7. tqbinh

    tqbinh Notebook Enthusiast

    Reputations:
    92
    Messages:
    44
    Likes Received:
    32
    Trophy Points:
    26
    Yes, IMO, it is safe to start from -50/-100 for Haswell CPUs.
     
    duttyend likes this.
  8. ghostika

    ghostika Newbie

    Reputations:
    0
    Messages:
    1
    Likes Received:
    1
    Trophy Points:
    5
    Can't make it work on my MBP 2016. Can you help me with this ?
    SIP in custom (without kext) mode
    Both permissions commands done
    tried ./voltageshift offset -20 but it keeps showing me 0mv after, even in ./voltageshift info.
     
    duttyend likes this.
  9. tqbinh

    tqbinh Notebook Enthusiast

    Reputations:
    92
    Messages:
    44
    Likes Received:
    32
    Trophy Points:
    26
    If you can run voltageshift then SIP is OK, otherwise you will get an error message.
    But I am sorry that undervolt method via MSR registry at this moment is not supported by Sky Lake (and late model) CPU. Your 2016 macbook model uses Sky Lake CPU.
    I just found information about this in Volta website:
     
    duttyend and hmscott like this.
Loading...
Thread Status:
Not open for further replies.

Share This Page