CPU Power Management using ssdtPRGen and CPUFriend
@Sniki,
IMHO, the guide could be improved in the section on CPU power management.
When you invoke the command
curl -o ./ssdtPRGen.sh
https://raw.githubusercontent.com/Piker-Alpha/ssdtPRGen.sh/master/ssdtPRGen.sh
you download version 15.6, and when you use
curl -o ./ssdtPRGen.sh
https://raw.githubusercontent.com/Piker-Alpha/ssdtPRGen.sh/Beta/ssdtPRGen.sh
you get an unstable version 21.5, which doesn't produce the expected files in the expected places.
I think it is preferable to download the last stable version 17.0. I've tested them all.
1. In your browser, navigate to:
v17.0
github.com
2. Download the source code zip file, and select Open with Archive Utility.
3. Move it to a convenient location
mv ~/Downloads/ssdtPRGen.sh-17.0 ~/PRGen170
4a. If your SMBIOS is defined as MacMini6,1 or iMac13,2, you can simply run:
~/PRGen170/ssdtPRGen.sh
4b. Otherwise, if your SMBIOS is iMacPro1,1 for example, you may want to tell the shell script to use the
iMac13,2 board-id, Mac-FC02E91DDD3FA6A4:
~/PRGen170/ssdtPRGen.sh -b Mac-FC02E91DDD3FA6A4
The following warning can be ignored:
Warning: board-id [Mac-FC02E91DDD3FA6A4] and model [iMacPro1,1] mismatch – check SMBIOS data
Answer y if you get the warning and the question:
Do you want to continue (y/n)? y
Answer n to the two questions:
Do you want to copy /Users/lisaf/Library/ssdtPRGen/ssdt.aml to /Extra/ssdt.aml? (y/n)? n
Do you want to open ssdt.dsl (y/n)? n
5. If you simply want to use the generated ssdt, first mount your EFI volume and then:
cp ~/Library/ssdtPRGen/SSDT.aml /Volumes/EFI/EFI/CLOVER/ACPI/patched/ssdt.aml
If you have other SSDT files, such as SSDT-EC.aml, leave them there.
6. You may also want to preserve your produced files and remove the generated library:
cp ~/Library/ssdtPRGen/SSDT.aml ~/PRGen170/ssdt.aml
cp ~/Library/ssdtPRGen/ssdt.dsl ~/PRGen170/ssdt.dsl
rm -r ~/Library/ssdtPRGen
7. If your SMBIOS is defined as MacMini6,1 or iMac13,2, you get suitable results just using the
ssdt.aml file. Make sure your config.plist has Root / ACPI / SSDT / Generate set to NO, and
make sure your Root / KernelandKextPatches has KernelXCPM disabled.
8. I checked mine using Geekbench 4, Geekbench 5, HackinTool v2.9.0, and Intel Power Gadget.
You can download Intel Power Gadget at
Intel® Power Gadget is a software-based power estimation tool enabled for 2nd Generation Intel® Core™ processors or newer. It provides real-time processor package power information in watts using energy counters.
software.intel.com
I installed Geekbench 4, Geekbench 5, HackinTool v2.9.0, and Intel Power Gadget in Applications,
rebooted, and started up Intel Power Gadget.
9. Right after booting, the computer runs at high speed for a while, but finishes startup tasks after a
couple minutes. Wait til it calms down, make sure other applications aren't running, start up Geekbench 5,
and Run CPU Benchmark in 64-bit mode.
With an i5-3470 CPU, my single core score was about 781, and multi-core was about 2646.
With an i5-3570 CPU, my single core score was about 818, and multi-core was about 2721.
Just to be thorough, I quit Geekbench 5 and the browser where the scores were, and ran the test again
with Geekbench 4.
With an i5-3470 CPU, my single core score was about 3777, and multi-core was about 11177.
With an i5-3570 CPU, my single core score was about 3881, and multi-core was about 11525.
These scores were pretty independent of whether I was using the SMBIOS for iMac13,2 or iMacPro1,1.
However, I saw a problem with the iMacPro1,1 SMBIOS, in that the average frequency as shown
on Intel Power gadget remained at 3.2 GHz (i5-3470) or 3.4 Ghz (i5-3570), instead of throttling
down. I had to either put the computer to sleep and wake it up, or install CPUFriend (as discussed below)
to get it to throttle down.
10. But first, lets finish the test of the ssdt.aml file. I quit Geekbench 4, and started up Hackintool.
In the Hackintool window, click on Tools. In the lower left of the bottom icons, click on the Intel
icon, and enter your password. It claims it is running CPU intensive activity, but the computer doesn't
look very busy on Intel Power Gadget. When it is complete, it provides a lot of information from
AppleIntelInfo.kext. If you scroll down, you'll find a
IA32_ENERGY_PERF_BIAS............ which is probably set to 4. Lower numbers indicate a preference
for performance, and higher numbers indicate a preference for energy savings. They call a 5 "balanced."
Further down, you'll see a maximum efficiency ratio of 16 for 1600 Mhz, the maximum non-turbo
frequency, and the maximum turbo frequency. You'll also see the various sets of C-states and P-states
your CPU went through in the test.
11. If you want to go on to install CPUFriend, navigate your browser to:
v1.2.0 Dropped broken AppleIntelMCEReporter prevention support
github.com
download
CPUFriend-1.2.0-RELEASE.zip, and Open with Archive Utility.
12. Put the folder in a convenient place, and go to one of its subfolders:
mv ~/Downloads/CPUFriend-1.2.0-RELEASE ~/PRGen170
cd ~/PRGen170/CPUFriend-1.2.0-RELEASE/Tools
13. Now we're going to copy a system file for the iMac13,2 to the Tools folder:
cp /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources/Mac-FC02E91DDD3FA6A4.plist .
14. We then run the script in the Tools folder:
./ResourceConverter.sh -k Mac-FC02E91DDD3FA6A4.plist
15a. If you want, you can configure your machine to use CPUFriend.kext and the newly produced kext
in the Tools folder, CPUFriendDataProvider.kext
Mount your EFI folder, remove the previous ssdt.aml file, and put two kexts in Clover/Kexts/Other:
rm /Volumes/EFI/EFI/CLOVER/ACPI/patched/ssdt.aml
cp -r ~/PRGen170/CPUFriend-1.2.0-RELEASE/Tools/CPUFriendDataProvider.kext /Volumes/EFI/EFI/CLOVER/kexts/Other
cp -r ~/PRGen170/CPUFriend-1.2.0-RELEASE/CPUFriend.kext /Volumes/EFI/EFI/CLOVER/kexts/Other
If you run the tests again, you will see that the throttling down problem with the iMacPro1,1 SMBIOS
is resolved, but the CPU never enters turbo mode.
15b. To get the best of both worlds, we start again in the Tools folder, and run:
~/PRGen170/CPUFriend-1.2.0-RELEASE/Tools/ResourceConverter.sh -a Mac-FC02E91DDD3FA6A4.plist
you'll see a new file in the Tools folder, called ssdt_data.dsl.
16. You need to combine the ssdt_data.dsl file with the previously created ssdt.dsl file:
open ssdt_data.dsl
open ~/PRGen170/ssdt.dsl
These should open in MaciASL. In your MaciASL editor, search for "plugin-type" in the ssdt.dsl.
Two lines above, remove the "0x02" after package (leaving an empty pair of parentheses), put a comma
after "One", copy the 5 lines starting with "cf-frequency-data" from the ssdt_data file, and paste it
after the "One," in the ssdt.dsl file.
The result should look a bit like the _DSM Method in
Dynamic macOS CPU power management data injection. Contribute to acidanthera/CPUFriend development by creating an account on GitHub.
github.com
I've attached a combined file for an i5-3470 to this post.
Go to MaciASL preferences, and check that you have selected ACPI 6.2a and enabled messages.
When you're done, Save As, select ACPI Machine Language Binary as the File Format, and
navigate to save it in your
/Volumes/EFI/EFI/CLOVER/ACPI/patched
folder. If there are any syntax errors in your file, the error message will try to tell you what line they are in.
When it thinks its error-free, it will save properly.
17. Remove one of the Clover kexts:
rm -r /Volumes/EFI/EFI/CLOVER/kexts/Other/CPUFriendDataProvider.kext
18. Retain your /Volumes/EFI/EFI/CLOVER/kexts/Other/CPUFriend.kext.
Restart and you should have your combined ssdtPRGen ssdt.aml with CPU frequency vectors working.
Double check by running your tests again.