Giter Site home page Giter Site logo

voltageshift's Introduction

VoltageShift

Undervoltage Tools for MacOS (Haswell and Broadwell)
Change Turbo and Power Limit for most Intel platform Macbook All source code protected by The GNU General Public License V 3.0
MSR Kext Driver modified from AnVMSR by Andy Vandijck Copyright (C) 2013 AnV Software

NOTICE: THIS TOOL IS FOR ADVANCED USERS AND MAY DAMAGE YOUR COMPUTER PERMANENTLY.

This App is not support Apple Silicon.

You can download this software´s binary from: VoltageShift

Building

Xcode is required.

# Build the kernel extension (kext)
xcodebuild  -target VoltageShift
# Change owner
sudo chown -R root:wheel build/Release/VoltageShift.kext
# Build command line tool
xcodebuild  -target voltageshift

Usage

This program is a command tool that supports Haswell and above CPUs for undervoltage and TDP setting. Apple locked the OC capability for newer devices or firmware, if the info show "OC_Locked" mean not able to undervolt, however, you can still disable Turbo and set Power Limit to reduce heat, fan noise or battery life.

It uses the 'Intel Overclock Mailbox' for controling the voltage offset,

Undervoltage can reduce heat and sustain Turbo boost longer, provide longer battery performance, although if done too much(mV) it may cause an unstable system.

This program supports macOS 10.12 or above, however you need to switch off the SIP for unsigned kext in Recovery mode:

Push Cmd+R when booting to Recovery mode, select Terminal at toolbar and enter:

csrutil enable --without kext

After reboot, ensure the kext and the command tool files are in the same directory.

For Big Sur, a diaglog will showed when first launched, tick Grey button redirect to System Preferences>Security & Privacy and allow the kext loaded, reboot take the effective.

You can view your current voltage offset,CPU freqency,power and temperture settings with the following command:

./voltageshift info

You can continue to monitor the CPU frequency, power and temperture by using:

./voltageshift mon

Six types of voltage offsets are dispenible to change, however we only suggest undervolting the CPU and GPU only.

./voltageshift offset <CPU> <GPU> <CPUCache> <SystemAgent> <Analogy I/O> <Digital I/O>

for example reduced CPU -50mv and GPU -30mv

./voltageshift offset -50 -30

If you set too low the system will freeze, please turn OFF completely and turn ON computer to reset back the undervolt to 0mV.

After you test throughfuly the settings and are comfortable with System stability, you can apply the launchd: (require sudo root)

sudo ./voltageshift buildlaunchd <CPU> <GPU> <CPUCache> <SA> <AI/O> <DI/O> <turbo> <pl1> <pl2> <remain> <UpdateMins (0 only apply at bootup)>

If remain is set to 1, the kext will remain on system

The is the update interval of the tool to check and change, the Default value is 160min, Hibernate (suspend to Disk) will reset the voltage setting, as sleep (suspend to memory) will not change the sleep value, it will scheduled check the setting in peroid, and amend if need. 0 is for applying the setting at bootup only.

for example:

sudo ./voltageshift buildlaunchd  -50 -50 0 0 0 0 0 0 1 50 80 1 160

set system auto apply CPU -50mv and GPU -50mv, close Turbo, and set PL1 to 50, PL2 to 80, run every boot and every 160min and kext remain on system .

sudo ./voltageshift buildlaunchd  0 0 0 0 0 0 0 -1

switch off turbo only, run every boot and every 160min .

sudo ./voltageshift buildlaunchd  -20 0 -20 0 0 0 0 -1 -1 -1 0

set system auto apply CPU -20mv and cache -20mv, run only boot .

You can remove the launchd with the following command:

 ./voltageshift removelaunchd

For load the kext in current directory (remaining kext driver on system)

./voltageshift loadkext

or

sudo kextutil  -r ./  -b com.sicreative.VoltageShift

For unload the kext

./voltageshift unloadkext

or

sudo kextunload -b com.sicreative.VoltageShift

For check the kext is loaded

kextstat | grep -v com.apple

should show "com.sicreative.VoltageShift" on return.

Caution: Remaining the kext on system may violate system because other program may change the MSR without root (sudo) authorizing.

ChangeLog

Versions 1.25:

  1. Support kext remaining on System

Versions 1.24:

  1. Support Big Sur and Universial building on Xcode12 (load on Apple Silicon will simply exit )

Version 1.22:

  1. Change read of timer from system api instead of MSR for improve of compatibility.

Version 1.21:

  1. Updated to support auto set Turbo / Power when startup
  2. Default close "offset" for read temp. sensor. (As some system may have issue) [Charlyo]

Version 1.2:

  1. Updated to support up to 8 core CPU
  2. Updated setting of turbo boost
  3. Updated setting of power limited
  4. Additional power limited and turbo boost status showed on -info
  5. Detect Apple BIOS overclock lock (OC_Locked)

Additional

Use '--damage offset ...' if you want settings lower than 250mv or Overvoltage (>0v).

Manually change the launchd (com.sicreative.VoltageShift.plist under /Library/LaunchDaemons) by adding new ProgramArguments '--damage' between '/Library/Application Support/VoltageShift/voltageshift' and 'offsetdaemons'

To read the MSR

  ./voltageshift read <HEX_MSR>

To set the MSR

 ./voltageshift write <HEX_MSR> <HEX_VALUE>

To set the Power Limted of PL1 (Long Term) and PL2 (Short Term)

./voltageshift power <PL1> <PL2>

To set Turbo Enabled (0-no turbo 1-turbo):

./voltageshift turbo <0/1>

voltageshift's People

Contributors

abn5x avatar artoria2e5 avatar charlyo avatar ridvan-cln avatar sicreative avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voltageshift's Issues

Noob Needs Help!

This is probably an issue with my zsh path but I don't know how to fix. Running:
./voltageshift info

Returns:
zsh: no such file or directory: ./voltageshift

How do I fix this?

Thanks in advance!

Big Sur breaks Voltageshift

macOS 11.0 Beta appears to break all functionality. Commands return no result initially. After changing ownership again with:

chown -R root:wheel

and trying a command again, we get the following error:

Error: Error Domain=KMErrorDomain Code=1 "Kernel request failed: (libkern/kext) not found" UserInfo={NSLocalizedDescription=Kernel request failed: (libkern/kext) not found}

My (extremely limited) understanding is that there is has been a fundamental change in the way extensions are handled in 11.0. Any word on if this change can be worked around?

Description of OC mailbox

Hi @sicreative, could you tell me where you found the description of OC mailbox and relating stuff (e.g. voltage offsets)?

Thank you for this awesome tool!

Official release 🙏

I'm not an expert
I've cloned the repo, tried to build, changed the settings, changed signing to personal, changed the target to match the os version, 10.15. So I got it to the point where everything is ready, except:

But of course I can't load the kext because it's not signed by a real developer.

Sadly it's a work mac and it has MDM and I cannot disable the protection mode...

Thus, I'm wondering, what would it take to publish official releases of this kext?
Something that will be trusted by macs?

The summer is here, so it's pertinent now :)

Documentation on power levels?

Hi,

thanks for this nice little app. I really like what it does.
I'd like to test the power limit functionality but I have no idea where to start. I have a MacBook Pro 13, Late 2013, i7, 2,8GHz and currently the values are PL1=100, PL2=125. Are there any sources on good values to balance power and heat?

Sorry for posting this here since it's not really an issue of the app...

Set temp limit.

Thank you for this great tool sicreative! Seen some reports earlier about power limits not working. They do but but we are throttled with temps so if you could add another argument to your voltageshift it would make perfect app for us!
Have a look here https://github.com/georgewhewell/undervolt as it's similar project to yours.
I'm unfortunately got no idea about programming :(

VoltageShift code signature seems to be revoked

Hello,

I'd like to report that it seems that the certificate or whatever of VoltageShift is invalidated.

I tried to run VoltageShift but it exits immediately and without explanation. As I checked in dmesg it shows that the executable's code signature is invalid.

image

I've tried redownloading new files but the message is still the same. This happens from yesterday. Previously VoltageShift works just fine.

Successful macbook overclocking?

I‘ve tried several tricks with registers on my macbook air 2013, but nothing actually worked. Is there any successful experience of raising turbo boost clock for some macbook?
Thanks

Instant Kernel Panic on Mojave 10.14.x, Haswell MacBookPro

Hi, following to the previous topic. I tried to execute these commands..
./voltageshift read 0x???

0x606 0x194 0x1a0 0x610 0xce 0x611 0x639 0x637 0x639 0x198 0x1a20x19c

And after using ./voltageshift 0x637 .The system instantly reboot..
Is there enough information for you? Thank you so much for creating such an amazing kext.
I would provide as many information as I can.

Doesn't work for mac 2018 (mac os:10.13.6)

I try this tool with mac 2018(i7-8850h), but the offset is always 0.


sudo ./voltageshift offset -75 -50 -75
--------------------------------------------------------------------------
VoltageShift offset Tool
--------------------------------------------------------------------------
Before CPU voltageoffset: 0mv
Before GPU voltageoffset: 0mv
Before CPU Cache: 0mv
--------------------------------------------------------------------------
After CPU voltageoffset: 0mv
After GPU voltageoffset: 0mv
After CPU Cache: 0mv
--------------------------------------------------------------------------

macbook air 2019

not compatible with macbook air 2019

Hi I have often used this tool to undervolt various mac and hackintosh, I was wondering if it is compatible with amber lake y cpu. I'm trying to use it on my air 2019 but it doesn't seem to work

Ivy Bridge

@sicreative I did read in one of the earlier closed issues that voltageshifter doesn’t support Ivy Bridge processors due to lack of “OC Mailbox”. Does this also affect disabling BD-PROCHOT via 0x1FC register?

It’s interesting that I could disable BD PROCHOT using both ThrottleStop on Windows as well as MSR-Tools on Ubuntu ( rdmsr/wrmsr commands).

What’s even more interesting is that I can toggle bit[0] of 0x1FC using voltageshifter on Catalina, yet the max freq wouldn’t budge (Intel Power Gadget). I can also enable/disable turbo. But when I try to read any other register (say for example 0x770) or run ‘voltageshifter mon’ my machine would reboot (I suspect it’s because Ivy Bridge processor might cause reading of those specific registers into kernel panic due to lack of ‘OC Mailbox’).

Not working on High Sierra (10.13.6)

./voltageshift -130 -45

//Before 0mv / 0mv
//After 0mv /0mv

./voltageshift mon
//OC mailbox cmd failed

------------------------------------------------------
   VoltageShift Monitor Tool
------------------------------------------------------
    Ctl-C for Exit

   CPU voltage offset: 0mv
   GPU voltage offset: 0mv
   CPU Cache voltage offset: 0mv
   System Agency offset: 0mv
   Analogy I/O: 0mv
OC mailbox cmd failed
   Digital I/O: 0mv

Macbook Pro 2017 15" (Kaby Lake/7920HQ)

hackintosh 10.15.5 (i7 8550u) ./voltageshift power 40 44 not work

My version of the system is 10.15.5 with hackintosh. cpu is i7 8550u.
I tried using this site(https://sitechprog.blogspot.com/2017/06/voltageshift.html) to download the latest files(10.15 or above) and compile them myself from the master
And the following command is executed

 sudo chown -R root:wheel VoltageShift.kext

I changed PL1 40
./voltageshift power 40 44
Here is the log

------------------------------------------------------
   VoltageShift Info Tool
------------------------------------------------------
WRMSR 150 with value 0x8000001000000000
RDMSR 150 returns value 0xf3800000
CPU voltage offset: -100mv
WRMSR 150 with value 0x8000011000000000
RDMSR 150 returns value 0x0
GPU voltage offset: 0mv
WRMSR 150 with value 0x8000021000000000
RDMSR 150 returns value 0x0
CPU Cache voltage offset: 0mv
WRMSR 150 with value 0x8000031000000000
RDMSR 150 returns value 0x0
System Agency offset: 0mv
WRMSR 150 with value 0x8000041000000000
RDMSR 150 returns value 0x0
Analogy I/O: 0mv
WRMSR 150 with value 0x8000051000000000
OC mailbox cmd failed
RDMSR 150 returns value 0x500000000
Digital I/O: 0mv
CPU BaseFreq: 2000, CPU MaxFreq(1/2/4): 4000/4000/3700 (mhz)  PL1: 40W PL2: 44W
CPU Freq: 1.3ghz, Voltage: 0.6387v, Power:pkg 2.54w /core 0.47w,Temp: 47 c

Then I tested CineBench R20, but the PL1 was still the default 15W

./voltageshift mon
------------------------------------------------------
   VoltageShift Monitor Tool
------------------------------------------------------
    Ctl-C to Exit

WRMSR 150 with value 0x8000001000000000
RDMSR 150 returns value 0xf3800000
   CPU voltage offset: -100mv
WRMSR 150 with value 0x8000011000000000
RDMSR 150 returns value 0x0
   GPU voltage offset: 0mv
WRMSR 150 with value 0x8000021000000000
RDMSR 150 returns value 0x0
   CPU Cache voltage offset: 0mv
WRMSR 150 with value 0x8000031000000000
RDMSR 150 returns value 0x0
   System Agency offset: 0mv
WRMSR 150 with value 0x8000041000000000
RDMSR 150 returns value 0x0
   Analogy I/O: 0mv
WRMSR 150 with value 0x8000051000000000
OC mailbox cmd failed
RDMSR 150 returns value 0x500000000
   Digital I/O: 0mv

CPU BaseFreq: 2000, CPU MaxFreq(1/2/4): 4000/4000/3700 (mhz)  PL1: 40W PL2: 44W
CPU Freq: 2.3ghz, Voltage: 0.7941v, Power:pkg 14.23w /core 12.87w,Temp: 57 c^C
 quit? [y/n] y

Is injecting voltageshift kext with the bootloader a good idea?

Good morning, thanks for your work.
This idea may concern those who use custom bootloader in Macs and who’s running an hackintosh.
Following this post: https://www.reddit.com/r/hackintosh/comments/h84k1b/voltageshiftkext_in_efi/ it should be possible to load the kext from efi, editing that two functions.
Is it a memory-friendly idea or it could impact on the system performance if the kext is injected from bootloader?
Thanks in advance

Can I disable turboboost on startup?

This script work for me well, my system goes to sleep often and I don't wanna deal with .command files every time. But I cannot manage to disable turbo boost automatically. Any help?

sudo ./voltageshift buildlaunchd -40 -45 -70 0 0 0 5

Mojave TDP buildlaunchd

Hello, i would like to use the feature to set the tdp limit on the launch daemon in Mojave but i can't make it work with the newest versions on the website. I was able to get around the "killed 9" erorr with the stripped signature, but now it will not do anything, every command will just pause the terminal for a sec.

Did sudo chown -R root:wheel VoltageShift.kext
Did chmod +x voltageshift
I have removed all the files with " sudo rm -rf /Library/Application Support/VoltageShift/ "
Rebooted

The build for Mojave is 1.1 that does not have TDP on launchd

Is there any way to have a 1.21 build on mojave?

Missing value?

Hi. Looking at the manual.

This sudo ./voltageshift buildlaunchd -50 -50 0 0 0 0 50 80 160 appears to be missing one value. It should be 10 values, should it not?

How to keep MSR settings?

I wonder if I can set MSR in launchd, then I can keep the undervolt & MSR power settings after reboots.

Turbo disables by itself

my turbo boost gets disabled after some time like 10-15 mins and I cant find out why,I can enable it manually but it happens everytime.
laptop Legion y540 opencore

Adjust GPU only...

System is a new imac with an rx580...I do not want to touch the CPU voltage, just the GPU.

Has anyone tested this? Will adjusting the GPU clock still work even if you have a newer CPU?

Catalina 10.15.6

hi, i built successfully on latest Macos Cataling but nothing happens when issuing basic command like:
sudo ./voltageshift info
It used to work on 10.15.5...
any advice ?

problem solved. had to go into recovery mode and
'csrutil enable --without kext'
all good thanks!

Skylake compatibility

I use a 2016 Touch Bar MacBook Pro and it appears I can't get it to work on Skylake. Does this tool support Skylake CPU's?

Possible to modify for older macs?

I still have a MacBook 5,5 with a core2duo CPU running a patched High Sierra. Up until recently I have been running Mavericks and there I used Coolbook for undervolting. But it seems that there is no way to get this to work on High Sierra. Do you think it would generally be possible to modify your code to work for this old CPU? If you could point me in the right direction I would love to try it.

FYI using binaries for novice users

For novice users it would be helpful to add this in Readme.md


How to use binary?

Binary builds may not work for everyone, due to target OS/library module mismatch/deprecation. This is why you would often see many MSR read/write repos asking you to build your own binaries from Xcode project instead of that one click solution to tweak with CPU registers (unlike Windows where ThrottleStop is one-stop solution for all PROCHOT/Turbo and frequency stepping needs). That being said, if Xcode is not readily available to you or the recent 11 gigs of Xcode install disk is too big to download/setup, you may go ahead and try one of the binary builds usually released by author every often.

First download this repo as zip file. Next locate binary builds (zip file). Unzip and you'll see two files VoltageShift.kext and voltageshift

There are two pre-requisites before you can run voltageshift info command. First being to disable signed kext requirement in recovery mode (I can second this as opposed to running csrutil disable). Quoted from Readme.md,

Push Cmd+R when booting to Recovery mode, select Terminal at toolbar and enter:
csrutil enable --without kext
After reboot, ensure the kext and the command tool files are in the same directory.

The second requirement, and this one seemed to be forgotten by many when using binaries,

sudo chown -R root:wheel VoltageShift.kext

Without change of ownership, even if you executed command voltageshift info in terminal, nothing would be echoed/returned back in terminal shell.

Once done, you can run voltage shift with the following command,

./voltageshift info


If you want to fire up voltageshift as command from within terminal window, you should copy voltageshift to /usr/local/bin/ and VoltageShift.kext to /Library/Extensions/ and make sure to change ownership of kext within the library extensions folder using chown command as mentioned above.

sudo cp voltageshift /usr/local/bin

sudo cp -r VoltageShift.kext /Library/Extensions/

Now you can run _voltagehift in terminal window as command,

voltageshift info

I like to do this to use voltageshift within apple scripts (Automator) to cycle up/down CPU for intensive workloads.

Cannot compile

I am using OS X 10.14.2. When I tried to run the following in the voltageshift directory:

xcodebuild -target VoltageShift.kext

It says:

xcodebuild: error: The project 'VoltageShift.xcodeproj' does not contain a target named 'VoltageShift.kext'.

Settings are reset after wake up from sleep

As the title, I had problems with the settings being reset after wake up from sleep. I tried adding file /Library/LaunchDaemons/com.sicreative.VoltageShift.plist to the login item but it didn't work.
image

[BUG] Can't get registry-entry path Sierra last patch

On sierra, execution finishes at printf("Can't get registry-entry path\n"); inside getService() function on main.

ret = IORegistryEntryGetPath(service, kIOServicePlane, path);
	if (ret != KERN_SUCCESS) {
		printf("Can't get registry-entry path\n");
		goto failure;
	}

Any idea on how to solve this problem?

No CLI output on 10.13

Getting no output when running any command from the compiled binary provided on a mid-2014 15" rMBP with SIP disabled.

Does not work on macOS 10.14

As per #4 (comment)

Disabling SIP altogether gives the necessary permissions for voltage modulating apps on macOS Mojave. Unfortunately, VoltageShift causes the machine to restart when calling any of the arguments (info, mon, etc). Nevertheless, the macOS app Volta seems to work fine after csrutil disable.

Build failed in Mojave,Xcode 10.3

System Version: 10.14.6 (18G87)
Xcode Version: 10.3 (10G8)
I cloned this project and failed to build it, Xcode said:
main.mm:697:46: Use of undeclared identifier 'CLOCK_REALTIME'
It seems that the definition was remove in new MacOS. Any suggestion?

Wrong temperature display

When the core temp is lower than 37C the tool shows ~100C

Problem in main.mm:808
uint64 margintothrottle = out.param >> 16 & 0x3F, which truncates the read value to 63 max

Suggested fix:
uint64 margintothrottle = out.param >> 16 & 0xFF

Nothing changed on 2017 İmac and 2018 MacBook Pro

Hi i have 2017 27" iMac (i7-7700K) and 2018 15" MacBook Pro (i7-8750H) both running 10.15.4 Catalina
I want to make an undervolt but i can't want to turn off SİP (csrutil enable --without kext) because some programs are want to csrutil disable status (ex. TotalFinder)
Is there another way to undervolt my computers cpu?

Here is iMac terminal command is there anything i am doing wrong?
Ekran Resmi 2020-04-08 15 03 14

No output after on 10.14.6 Hackintosh with version 1.22

There is no output except ./ voltageshift, The command ./voltageshift can return the help and version information (VoltageShift Undervoltage Tool v 1.21)
However there is no any other output with other commands(eg. ./voltageshift info ./voltageshift mon). It looks like:
➜ voltageshift ./voltageshift info
➜ voltageshift

I have updated the command line tool and kext to 1.22 version and also changed the owner to root:wheel as the instruction mentioned.

BTW 1.20 works well but I have deleted the origin files.

Anyone knows how to solve this and appreciate!

Making ACPI Calls

Hello all! First of all thank you for this great tool and tremendous work!

I recently transitioned from Windows-Linux combinations to macOS Catalina with my Asus UX430UNR and totally hackintosh noob. My laptop comes with battery charge threshold by default, and it's controlled by a charging circuit which can be programmed by simple ACPI calls. An example of how I done it in Linux is in here.

As it can be seen from the link;

Code:
$ echo "\_SB.PCI0.LPCB.EC0.WRAM 0x3af 0x50" > /proc/acpi/call

this block makes the appropriate ACPI call and activates the thresholding circuit for the desired threshold level.

So the thing I wonder is, how this command differs from ./voltageshift write?

Best wishes...

Killed error

Just yesterday i've used this utility without any issue.
MacBook Air 13" 2015 (Core i5-5250U), macOS 10.15.1

Снимок экрана 2020-01-18 в 18 40 51

RMBP 11,3 reboot on each use

After trying both the already compiled binary and a manual compilation, I've always ended up with forced reboot when trying to execute any of the comands. Currently I'm running macOS 10.12.6 on my 2014 retina macbook pro 11.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.