-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU Power consumption #28
Comments
I just quickly checked, mine is also pulling 2W on idle. Though I'm not exactly sure how to approach this issue. @velaar I saw your pull request, did power consumption improve after installing NVMEFix? |
@tylernguyen Yes, but not on the CPU package. The system can now go down from around 9W to around 7W and I have a very low power SSD. For the CPU package consumption, so far every app I run reports the original 1.3GHz CPU frequency vector. One way would be to determine if that is the case. Also for i7-8650U the minimum frequency is 400MHz but I was unable to patch the vector to push it this low.
|
@Colton-Ko @tylernguyen NVMeFix definitely helps. Now the question is if we can really push the CPU to C10 at 400MHz.
|
@velaar I have only reached the minimum of 800MHz on i7-8550U in macOS. I used https://github.com/stevezhengshiqi/one-key-cpufriend to create a customized DataProvider for CPUFriend.kext The below is the configuration screen when customizing CPUFriend using one-key-cpufriend I am now trying to lower the frequency to 400MHz using one-key-cpufriend. Test configuration: CPU Ratio Info in AppleIntelInfo.kext
|
@velaar That's great! What did you do? |
NVMeFix was the key to this as well as a low power SSD. Plus undervolting (-83mV), using CPU vectors from MacBookPro15,4 adjusted to 400MHz (practically only drops to 600), enabling ASPM through PCIutils on most of the devices, a lot of USB power tweaking. I've hit a rough patch at work, so can't contribute at a previous rate for some time. |
Sorry for double-posting. Today I woke my laptop and for some reason it was at an unusual power state. I don't know what caused it (ec bug?) but for some reason the CPU power consumption was exactly what it is supposed to be on this cpu. (See screenshots) I'm now wondering what happened and how can we replicate the condition. The good part is that It is possible to achieve 5.5W draw on X1C6 on MacOS X. Update:
Now I'm wondering if we can bring a laptop to this state on demand, as I'd love to have the 8+ hours of battery even if I have to reboot for that |
❗ HELP NEEDED❗ @tylernguyen, @Colton-Ko There are 3 components to it: 1. Undervolting 2. Thunderbolt / USB-C I will continue to experiment in this field but here are some findings:
Further research is needed into TB3 v3.1 and TBTonPCH to see if we can activate TB on demand and USB-C Thunderbolt BIOS assist means (as per Lenovo rep):
3. ASPM I think that it is worth looking into it. At the moment I'm enjoying a very long battery life (better than some Macs) with some shortcomings (no USB-C at the moment, TB3 requires reboot, have to run a script for max power savings), I hope that with your help we can overcome all of them, but some time commitment is needed. |
@velaar Thank you so much for contribution!!! It means so much to me that others are helping my project. I'm investigating the matter on my own as we speak. Can you point to more references on ASPM and setpci.efi? I want to look deeper into that. Also, I would suggest repasting the machine with something like Grizzly thermal to improve undervolting capabilities. Moving forward, I will track the energy usage of my EFI release folders and include it in my repo. I also ask that you attach an EFI folder and relevant settings each time energy usage is reported. This will help coordinate settings and experiments. I'll be back soon with further updates! |
@velaar Also, what are you using to track energy usage? A combination of iStats menu and Intel Power Gadget? I just want to be on the same page. |
@tylernguyen After running this set of settings for a week I can say that a very low power usage is real.. and it's very easy to get used to. Unfortunately I'm quite busy this/next week but will try to upload a quick writeup of what needs to be done to achieve this level of power consumption. |
@Porco-Rosso Also setting PL1 or PL2 (not sure what power-limit actually means) will kill the CPU performance (lock your CPU down to 400MHz) |
When I last checked, my wattage was ~7-9W browsing Chrome and using VSCode for web development, and that's without undervolting (using OC folder). To highlight ways we can improve PM, we can maybe add a section to README.md? |
@velaar Is there any updates on your instructions to maximize battery life? |
Hello. Is that only me or VoltageShift does not work on our machine? I am using VoltageShift Undervoltage Tool v 1.21. with deamons for reapply every minute. Thanks, |
@lubixxx96 I haven't really tried VoltageShift myself. It was really only here b/c of reference from @velaar . In the next week, I will do some testing on it and get back to you. |
@lubixxx96 I'm not sure what "VoltageShift Undervoltage Tool v 1.21" is. I'm using kexts and software from here: https://github.com/sicreative/VoltageShift And I crash at about -90mV on the CPU or at about -120mV on the digital/ring side. In Windows I crash at -80mV in linux the best sustained result was -90mV (can be a calculation/rounding error) @tylernguyen The main points about power consumption that I hope you can look into: Powering up/powering down USB-C/Thunderbolt controller causes an interrupt storm. It might be on the CPU side or the USB controller side but the power consumption is higher by about 2W on average. There is some discussion of it here https://forums.lenovo.com/t5/Linux-Discussion/FYI-Linux-May-Not-Support-Thunderbolt-Native-Mode/td-p/4057604?page=1 USB power management - Believe can be tuned further but I don't know how exactly to do that. It seems Mac OS does not completely disable the USB ports when nothing is plugged in APSM I'm enabling ASPM on most of the devices with a help of a script. I know that is can be done on either UEFI level or with a UEFI/Opencore driver (tested by loading an efi shell and running the UEFI versions of setpci/lspci to set the registers as follows:
Thunderbolt - I don't really expect power management to work there without Apple firmware on the controller. However if we can make a more reliable thunderbolt implementation with "Thunderbolt BIOS assist" ON we might get hotplug again as BIOS does the d device init. We just need to make it look like an External PCIe device. Undervolting can be done on BIOS/UEFI/EC side to achieve permanent results - that is pending Skyra1n |
@velaar I am using same VoltageShift v1.21 kext and app from same github repo. No matter what I set for cpu, it does not crash. Only the cache offset crash, not sure about other (system agency, analogy i/o) OC mailbox returns failed and looks like I cant change Digital I/O - still 0mv. Thanks for the aspm2 script, I am using it as lauchdaemon. BTW, do we have an option to manually control fan rpm? |
@lubixxx96 I do not think so, not until a BIOS release exploit is out. |
Here you have: |
pciutils.zip @tylernguyen Here is what I used to get the setpci.efi https://github.com/timotheuslin/pciutils.efi update: I have attached my folders with binaries and toolchain. Sorry for the mess :) |
@velaar Thanks for your binaries. I do have a question though, Which pic devices specifically are you enabling ASPM for? |
Just as a quick-note: I'm working on this issue on a T480, which is very similar. Three big parts of the puzzle of power consumption are: a) Power management of the iGPU. All your screenshots showing a max frequency of ~350mhz which means that the GuC-Firmware, and therefore power management, is missing. b) USB-Power for internal devices (f.e. Card-Readers) which may be powered up constantly c) MAYBE: dGPU - Whatevergreen just powers down the PCIe-port and I've disabled Optimus via ACPI instead and power consumptions seems to be improved a bit. |
@benbender Thanks for letting me know. The x1c6 does not have a dGPU so that's not an issue. |
I think thermals are fairly limited on the X1C6. The machine is pretty stuck with cooling it's got. There some remedies to be done:
I've done the two things above and honestly, the machine still gets pretty warm on load. But, right now I'm trying to reduce power consumption on battery. Increasing power consumption on connected power for better performance is another issue for another day. |
@tylernguyen that's great news; can you please share your current BIOS settings? |
@parndt Sure, it is a working draft so it's subjected to experimentation and change:
A lot of these settings may be unnecessary but I am still experiment as this is only my second day with the unlocked BIOS. I will continue to edit this post as I experiment with more and different options. |
I have not. Could you link that thread? |
Hm... I will try playing around with those variables. @rjocoleman Do you have any experience with tweaking power limit profiles? I myself do not. |
https://adamgradzki.com/2020/04/03/thinkpad-gpu-undervolt/ According to this article, apparently you can undervolt the gpu on the x1c6 as much as -400 mV before seeing diminishing returns? That seems absurd but I guess I'll test it anyway. |
Also, Intel Ark https://ark.intel.com/content/www/us/en/ark/products/124968/intel-core-i7-8650u-processor-8m-cache-up-to-4-20-ghz.html says that the T junction for my i7-8650u is 100 C. So I am certain the default throttling/tripping points can be pushed. I'm just not sure what's the safe point for us to configure is at. In any sense, it is probably not a good idea to remove thermal limits without liquid metal or at least a good after market paste applied. |
@tylernguyen wow :) a) Would you be so kind to provide an AppleIntelInfo.kext-dump from Hackintool (SIP must be disabled) to see in which configuration the processor reached that state? (Hackintool -> Utilities -> Get Appleinfo, the most left icon on the bottom - as noted, SIP must be deactivated to load AppleIntelInfo.kext) Additional question: do you reach that low power-state reliable? From my understanding atm its mostly about cpu-cores C-States reaching down to C-10 while the machine is running. It would be very helpful to pin the config needed for this. (Edit) Reference:
b) I'm experimenting with S0-DeepIdle. With the new options, it can be activated and I'm trying to find the right combination to make it useable. ATM S0-Deepidle works, but screws S3 sleep in terms of usability... More Infos here: https://github.com/daliansky/OC-little/tree/master/01-%E5%85%B3%E4%BA%8EAOAC (You can confirm the principle ability to use S0-DeepIdle in the FACP-Table of ACPI via MacIASL) |
@benbender Yup, the power state is very stable. I've been using it the same way I've always been for a day now. The system boosts normally during tasks and otherwise idle below 1. And as far as I can tell, sleep is working normally.
|
The Bios a bit flaky in general when it comes to saving different values. F.e. I'm having I2C2-I2C5-devices activated since yesterday and I'm not able to deactivate them. From your AppleIntelInfo:
vs. mine:
I don't know how to achive that config reliably. That's the key to get the CPU to power down in S0 while running. Do you use the CPUFriendProvider-config from this repo atm? PS: would you be able to dump your bios so that I could flash it and compare the settings? I'm particular interested if it's only the bios or something more. |
@benbender Yup, I'm using the CPUFriendDataProvider from my repo currently. |
The problem is that we don't have a good baseline because "Loading defaults" doesn't reset everything in the bios. F.e. my I2C-Devices are there after a reset... ^^ And I'm using your settings afaik. There is surely something more to be done. I'll contact you at contact at tylerspaper dot com. Edit: msg sent. |
Hm.. so I guess there might be a bug where settings are not applied? Have you tried the reset method @velaar posted? |
Yes, and its hard to tell, if it worked. I can't get reliable results from my testing in general. Sometimes settings are not applied and then, out of nowhere, they are. For CFG Lock it was set, but VerifyMSR reported "MSR Locked" until it doesnt after some testing - no clue why... At this point I can only advise to try to double check... I'm on vacation next week and will try a clean patch afterward to try to sort the stability issues. |
I found that the biggest power difference is enabling Thunderbolt BIOS assist and enabling support in pre boot. Please test those. When I have disabled, I'm experiencing about 2W while with them enabled, I'm able to get sub 1W. If you could confirm that, I think I'm ready to post a big final comment about everything we've found and then close this issue as I'm very satisfied with cpu power consumption right now, it's just as good as Linux and Windows for me. |
If your wanting to look at iGPU power states, interrupts a second from various sources, and CPU usage, then you could try using I've been looking through here for PM tips for my x1 - what is this thunderbolt bios assist? |
@1Revenger1
|
@tylernguyen my speculation is that in BIOS assist mode the power management is also done by BIOS. (including USB-C/TB link power management). I can not confirm it but with proper Linux/Windows driver it is possible to achieve similar levels of power consumption. I wonder if the recent BIOS hacks will allow us to use OSX PM for TBT / USB-C |
@velaar there is a detailed guide on getting macOS PM for TBT. Here : https://osy.gitbook.io/hac-mini-guide/details/thunderbolt-3-fix-part-3 Either ways I will be trying the different BIOS options as suggested by Tyler. I use setup_var to change my bios settings as I don't have a fully modded bios chip. But I have been enable to setup all bios options via setup_var method. FYI I'm using Zenbook S UX391UA very similar specs to the laptop in discussion. |
@FlasHRender I will say though that at least hot plug with BIOS assist → on; should be a big improvement for my use case. |
A year and half after this issue was opened by @velaar, I feel that I am now ready to close this issue as I consider it solved. Here are my closing comments:
With that said, however, there are other things that can be done to improve CPU power consumption:
Personally, with all those adjustments made and with All of this can be viewed in more details starting the next commit and will be continually updated in my My next hope is that we can tackle the big boss, Thunderbolt 3 hotplug. Right now, it works perfectly but as previously mentioned, comes at a cost of the CPU idle power draw being Finally, thank you to everyone here, your interest is why I keep this project actively maintained. |
Hi @tylernguyen just a quick question, it might seem obvious. If we enable Thunderbolt BIOS Assist, this would also mean that to use TB3 on windows it would need to be plugged in at boot to work? Lastly it would be great to have some documentation on how to patch the BIOS. I haven't dived into it yet, but would appreciate a starting point, and recommended settings. |
Windows works fine with Thunderbolt BIOS assist enabled, only macOS is affected by this. Also, BIOS documentation will be included on the next repo commit. I'm waiting for a few final things before pushing it. Though I think it will be up in a less than one week. |
I know this is a different Hackintosh forum but I am having the same issues with Comet Lake i7-10610u CPU (Dell Latitude 7410) and these are the interrupts, if anyone can help what is causing them or how to solve them would be helpful. I know HDEF is related to sound I2C is related to Trackpad? and CNVW is wifi, XHC is USB but idk what is TMR. iStat shows 9.5 Watt CPU consumption on idle. **** Interrupt distribution ****
CPU 0:
Vector 0x51(I2C1/DSB1/HDEF): 1888.65 interrupts/sec
Vector 0x70(XHC): 41.90 interrupts/sec
Vector 0x72(PXSX): 217.28 interrupts/sec
Vector 0x77(CNVW): 21.95 interrupts/sec
Vector 0x7a(IGPU): 7.78 interrupts/sec
Vector 0xdd(TMR): 201.51 interrupts/sec
Vector 0xde(IPI): 40.10 interrupts/sec
CPU 1:
Vector 0xde(IPI): 6.58 interrupts/sec
CPU 2:
Vector 0xdd(TMR): 22.15 interrupts/sec
Vector 0xde(IPI): 34.92 interrupts/sec
CPU 3:
Vector 0xde(IPI): 11.57 interrupts/sec
CPU 4:
Vector 0xdd(TMR): 7.58 interrupts/sec
Vector 0xde(IPI): 33.32 interrupts/sec
CPU 5:
Vector 0xde(IPI): 8.98 interrupts/sec
CPU 6:
Vector 0xdd(TMR): 5.59 interrupts/sec
Vector 0xde(IPI): 24.14 interrupts/sec
CPU 7:
Vector 0xdd(TMR): 1.40 interrupts/sec
Vector 0xde(IPI): 4.59 interrupts/sec |
Hey, im on an X1 yoga gen 3, very close hardware to your machine. How can I decrease the power usage? On idle, power consumption is 8 watts total but the CPU is at 0.2 watts. PKG is at 1.5 - 1.8, dram at 0.4 |
@tylernguyen
Can you please confirm the CPU power of about 2W on PKG when idle? If possible also post an Intel power gadget screenshot.
I've got a feeling that the CPU power vectors are not exactly correct. I have a way lower PKG on Linux/Windows (<1W) and trying to pinpoint the issue.
Thanks!
The text was updated successfully, but these errors were encountered: