theQuert / XPS-9360-macOS

XPS 13 (9360) with macOS Big Sur
Apache License 2.0
182 stars 32 forks source link

Increased power consumption and resource utilization via IPG after sleep #27

Open egore24 opened 4 years ago

egore24 commented 4 years ago

Hello. I'm happily using your latest OC files, so thank you for that!

An ongoing issue I have noticed (long before OC, on Clover as well) is increased power consumption and resource utilization after sleep. This is measured with Intel Power Gadget. On a fresh boot, PKG power values in IPG remain at idle approx. 0.8 but after sleep wake up go up to no lower than 2.10. Utilization values on boot are approx 0.4, but never lower than 0.9 after sleep wake up.

Any ideas where to look to have these values remain unchanged after sleep?

Thanks.

ghost commented 4 years ago

Yap, I've notice this problem since Clover. To solve the problem, more researches about HWP and XCPM are needed.

Kinda busy on other stuffs these days, more researches would keep going in few days.

More info about power consumption would be updated to issue#25 in the future.

bozma88 commented 4 years ago

I am running OC on the XPS 9360 i7-7500U version, with HWP tables generated by one-key-cpufriend and choosing the most aggressive frequency-switching setting. Frequency scaling, power consumption and benchmarks are the same both pre and post-sleep. With NVME SSD (Sabrent Rocket) and FHD display at 50% brightness I am seeing 3.3w idle power consumption in total. Using MacBookPro14,1 identifier, as it is the most appropriate for 7500U users. idle

ghost commented 4 years ago

Thanks for replying, I think the problem should be solved from XCPM, more statistics would be collected and improved.

ghost commented 4 years ago

Test result: With the latest repo... Bootloader: Clover Monitor: Intel Power Gadget, HWMonitor

bozma88 commented 4 years ago

My results shown above (same PM before-after) is with a 7500U, custom CPUFriend data provider, turboboost eabled in BIOS, a Sabrent Rocket NVME SSD and identical EFI folder to yours, except for the following:

Same PM and GB scores before and after sleep.

Also, in Sierra I was happy without HWP and got extremely satisfying results by not enabling HWP, not injecting plugin-type SSDT property and just relying on legacy XCPM to control CPU and GPU frequency. Indeed, with XCPM, I was getting way more power states for both CPU and GPU, compared to HWP.

HWP in Catalina is a bit more clever, since, for example, throttles down performance and total watt usage when battery is lower than 20%.

Then, there is also the ability of the EC to override CPU scaling settings: for example, with battery at 0% and nearing its LVC, CPU is throttled down by BIOS at 0.4GHz flat.

ghost commented 4 years ago

OpenCore is just modified and updated. Try OpenCore as bootloader, cause more detailed power management is just configured with DSDT in OC.

egore24 commented 4 years ago

Hello and once again thank you for your efforts! I have installed OC from your latest repo and the power consumption has remained unchanged as before (prior to sleep, PKG 0.74; after sleep PKG 1.9)

Only differences I have had to modify are removal of Airport and BCM kexts along with associated removal of these kexts mentioned in kernel of config. Also, my machine can only achieve a -91 CPU undervolt, compared to your -100; all other BIOS variables are applied the same as you. I can provide my EFI if that would be of any help to you and further development on this issue of power management.

Thanks again!

ghost commented 4 years ago

Thanks for testing, more improvement would be updated in next week. Since XCPM is active, will see what can do to improve power consumption.

teeuwen commented 3 years ago

Do you have Thunderbolt Boot Support disabled in the BIOS settings @egore24?

I found the fix on the Arch Wiki: https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)#Power_Drain_after_waking_from_standby and besides, the README already calls for disabling this.

bozma88 commented 3 years ago

Even if months ago I had same power consumption before-after sleep, now I am starting to experience your issue.

I am on 7500U 8GB 9360 FHD.

Before sleep: 0.6w After sleep: 1.0w

Enabling-disabling thunderbolt in BIOS makes no difference. Card reader disabled in BIOS (it adds another 0.5w of left enabled). CPU base frequency, core and RAM power consumption are the same, even if total package power varies.

What I just discovered, and is 100% repeatable:

What does this mean? That there is likely a device that, upon wake from sleep, gets restored to a high-consumpton state from the BIOS ACPI tables. When putting laptop into sleep, some devices are put to sleep by the OS, others by ACPI. By interrupting the sleep before it completes, maybe you don't trigger some ACPI code that incorrectly restores power state to a specific device.

Please try this and, if it is repeatable on your systems, we can continue searching for the cause.

Thank you!

bozma88 commented 3 years ago

I must add an important detail that I forgot to say: You CANNOT interrupt the Sleep entering if you put the laptop to sleep by pressing FN-INS. That is an low-level sleep command and is controlled entirely by the BIOS. You must put the laptop to sleep via the OS, so e.g. via the power menu. This way, you can interrupt the sleep-entering (even after a fraction of a second) and you should observe the power consumption returning to LOW.

Please report!