Contribute
Register

Skylake HWP Enable

Status
Not open for further replies.
Everythings start from ./freqVectorsEdit.sh -d 1, it extract default settings from plist, see below

Thanks to Pike R.

Examining data of: Mac-551B86E5744E2388.plist (MacBookPro14,3) ...

-----------------------------------------------------------------

Max Turbo Boost: 3900 MHZ (FrequencyVectors @ 1) Converted to: /tmp/Mac-551B86E5744E2388-3900.bin (7668 bytes)

Settings: Low Frequency Mode: 1300 MHz

BACKGROUND, KGROUND, REALTIME_SHORT, KERNEL, THRU_TIER2, THRU_TIER3, THRU_TIER4, THRU_TIER5

hard-rt-ns (4000000), ubpc (1), off (0), on (0), hwp (1), epp (128), perf-bias (5), utility-tlvl (53), non-focal-tlvl (250)

iocs_engage (20000000), iocs_disengage (15000000), iocs_cstflr (8), iocs_rtrigger (10)

ring_mbd_ns (10000), ring_ratio (35), ratioratelimit (3000000), io_epp_boost (32)


For example,
65707000 00000000 00000000 00000000 00000000 80000000 where 80000000 EPP=128
02000000 0C000000 01000000 00000000 BC020000 00000000 where 0C000000 LFM=1300 MHz
696F5F65 70705F62 6F6F7374 00000000 00000000 20000000 where 20000000 io_epp_boost=32
72696E67 5F726174 696F0000 00000000 00000000 23000000 where 23000000 ring bus ratio=35

Got it!!! Thanks
 
So, one can just insert "HWP on" and "EPP 128" in the frequency vectors generated by FrequencyVectors.sh, optimized for a CPU.

68777000 00000000 00000000 00000000 01000000 6F6E0000 00000000 00000000 00000000 65707000 00000000 00000000 00000000 00000000 80000000 00000000 00000000 00000000

hwp on
epp 128

This works to enable hwp, but the frequency vectors generated by the Pike's script seem to be more aggressive in terms of higher frequency shifting and more power hungry. Which makes sense for desktop. Now I am testing the vectors of a MacBook Pro 13,3 (with HWP) which will produce a very similar performance but lower watts, frequencies and temps.

Thanks for all the tips.

IPG.png
 
So, one can just insert "HWP on" and "EPP 128" in the frequency vectors generated by FrequencyVectors.sh, optimized for a CPU.

68777000 00000000 00000000 00000000 01000000 6F6E0000 00000000 00000000 00000000 65707000 00000000 00000000 00000000 00000000 80000000 00000000 00000000 00000000

hwp on
epp 128

This works to enable hwp, but the frequency vectors generated by the Pike's script seem to be more aggressive in terms of higher frequency shifting and more power hungry. Which makes sense for desktop. Now I am testing the vectors of a MacBook Pro 13,3 (with HWP) which will produce a very similar performance but lower watts, frequencies and temps.

Thanks for all the tips.

View attachment 258431

My suggestion is use MacBook 9,1 as template, it has more options, frequency vectors is one parameter of plist, other settings also important.
Delete Frequencies key from plist, use only one FrequencyVectors table, make it as universal, see sample attached.

Benchmark tools are not suitable for FrequencyVectors test, use video player like MplayerX.app for test, H265 codecs 1080p video playback, turn on all video effects step by step, with lower frequency and higher CPU utilization is the best.
 

Attachments

  • sample_EPP_C0.plist
    16.6 KB · Views: 235
My suggestion is use MacBook 9,1 as template, it has more options, frequency vectors is one parameter of plist, other settings also important.
Delete Frequencies key from plist, use only one FrequencyVectors table, make it as universal, see sample attached.

Benchmark tools are not suitable for FrequencyVectors test, use video player like MplayerX.app for test, H265 codecs 1080p video playback, turn on all video effects step by step, with lower frequency and higher CPU utilization is the best.

It looks like the X86PlatformPlugin limits the turbo frequency of my iGPU to 900MHz , with or without HWP. Annoying. Without loading X86PlatformPlugin power management my iGPU reaches 1100MHz .

Do you know if there is any parameter to control this behavior with the X86PlatformPlugin loaded?

EDIT: So it seems that the iGPU performance is controlled by AGPM according to the system definition or machine id . Nothing to do with HWP.
 
Last edited:
It looks like the X86PlatformPlugin limits the turbo frequency of my iGPU to 900MHz , with or without HWP. Annoying. Without loading X86PlatformPlugin power management my iGPU reaches 1100MHz .

Do you know if there is any parameter to control this behavior with the X86PlatformPlugin loaded?

EDIT: So it seems that the iGPU performance is controlled by AGPM according to the system definition or machine id . Nothing to do with HWP.

I do not has this problem, I use QuickTime/QuickSync to export video clip, result is normal, IGPU at 1050MHz, same as Windows 10.
upload_2017-6-1_15-59-44.png


If you use my sample_EPP_C0.plist as template, result should show as below.

upload_2017-6-1_16-2-2.png
 
It looks like the X86PlatformPlugin limits the turbo frequency of my iGPU to 900MHz , with or without HWP. Annoying. Without loading X86PlatformPlugin power management my iGPU reaches 1100MHz .

Do you know if there is any parameter to control this behavior with the X86PlatformPlugin loaded?

EDIT: So it seems that the iGPU performance is controlled by AGPM according to the system definition or machine id . Nothing to do with HWP.

I think issue should caused by BIOS GOP, your mobo design is closed to laptop, IGPU PM modes may match MB9,1 settings, GPUTier and IOTier may working too perfectly, try to delete GPUTier1,2,3,4 and IOTier0,1,2,3, or use another system definition without IGPU control.
upload_2017-6-1_17-4-9.png


Did your IGPU has deep sleep/wake up problem?
 
I think issue should caused by BIOS GOP, your mobo design is closed to laptop, IGPU PM modes may match MB9,1 settings, GPUTier and IOTier may working too perfectly, try to delete GPUTier1,2,3,4 and IOTier0,1,2,3, or use another system definition without IGPU control.
View attachment 258669

I am using system definition Mac-A369DDC4E67F1C45 (iMac16,1),because less problems with quick sync, display, etc.

X86PlatformPlugin loads AGPM.kext which in turn loads a power management profile for the iGPU (and dGPU if any) according to the system definition used. Here: AppleGraphicsPowerManagement.kext -> Info.plist -> IOKitPersonalities -> AGPM -> Machines

There's some setting there that limits my highest frequency to 900MHz. Now I am using an injector to override that power management profile for my sys def. That way my iGPU turbo frequencies are back to normal at 1100MHz .

Did your IGPU has deep sleep/wake up problem?

Last time I checked yes. The machine goes to sleep but then crashes at wake up.
 
Last edited:
I ran this for a week went from this to this using https://www.tonymacx86.com/threads/macos-native-cpu-igpu-power-management.222982/

I went from

Code:
AppleIntelInfo.kext v1.2 Copyright © 2012-2015 Pike R. Alpha. All rights reserved

Settings:
------------------------------------
logMSRs............................: 1
logIGPU............................: 0
logIntelRegs.......................: 1
logCStates.........................: 1
logIPGStyle........................: 1
InitialTSC.........................: 0x1ab19abaedcf
MWAIT C-States.....................: 1319200

Model Specific Regiters
------------------------------------
MSR_CORE_THREAD_COUNT......(0x35)  : 0x40008
MSR_PLATFORM_INFO..........(0xCE)  : 0x80838F1012A00
MSR_PMG_CST_CONFIG_CONTROL.(0xE2)  : 0x1E000000
MSR_PMG_IO_CAPTURE_BASE....(0xE4)  : 0x31814
IA32_MPERF.................(0xE7)  : 0x5A4C1992632
IA32_APERF.................(0xE8)  : 0x480A17A2087
MSR_FLEX_RATIO.............(0x194) : 0xE0000
MSR_IA32_PERF_STATUS.......(0x198) : 0x277800002C00
MSR_IA32_PERF_CONTROL......(0x199) : 0xA00
IA32_CLOCK_MODULATION......(0x19A) : 0x0
IA32_THERM_STATUS..........(0x19C) : 0x883B0800
IA32_MISC_ENABLES..........(0x1A0) : 0x850089
MSR_MISC_PWR_MGMT..........(0x1AA) : 0x401CC1
MSR_TURBO_RATIO_LIMIT......(0x1AD) : 0x2C2C2C2D
IA32_ENERGY_PERF_BIAS......(0x1B0) : 0x1
MSR_POWER_CTL..............(0x1FC) : 0x3C005F
MSR_RAPL_POWER_UNIT........(0x606) : 0xA0E03
MSR_PKG_POWER_LIMIT........(0x610) : 0x42FFFF001BFFFF
MSR_PKG_ENERGY_STATUS......(0x611) : 0x7BB124F3
MSR_PKG_POWER_INFO.........(0x614) : 0x2D8
MSR_PP0_CURRENT_CONFIG.....(0x601) : 0x0
MSR_PP0_POWER_LIMIT........(0x638) : 0x0
MSR_PP0_ENERGY_STATUS......(0x639) : 0x3B1E942F
MSR_PP0_POLICY.............(0x63a) : 0x0
MSR_PKGC6_IRTL.............(0x60b) : 0x8876
MSR_PKG_C2_RESIDENCY.......(0x60d) : 0xBCDCB5CE6
MSR_PKG_C3_RESIDENCY.......(0x3f8) : 0x0
MSR_PKG_C6_RESIDENCY.......(0x3f9) : 0x0
IA32_TSC_DEADLINE..........(0x6E0) : 0x1AB19BEE8D94

CPU Ratio Info:
------------------------------------
CPU Low Frequency Mode.............: 800 MHz
CPU Maximum non-Turbo Frequency....: 4200 MHz
CPU Maximum Turbo Frequency........: 4500 MHz
CPU P-States [ (8) 31 33 ]
CPU C3-Cores [ 0 1 4 5 ]
CPU C6-Cores [ 0 1 2 4 7 ]
CPU P-States [ 8 26 (28) 31 33 ]
CPU C3-Cores [ 0 1 2 3 4 5 7 ]
CPU C6-Cores [ 0 1 2 4 5 6 7 ]
CPU P-States [ (8) 26 27 28 31 33 ]
CPU P-States [ 8 19 26 27 28 31 (33) ]
CPU P-States [ 8 19 26 27 28 31 33 (44) ]
CPU C3-Cores [ 0 1 2 3 4 5 6 7 ]
CPU C6-Cores [ 0 1 2 3 4 5 6 7 ]
CPU P-States [ 8 (18) 19 26 27 28 31 33 34 44 ]
CPU P-States [ 8 18 19 26 27 28 31 32 (33) 34 44 ]
CPU P-States [ 8 18 19 26 27 28 30 31 32 33 34 (44) ]
CPU P-States [ 8 18 19 26 27 28 30 31 32 (33) 34 39 44 ]
CPU P-States [ 8 18 19 (23) 26 27 28 30 31 32 33 34 38 39 44 ]
CPU P-States [ 8 17 18 19 (23) 26 27 28 30 31 32 33 34 38 39 44 ]
CPU P-States [ 8 17 18 19 23 26 27 28 30 31 32 (33) 34 36 38 39 44 ]
CPU P-States [ 8 17 18 19 22 23 26 27 (28) 30 31 32 33 34 36 38 39 44 ]
CPU P-States [ 8 17 (18) 19 22 23 25 26 27 28 30 31 32 33 34 36 38 39 44 ]

to

Code:
AppleIntelInfo.kext v1.2 Copyright © 2012-2015 Pike R. Alpha. All rights reserved

Settings:
------------------------------------
logMSRs............................: 1
logIGPU............................: 0
logIntelRegs.......................: 1
logCStates.........................: 1
logIPGStyle........................: 1
InitialTSC.........................: 0x8a71c45a14
MWAIT C-States.....................: 1319200

Model Specific Regiters
------------------------------------
MSR_CORE_THREAD_COUNT......(0x35)  : 0x40008
MSR_PLATFORM_INFO..........(0xCE)  : 0x80838F1012A00
MSR_PMG_CST_CONFIG_CONTROL.(0xE2)  : 0x1E000008
MSR_PMG_IO_CAPTURE_BASE....(0xE4)  : 0x31814
IA32_MPERF.................(0xE7)  : 0x77F1208719
IA32_APERF.................(0xE8)  : 0x423722975E
MSR_FLEX_RATIO.............(0x194) : 0xE0000
MSR_IA32_PERF_STATUS.......(0x198) : 0x276500002C00
MSR_IA32_PERF_CONTROL......(0x199) : 0xA00
IA32_CLOCK_MODULATION......(0x19A) : 0x0
IA32_THERM_STATUS..........(0x19C) : 0x88350800
IA32_MISC_ENABLES..........(0x1A0) : 0x850089
MSR_MISC_PWR_MGMT..........(0x1AA) : 0x401CC1
MSR_TURBO_RATIO_LIMIT......(0x1AD) : 0x2C2C2C2D
IA32_ENERGY_PERF_BIAS......(0x1B0) : 0x1
MSR_POWER_CTL..............(0x1FC) : 0x3C005F
MSR_RAPL_POWER_UNIT........(0x606) : 0xA0E03
MSR_PKG_POWER_LIMIT........(0x610) : 0x42FFFF001BFFFF
MSR_PKG_ENERGY_STATUS......(0x611) : 0x4FD3F4D
MSR_PKG_POWER_INFO.........(0x614) : 0x2D8
MSR_PP0_CURRENT_CONFIG.....(0x601) : 0x0
MSR_PP0_POWER_LIMIT........(0x638) : 0x0
MSR_PP0_ENERGY_STATUS......(0x639) : 0x3E0E429
MSR_PP0_POLICY.............(0x63a) : 0x0
MSR_PKGC6_IRTL.............(0x60b) : 0x8876
MSR_PKG_C2_RESIDENCY.......(0x60d) : 0xACF7D70E
MSR_PKG_C3_RESIDENCY.......(0x3f8) : 0x0
MSR_PKG_C6_RESIDENCY.......(0x3f9) : 0x0
IA32_TSC_DEADLINE..........(0x6E0) : 0x8A737261F0

CPU Ratio Info:
------------------------------------
CPU Low Frequency Mode.............: 800 MHz
CPU Maximum non-Turbo Frequency....: 4200 MHz
CPU Maximum Turbo Frequency........: 4500 MHz
CPU P-States [ 43 (44) ]
CPU C3-Cores [ 3 4 6 7 ]
CPU C6-Cores [ 3 4 5 6 ]
CPU C3-Cores [ 0 1 3 4 5 6 7 ]
CPU C6-Cores [ 0 1 2 3 4 5 6 7 ]
CPU C3-Cores [ 0 1 2 3 4 5 6 7 ]
CPU P-States [ 42 43 (44) ]
CPU P-States [ 39 42 43 (44) ]
CPU P-States [ 39 41 42 43 (44) ]
CPU P-States [ 39 40 41 42 43 (44) ]
CPU P-States [ (33) 39 40 41 42 43 44 ]
CPU P-States [ (33) 38 39 40 41 42 43 44 ]
CPU P-States [ (33) 34 38 39 40 41 42 43 44 ]
CPU P-States [ (33) 34 36 38 39 40 41 42 43 44 ]
CPU P-States [ (28) 33 34 36 38 39 40 41 42 43 44 ]
CPU P-States [ 28 32 (33) 34 36 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 28 32 33 34 36 38 39 40 41 42 43 44 ]
CPU P-States [ 8 22 28 32 (33) 34 36 38 39 40 41 42 43 44 ]
CPU P-States [ 8 22 26 28 32 (33) 34 36 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 22 26 28 32 33 34 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 22 26 28 32 (33) 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 22 (23) 26 28 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 22 (23) 26 28 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 16 22 (23) 26 28 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 16 (18) 22 23 26 27 28 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 16 18 22 23 25 26 27 28 31 32 33 34 35 36 37 38 39 40 41 42 43 (44) ]
CPU P-States [ 8 15 16 (18) 22 23 25 26 27 28 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 11 15 16 18 22 23 25 26 27 28 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 11 15 16 18 22 23 25 26 27 28 30 31 32 (33) 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 11 13 15 16 (18) 22 23 25 26 27 28 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 11 13 15 16 18 22 23 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 11 13 15 16 18 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 11 13 15 16 18 19 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 11 13 15 16 17 (18) 19 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 11 13 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 11 13 14 15 16 17 (18) 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 11 13 14 15 16 17 (18) 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ (8) 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 (23) 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 ]
CPU P-States [ 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 (45) ]
 
I ran this for a week went from this to this using https://www.tonymacx86.com/threads/macos-native-cpu-igpu-power-management.222982/

I do not know how to compare your data, more P-States are better or it really reflect power consumption ? actually using native XCPM control, frequency always higher than 2 GHz while loading applied, CPU utilization round 30%.

I use G4400 + HD5570 (without H265 hardware acceleration) for test.

XCPM mode, 1080p H265 playback, CPU utilization round 30%, frequency higher than 2.5 GHz.
upload_2017-6-6_1-40-58.png


SMBIOS HWP enable, 1080p H265 playback, CPU utilization round 50%, average frequency round 1.8 GHz.
upload_2017-6-6_1-44-25.png

Clover method, pure HWP control, XCPM complete disabled, 1080p H265 playback, CPU utilization round 75%, average frequency round 1.3 GHz.
upload_2017-6-6_1-47-23.png


I think frequency should be proportional to load, native XCPM control seems to be worse.
 
@shuhung I tried all type of Power Management.
Cannot find a good PM for my i7-6700K.
I use Sierra 10.12.5 iMac 17,1 with board-id Mac-65CE76090165799A(i7-6700K Mac 5K)
With ssdtprgen my frequency jump too much and in idle hardly going on 0.80.(XCPM mode)

With HWP+XCPM Mode Disabled(FakeID+NullCpu kext)+X86PlatformPlugin/Inject +AGPM(ssdtprgen).
System seems slow and PM is so aggressive (seems every time at 0.80)
All verified from IOReg.

How could I find a PROPER PM ?

Tried ARTFrequency but in Sierra doesn't work.
It's making me go crazy.

Thanks in advance for your reply.
 
Status
Not open for further replies.
Back
Top