XiaoMi-Pro-Hackintosh icon indicating copy to clipboard operation
XiaoMi-Pro-Hackintosh copied to clipboard

TDP change in macOs

Open Menchen opened this issue 5 years ago • 26 comments

Hello, I found a way to change TDP limit(confirmed with AppleIntelInfo) with MSR in macOs, but it seems not affected at all(still 3s 45W and back to 15W)... Maybe there something to do about PM(tested with both balanced and performance CpuFriendDataProvider.kext generated with one-key-cpu and with HWP).

I have bios version 603 with all mod patched.

There's my AppleIntelInfo dump

AppleIntelInfo.kext v2.9 Copyright © 2012-2017 Pike R. Alpha. All rights reserved.

Settings:
------------------------------------------
logMSRs..................................: 1
logIGPU..................................: 1
logCStates...............................: 1
logIPGStyle..............................: 1
InitialTSC...............................: 0x5a37dc5d5b5 (309 MHz)
MWAIT C-States...........................: 286531872

Processor Brandstring....................: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz

Processor Signature..................... : 0x806EA
------------------------------------------
 - Family............................... : 6
 - Stepping............................. : 10
 - Model................................ : 0x8E (142)

Model Specific Registers (MSRs)
------------------------------------------

MSR_IA32_PLATFORM_ID.............(0x17)  : 0x1C000000000000
------------------------------------------
 - Processor Flags...................... : 7

MSR_CORE_THREAD_COUNT............(0x35)  : 0x40008
------------------------------------------
 - Core Count........................... : 4
 - Thread Count......................... : 8

MSR_PLATFORM_INFO................(0xCE)  : 0x4043DF1011400
------------------------------------------
 - Maximum Non-Turbo Ratio.............. : 0x14 (2000 MHz)
 - Ratio Limit for Turbo Mode........... : 1 (programmable)
 - TDP Limit for Turbo Mode............. : 1 (programmable)
 - Low Power Mode Support............... : 1 (LPM supported)
 - Number of ConfigTDP Levels........... : 2 (additional TDP level(s) available)
 - Maximum Efficiency Ratio............. : 4
 - Minimum Operating Ratio.............. : 4

MSR_PMG_CST_CONFIG_CONTROL.......(0xE2)  : 0x7E000008
------------------------------------------
 - I/O MWAIT Redirection Enable......... : 0 (not enabled)
 - CFG Lock............................. : 0 (MSR not locked)
 - C3 State Auto Demotion............... : 1 (enabled)
 - C1 State Auto Demotion............... : 1 (enabled)
 - C3 State Undemotion.................. : 1 (enabled)
 - C1 State Undemotion.................. : 1 (enabled)
 - Package C-State Auto Demotion........ : 1 (enabled)
 - Package C-State Undemotion........... : 1 (enabled)

MSR_PMG_IO_CAPTURE_BASE..........(0xE4)  : 0x51814
------------------------------------------
 - LVL_2 Base Address................... : 0x1814
 - C-state Range........................ : 5 (C-States not included, I/O MWAIT redirection not enabled)

IA32_MPERF.......................(0xE7)  : 0x1E94AB01E41
IA32_APERF.......................(0xE8)  : 0xF64A15BC3C

MSR_FLEX_RATIO...................(0x194) : 0x0
------------------------------------------

MSR_IA32_PERF_STATUS.............(0x198) : 0x251B00002500
------------------------------------------
 - Current Performance State Value...... : 0x2500 (3700 MHz)

MSR_IA32_PERF_CONTROL............(0x199) : 0xA00
------------------------------------------
 - Target performance State Value....... : 0xA00 (1000 MHz)
 - Intel Dynamic Acceleration........... : 0 (IDA engaged)

IA32_CLOCK_MODULATION............(0x19A) : 0x0

IA32_THERM_INTERRUPT.............(0x19B) : 0x10
------------------------------------------
 - High-Temperature Interrupt Enable.... : 0 (disabled)
 - Low-Temperature Interrupt Enable..... : 0 (disabled)
 - PROCHOT# Interrupt Enable............ : 0 (disabled)
 - FORCEPR# Interrupt Enable............ : 0 (disabled)
 - Critical Temperature Interrupt Enable : 1 (enabled)
 - Threshold #1 Value................... : 0
 - Threshold #1 Interrupt Enable........ : 0 (disabled)
 - Threshold #2 Value................... : 0
 - Threshold #2 Interrupt Enable........ : 0 (disabled)
 - Power Limit Notification Enable...... : 0 (disabled)

IA32_THERM_STATUS................(0x19C) : 0x882E2800
------------------------------------------
 - Thermal Status....................... : 0
 - Thermal Log.......................... : 0
 - PROCHOT # or FORCEPR# event.......... : 0
 - PROCHOT # or FORCEPR# log............ : 0
 - Critical Temperature Status.......... : 0
 - Critical Temperature log............. : 0
 - Thermal Threshold #1 Status.......... : 0
 - Thermal Threshold #1 log............. : 0
 - Thermal Threshold #2 Status.......... : 0
 - Thermal Threshold #2 log............. : 0
 - Power Limitation Status.............. : 0
 - Power Limitation log................. : 1
 - Current Limit Status................. : 0
 - Current Limit log.................... : 1
 - Cross Domain Limit Status............ : 0
 - Cross Domain Limit log............... : 0
 - Digital Readout...................... : 46
 - Resolution in Degrees Celsius........ : 1
 - Reading Valid........................ : 1 (valid)

MSR_THERM2_CTL...................(0x19D) : 0x0

IA32_MISC_ENABLES................(0x1A0) : 0x850089
------------------------------------------
 - Fast-Strings......................... : 1 (enabled)
 - FOPCODE compatibility mode Enable.... : 0
 - Automatic Thermal Control Circuit.... : 1 (enabled)
 - Split-lock Disable................... : 0
 - Performance Monitoring............... : 1 (available)
 - Bus Lock On Cache Line Splits Disable : 0
 - Hardware prefetch Disable............ : 0
 - Processor Event Based Sampling....... : 0 (PEBS supported)
 - GV1/2 legacy Enable.................. : 0
 - Enhanced Intel SpeedStep Technology.. : 1 (enabled)
 - MONITOR FSM.......................... : 1 (MONITOR/MWAIT supported)
 - Adjacent sector prefetch Disable..... : 0
 - CFG Lock............................. : 0 (MSR not locked)
 - xTPR Message Disable................. : 1 (disabled)

MSR_TEMPERATURE_TARGET...........(0x1A2) : 0x2640000
------------------------------------------
 - Turbo Attenuation Units.............. : 0 
 - Temperature Target................... : 100
 - TCC Activation Offset................ : 2

MSR_MISC_PWR_MGMT................(0x1AA) : 0x401CC1
------------------------------------------
 - EIST Hardware Coordination........... : 1 (hardware coordination disabled)
 - Energy/Performance Bias support...... : 1
 - Energy/Performance Bias.............. : 0 (disabled/MSR not visible to software)
 - Thermal Interrupt Coordination Enable : 1 (thermal interrupt routed to all cores)
 - SpeedShift Technology Enable......... : 1 (enabled)
 - SpeedShift Interrupt Coordination.... : 1 (enabled)
 - SpeedShift Energy Efficient Perf..... : 1 (enabled)
 - SpeedShift Technology Setup for HWP.. : Yes (setup for HWP)

MSR_TURBO_RATIO_LIMIT............(0x1AD) : 0x25252828
------------------------------------------
 - Maximum Ratio Limit for C01.......... : 28 (4000 MHz) 
 - Maximum Ratio Limit for C02.......... : 28 (4000 MHz) 
 - Maximum Ratio Limit for C03.......... : 25 (3700 MHz) 
 - Maximum Ratio Limit for C04.......... : 25 (3700 MHz) 

IA32_ENERGY_PERF_BIAS............(0x1B0) : 0x5
------------------------------------------
 - Power Policy Preference...............: 5 (balanced performance and energy saving)

MSR_POWER_CTL....................(0x1FC) : 0x24005F
------------------------------------------
 - Bi-Directional Processor Hot..........: 1 (enabled)
 - C1E Enable............................: 1 (enabled)

MSR_RAPL_POWER_UNIT..............(0x606) : 0xA0E03
------------------------------------------
 - Power Units.......................... : 3 (1/8 Watt)
 - Energy Status Units.................. : 14 (61 micro-Joules)
 - Time Units .......................... : 10 (976.6 micro-Seconds)

MSR_PKG_POWER_LIMIT..............(0x610) : 0x42816000FC80A0
------------------------------------------
 - Package Power Limit #1............... : 20 Watt
 - Enable Power Limit #1................ : 1 (enabled)
 - Package Clamping Limitation #1....... : 0 (disabled)
 - Time Window for Power Limit #1....... : 126 (2147483648 milli-Seconds)
 - Package Power Limit #2............... : 44 Watt
 - Enable Power Limit #2................ : 1 (enabled)
 - Package Clamping Limitation #2....... : 0 (disabled)
 - Time Window for Power Limit #2....... : 33 (10 milli-Seconds)
 - Lock................................. : 0 (MSR not locked)

MSR_PKG_ENERGY_STATUS............(0x611) : 0x10BCD06A
------------------------------------------
 - Total Energy Consumed................ : 17139 Joules (Watt = Joules / seconds)

MSR_PP0_POWER_LIMIT..............(0x638) : 0x0

MSR_PP0_ENERGY_STATUS............(0x639) : 0xD57BAEA
------------------------------------------
 - Total Energy Consumed................ : 13662 Joules (Watt = Joules / seconds)

MSR_PP0_POWER_LIMIT..............(0x638) : 0x0

MSR_PP0_ENERGY_STATUS............(0x639) : 0xD57BBC1
------------------------------------------
 - Total Energy Consumed................ : 13662 Joules (Watt = Joules / seconds)

MSR_PP1_POWER_LIMIT..............(0x640) : 0x0

MSR_PP1_ENERGY_STATUS............(0x641) : 0x457736
------------------------------------------
 - Total Energy Consumed................ : 277 Joules (Watt = Joules / seconds)

MSR_PP1_POLICY...................(0x642) : 0x18
------------------------------------------
 - Priority Level....................... : 24

MSR_CONFIG_TDP_NOMINAL...........(0x648) : 0x12
MSR_CONFIG_TDP_LEVEL1............(0x649) : 0x80050
MSR_CONFIG_TDP_LEVEL2............(0x64a) : 0x1400C8
MSR_CONFIG_TDP_CONTROL...........(0x64b) : 0x0
MSR_TURBO_ACTIVATION_RATIO.......(0x64c) : 0x0
MSR_PKGC3_IRTL...................(0x60a) : 0x884E
MSR_PKGC6_IRTL...................(0x60b) : 0x8876
MSR_PKGC7_IRTL...................(0x60c) : 0x8894
MSR_PKG_C2_RESIDENCY.............(0x60d) : 0xC6C7375684
MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x1DA4014D40
MSR_PKG_C2_RESIDENCY.............(0x60d) : 0xC6C7375684
MSR_PKG_C3_RESIDENCY.............(0x3f8) : 0x1DA4014D40
MSR_PKG_C6_RESIDENCY.............(0x3f9) : 0x1F42FA01B9C
MSR_PKG_C7_RESIDENCY.............(0x3fa) : 0x99CD8C2C8
MSR_PKG_C8_RESIDENCY.............(0x630) : 0x37AF14E650
MSR_PKG_C9_RESIDENCY.............(0x631) : 0x0
MSR_PKG_C10_RESIDENCY............(0x632) : 0x0
MSR_PKG_C8_LATENCY...............(0x633) : 0x37AF14E650
MSR_PKG_C9_LATENCY...............(0x634) : 0x0
MSR_PKG_C10_LATENCY..............(0x635) : 0x0

MSR_PLATFORM_ENERGY_COUNTER......(0x64D) : 0x8A2B320 
------------------------------------------

MSR_PPERF........................(0x64E) : 0x1F318860383
------------------------------------------
 - Hardware workload scalability........ : 2143600116611

MSR_CORE_PERF_LIMIT_REASONS......(0x64F) : 0x3D001000
------------------------------------------
 - PROCHOT Status....................... : 0
 - Thermal Status....................... : 0
 - Residency State Regulation Status.... : 0
 - Running Average Thermal Limit Status. : 0
 - VR Therm Alert Status................ : 0
 - VR Therm Design Current Status....... : 0
 - Other Status......................... : 0
 - Package/Platform-Level #1 Power Limit : 0
 - Package/Platform-Level #2 Power Limit : 0
 - Max Turbo Limit Status............... : 1 (frequency reduced below OS request due to multi-core turbo limits)
 - Turbo Transition Attenuation Status.. : 0
 - PROCHOT Log.......................... : 0
 - Thermal Log.......................... : 0
 - Residency State Regulation Log....... : 0
 - Running Average Thermal Limit Log.... : 0
 - VR Therm Alert Log................... : 0
 - VR Thermal Design Current Log........ : 0
 - Other Status Log..................... : 1 (status bit has asserted)
 - Package/Platform-Level #1 Power Limit : 1 (status bit has asserted)
 - Package/Platform-Level #2 Power Limit : 1 (status bit has asserted)
 - Max Turbo Limit Log.................. : 1 (status bit has asserted)
 - Turbo Transition Attenuation Log..... : 1 (status bit has asserted)
HDC Supported

IA32_PKG_HDC_CTL.................(0xDB0) : 0x0

IA32_PM_CTL1.....................(0xDB1) : 0x1
------------------------------------------
HDC Allow Block..................(0xDB1) : 1 (HDC blocked)

IA32_THREAD_STALL................(0xDB2) : 0x0

MSR_PKG_HDC_CONFIG...............(0x652) : 0x2
------------------------------------------
Pkg Cx Monitor ..................(0x652) : 2 (count package C3 and deeper)
MSR_CORE_HDC_RESIDENCY...........(0x653) : 0x0

MSR_PKG_HDC_SHALLOW_RESIDENCY....(0x655) : 0x0

MSR_PKG_HDC_DEEP_RESIDENCY.......(0x656) : 0x0

IA32_TSC_DEADLINE................(0x6E0) : 0x5A380DF5056
MSR_PPERF........................(0x63E) : 0x1 (44)

IA32_PM_ENABLE...................(0x770) : 0x1 (HWP Supported and Enabled)

IA32_HWP_CAPABILITIES............(0x771) : 0x1091228
-----------------------------------------
 - Highest Performance.................. : 40
 - Guaranteed Performance............... : 18
 - Most Efficient Performance........... : 9
 - Lowest Performance................... : 1

IA32_HWP_INTERRUPT...............(0x773) : 0x1
------------------------------------------
 - Guaranteed Performance Change........ : 1 (Interrupt generated on change of)
 - Excursion Minimum.................... : 0 (Interrupt generation disabled)

IA32_HWP_REQUEST................(0x774) : 0x282804
-----------------------------------------
 - Minimum Performance................. : 4
 - Maximum Performance................. : 40
 - Desired Performance................. : 40
 - Energy Efficient Performance........ : 0
 - Activity Window..................... : 0, 0
 - Package Control..................... : 0

IA32_HWP_STATUS..................(0x777) : 0x0
-----------------------------------------
 - Guaranteed Performance Change....... : 0 (has not occured)
 - Excursion To Minimum................ : 0 (has not occured)

CPU Ratio Info:
------------------------------------------
Base Clock Frequency (BLCK)............. : 100 MHz
Maximum Efficiency Ratio/Frequency.......:  4 ( 400 MHz)
Maximum non-Turbo Ratio/Frequency........: 20 (2000 MHz)
Maximum Turbo Ratio/Frequency............: 40 (4000 MHz)

IGPU Info:
------------------------------------------
IGPU Current Frequency...................:    0 MHz
IGPU Minimum Frequency...................:  300 MHz
IGPU Maximum Non-Turbo Frequency.........:  300 MHz
IGPU Maximum Turbo Frequency.............: 1150 MHz
IGPU Maximum limit.......................: No Limit

P-State ratio * 100 = Frequency in MHz
------------------------------------------
CPU P-States [ 10 (12) 37 ] iGPU P-States [ ]
CPU C3-Cores [ 1 3 5 ]
CPU C7-Cores [ 0 1 3 6 7 ]
CPU P-States [ 10 (12) 37 ] iGPU P-States [ ]
CPU C3-Cores [ 1 3 4 5 ]
CPU C7-Cores [ 0 1 2 3 5 6 7 ]
CPU C3-Cores [ 1 2 3 4 5 7 ]
CPU C7-Cores [ 0 1 2 3 4 5 6 7 ]
CPU C3-Cores [ 1 2 3 4 5 6 7 ]
CPU C3-Cores [ 0 1 2 3 4 5 6 7 ]

Look at MSR_PKG_POWER_LIMIT and 0x610 which PL1 have changed to 20W with much longer time.

Do it at your own risk To whos interested in how to change you need to patch bios unlock mod and download VoltageShift #150, change perm to root and sudo ./voltageshift write 0x610 0x42816000FC80A0 (This will change PL1 to 20W)

Restart will revert any change to default (like XTU in windows)

Tested on an i7 model with MX150 with 1180 in CineBench R20

I think that's why turbo boost last much longer in Windows and Linux compared to macOS(3~5s), because even at default PL1 time limit is 28s, so it's not CPU/bios fault (correct me if I'm wrong...).

Due to school, I have no time to risk changing PL2, also if someone can dump MSR in Windows and check if there's anything else need to change, it would be a great help.


Update: I found that in order to change PL1/2 we need also change mchbar value to match MSR 0x610

localhost ~ # rdmsr 0 0x610
0x0000809600dc8078
localhost ~ # iotools mmio_read32 0xfed159a0
0x00dc8078
localhost ~ # iotools mmio_read32 0xfed159a4
0x00008096

above is Linux command, so I tried to find a way to read/write mmio in macOs and seem /dev/mem and /dev/kmem is missing and boot arg kmem=1 was removed in Sierra, but I found https://github.com/comex/Kmem which is a kext that enable kmem.

This project still needs a lot of work but seem something possible.

source http://forum.notebookreview.com/threads/undervolting-e-g-skylake-in-linux.807953/page-9#post-10697820

Menchen avatar Apr 07 '19 17:04 Menchen

I had updated the VoltageShift, it's able to set power limit now.
Please visit my fork https://github.com/buliaoyin/VoltageShift.

You can update power limit by:

./voltageshift powerlimit <PL1 POWER> <PL1 WINDOW> <PL2 POWER> <PL2 WINDOW>

And also access direct memory by:

./voltageshift rdmem <HEX_ADDR>
./voltageshift wrmem <HEX_ADDR> <HEX_VALUE>

buliaoyin avatar Apr 21 '19 04:04 buliaoyin

Omg first of all, that's what I have been looking for! I think you shuold change your repo description and post link in the upstream. Or maybe merge. Because probably I founded your repo in Google but just skipped.

And one question, in what unit is time window?

Btw the link is broken...


Update:

I have benchmarked with cinebench R20 and it works. 2.5(0.5 increase) core frequency and 68~69 (don't past 70°C, 10°C increase) with PL1 at 20W, so the performance increase is about 10% (1298 score vs 1180). But I think it can do better if I undervolt and raise TDP to 25W (probably close 78°C, Cyb used metal liquid with -0.1V and 25W TDP and +20C fan patch and he got 60°C, like mine with only 15W and without undervolt).

Btw time windows don't seems working... I don't know if it's macOs issue or our laptop. (PL1 time is 28s but limit after like 3s).

For anyone that want try and don't want to build: Remember to change file permission to root. VoltageShift.zip

Menchen avatar Apr 21 '19 09:04 Menchen

The link has been fixed, and the unit of time window is in second.
PL1 means short power limit, should not set to a large value, it's best to keep the default PL1 time window by setting it to 0.

buliaoyin avatar Apr 21 '19 17:04 buliaoyin

@buliaoyin Thanks for the awesome tool, but I think PL1 is long time power limit and PL2 is short time..

PL1 is the long time power limit and usually set to the CPU SKU. PL2 is usually the short time limit and set to 1.25x PL1 with shorter time. Unless the clamp bits are set, which they usually are not then PL1 and PL2 only operate on turbo bins. PL3 is a little different to PL1 and PL2 in that it operates using a duty cycle.

sorce: http://forum.notebookreview.com/threads/tdp-and-power-limiting-haswell.766743

Also, you can check with AppleIntelInfo that confirm PL1 is long time, the help command and readme file have this typo, the variable name in main is correct.


I have noticed that during 44W the temperature is at 100°C, so probably that's why the PL1 enter about only 3 seconds.. Still, that's something weir that in windows we can stay like 28 seconds.

My feedback about the performance increase: i7 with 16G

With just -85mV CPU and GPU undervolt, the core frequency is 2.3 and 61°C(more 2° more than default), about 5% performance increase.

PL1 25W and -85mV CPU and GPU, 1535 at cinebanch R20, 2.9 core frequency, about 30% faster than default!, the temperature is about 78°C at 25W(don't pass 80°C). the fan is noisy(even with +12°C fan patch).

Probably I can improve even more by further undervolt(some cache undervolt and find CPU and GPU limit).


Update:

After testing changing PL2 to 35W the duration increased to like 10s and in AppleIntelInfo a thermal throttling bit has been flagged, and in MSR 0x1A2 the temperature target is set at 100°C, so that confirms my theory.

Menchen avatar Apr 22 '19 17:04 Menchen

@Menchen Sorry about that, what you said about PL1/PL2 and thermal throttling was right.
Thanks for your correction!

And the cmd line should be:

./voltageshift powerlimit <PL1 POWER> <PL1 WINDOW> <PL2 POWER> <PL2 WINDOW>

buliaoyin avatar Apr 24 '19 02:04 buliaoyin

Did anybody faced reboot every time using voltageshift? If I run original pack(sicreative) it's ok, but when i run forked buliaoyin's tool reboot happening. One intresting thing, that if i run original tool, and after forked - works totally ok til i reboot.

propastinv avatar Apr 27 '19 11:04 propastinv

Have you tried using kext that I build?

Menchen avatar Apr 27 '19 11:04 Menchen

Tried this, tried build it on Xcode. No difference

propastinv avatar Apr 27 '19 11:04 propastinv

What about manually read msr and mem? sudo ./voltageshift read 0x610 and sudo ./voltageshift rdmem 0xfed159a0, both sould match. Also check file permission.

Menchen avatar Apr 27 '19 12:04 Menchen

It worked, and powerlimit after msr read worked too. But after reload when i run ./voltageshift info still reboot. So as far as i understand if readed msr then voltageshift working. File permission are ok

propastinv avatar Apr 27 '19 12:04 propastinv

"After reload" is reboot or? You don't need to load kext via kextload.

I7 model only!!!

sudo ./voltageshift write 0x610 0x42814000dd80c8

sudo ./voltageshift wrmem 0xfed159a0 0x42814000dd80c8

Shuold manually set power limit.

And full step to reproduce would be helpful..

Menchen avatar Apr 27 '19 13:04 Menchen

I don't load kext, i just try execute it via cmd. If i reboot i need again run manually original tool and then run forked, or this just reboot's my mac. I have an i5, so you think i can manually set msr/memory? When i set it to autostart my system don't boot anymore

propastinv avatar Apr 27 '19 14:04 propastinv

Maybe you need to uninstall the original one sudo ./voltageshift removelaunchd. And if you can send me your msr value I can give you patched value.

Menchen avatar Apr 27 '19 14:04 Menchen

Original not installed at the moment. sudo ./voltageshift removelaunchd do nothing. ./voltageshift read 0x610 - 0x42816000dd8078 If i understood correctly

propastinv avatar Apr 27 '19 19:04 propastinv

Below is i5 Only(should work on i7, just bad performance)

sudo ./voltageshift write 0x610 0x42816000DD80C8 sudo ./voltageshift wrmem 0xfed159a0 0x42816000DD80C8

After that run a benchmark to test if throttle, I have set PL1 to 25W (You should do some undervolt to help thermal throttling).

Menchen avatar Apr 27 '19 20:04 Menchen

Is it saving after restart? If no, how can I keep it save? And could you please make 30W value, my laptop fully stable with 30W and undervolting

propastinv avatar Apr 27 '19 20:04 propastinv

Change the value to 0x42816000DD80F0, and you need to apply each boot. A script can help you if you need.

Menchen avatar Apr 27 '19 20:04 Menchen

Which script exactly? Manually create it?

propastinv avatar Apr 27 '19 20:04 propastinv

You can manually create it, or just mod voltashift one.

Menchen avatar Apr 27 '19 20:04 Menchen

By the way, it's not working again after reload and launch it in first command. And again original voltageshift works. One thing I mentioned. If i using only offset there's no issue. Only if i redact msr value i got reboot. Got any ideas?

propastinv avatar Apr 27 '19 20:04 propastinv

@propastinv I'm still thinking there's some unclean install.... check if empty ls "/Library/Application Support/VoltageShift/", remove if not, and make sure to use to kext in above. Then use builddaemon command to create some dummy config and delete using

sudo rm "/Library/LaunchDaemons/com.sicreative.VoltageShift.plist"

Save all below file with root and sudo chmod 644 FILENAME to fix perm. save following in /Library/LaunchDaemons/com.sicreative.VoltageShift.msr.plist

<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
    <dict>
        <key>RunAtLoad</key>
        <true/>
        <key>Label</key>
        <string>com.sicreative.VoltageShift.msr</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Library/Application Support/VoltageShift/voltageshift</string>
            <string>write</string>
            <string>0x610</string>
            <string>0x42816000DD80F0</string>
        </array>
        <key>StartCalendarInterval</key>
        <array>
            <dict>
                <key>Hour</key>
                <integer>0</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>1</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>3</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>4</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>6</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>7</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>9</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>10</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>12</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>13</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>15</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>16</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>18</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>19</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>21</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>22</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
        </array>
    </dict>
</plist>

and this to /Library/LaunchDaemons/com.sicreative.VoltageShift.mem.plist

<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
    <dict>
        <key>RunAtLoad</key>
        <true/>
        <key>Label</key>
        <string>com.sicreative.VoltageShift.mem</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Library/Application Support/VoltageShift/voltageshift</string>
            <string>wrmem</string>
            <string>0xfed159a0</string>
            <string>0x42816000DD80F0</string>
        </array>
        <key>StartCalendarInterval</key>
        <array>
            <dict>
                <key>Hour</key>
                <integer>0</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>1</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>3</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>4</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>6</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>7</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>9</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>10</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>12</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>13</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>15</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>16</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>18</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>19</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>21</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>22</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
        </array>
    </dict>
</plist>

If you want undervolt at boot do following

/Library/LaunchDaemons/com.sicreative.VoltageShift.volt.plist

<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
    <dict>
        <key>RunAtLoad</key>
        <true/>
        <key>Label</key>
        <string>com.sicreative.VoltageShift.volt</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Library/Application Support/VoltageShift/voltageshift</string>
            <string>offset</string>
            <string>CPUVALUE</string>
            <string>GPUVALUE</string>
        </array>
        <key>StartCalendarInterval</key>
        <array>
            <dict>
                <key>Hour</key>
                <integer>0</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>1</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>3</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>4</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>6</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>7</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>9</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>10</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>12</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>13</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>15</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>16</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>18</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>19</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>21</integer>
                <key>Minute</key>
                <integer>0</integer>
            </dict>
            <dict>
                <key>Hour</key>
                <integer>22</integer>
                <key>Minute</key>
                <integer>30</integer>
            </dict>
        </array>
    </dict>
</plist>

update every 1.5 hour.

Menchen avatar Apr 27 '19 20:04 Menchen

Tried your decision, Mac os don't load again. Reboot on Apple logo. Same. Before this happened i fully reinstalled os - fixed nothing

propastinv avatar Apr 27 '19 21:04 propastinv

So, if you manually write value does it work?

Menchen avatar Apr 27 '19 21:04 Menchen

Only if i run this after running original voltagescript

propastinv avatar Apr 27 '19 21:04 propastinv

Can you do some md5 to check "/Library/Application Support/VoltageShift/VoltageShift.kext/Contents/MacOS/VoltageShift" is the correct one if not replace it with the correct one(the one from this issue, maybe download again to make sure). after this try to reboot and move the non-original binary to a spare folder without moving kext and try to using sudo ./voltageshift info to see if work.

Menchen avatar Apr 27 '19 21:04 Menchen

That's was my bad in the end. I should've just reinstall kext completely and I now able to load my system with undervolt&PL1\2 limits. Thanks you very much

propastinv avatar Apr 28 '19 09:04 propastinv