Skip to content
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

Xiaomi Pro GTX (2018) - battery drains fast. Is NVidia GPU (dGPU) actually disabled? #741

Open
Moris-Shalon opened this issue Sep 27, 2023 · 6 comments
Labels
Battery Battery related issue Clover Clover related issue help wanted KBL Issue on Kaby Lake Refresh model

Comments

@Moris-Shalon
Copy link

I have 3 OS on my laptop: Windows 10 22H2, Ubuntu 22.04 and macOS 11.7.6.
For some reason, on macOS my laptop consumes twice as much energy, compared to Windows and Linux. On Windows power usage in idle state is around 4-5 watt, on Linux - around 5-6 watts. And on macOS it's 12-15 watts.
Also on macOS the laptop is noticably warmer, even though there is no heavy load at all.
First i thought, that it's some issue, related to CPU power management, but through Intel Power Gadget I see that CPU consumes only 2 watts in Idle state. So where does the other 10-13 watts come from in CoconutBattery and other applications, which measure power usage on battery? Even with maximal brightness my laptop in idle state doesn't drain my battery that much fast, it uses no more than 6 watts on Windows.

Screen Shot 2023-09-27 at 20 54 57 Screen Shot 2023-09-27 at 20 55 03

So is the dGPU, actually, disabled? I have checked SSDT-DDGPU.aml, read what the patch does and I see that there is device. named RMD10000 and it gets the value "0xf", which is desire for macOS.

image

But for some reason, my battery still discharges very fast on macOS. Want to under

Laptop model: Xiaomi Mi Notebook Pro GTX (2018) - i7 8550U + 16 GB RAM + GeForce 1050 Max-Q.
BIOS version: XMAKB5RRP0C05 (latest, also tried to downgrade to previous versions, but it didn't help).
EFI version: 1.8.0.
macOS version: 11.7.6.

Attached EFI folder to this issue/case.
CLOVER.zip

Also here is system.log, which i got by running
log show --predicate "processID == 0" --last boot --debug | grep "ERR"

system.log

@stevezhengshiqi stevezhengshiqi added help wanted Clover Clover related issue Battery Battery related issue KBL Issue on Kaby Lake Refresh model labels Sep 28, 2023
@stevezhengshiqi
Copy link
Collaborator

stevezhengshiqi commented Sep 28, 2023

Yes, the battery drain is truly a problem on our hacks.
I don't have much clue about this, and I will say it's due to multiple incompatibilities with macOS on hacks. For example,

  • Real MacBooks have SBST(Smart Battery Specification Table) ACPI table, which helps native power management and battery monitor.
  • Also, our hacks do not even have a EC device in ACPI table (Embedded Controller)
  • Different than Linux and Windows, macOS lacks support for Intel DPTF framework for performance tuning, a preliminary work can be checked at here: https://github.com/zhen-zen/ThermalSolution

macOS does not have drivers to enable multiple WIntel ACPI devices, such as WMI1 and WTBT, which might be useful for finer performance tuning. Hence, we have limited capability to have better power performance on macOS.

@Moris-Shalon
Copy link
Author

Yes, the battery drain is truly a problem on our hacks. I don't have much clue about this, and I will say it's due to multiple incompatibilities with macOS on hacks. For example,

  • Real MacBooks have SBST(Smart Battery Specification Table) ACPI table, which helps native power management and battery monitor.
  • Also, our hacks do not even have a EC device in ACPI table (Embedded Controller)
  • Different than Linux and Windows, macOS lacks support for Intel DPTF framework for performance tuning, a preliminary work can be checked at here: https://github.com/zhen-zen/ThermalSolution

macOS does not have drivers to enable multiple WIntel ACPI devices, such as WMI1 and WTBT, which might be useful for finer performance tuning. Hence, we have limited capability to have better power performance on macOS.

I have thought about it an i have one question: isn't it supposed to be related only to CPU power consumption? Why on Windows when CPU drains 2 watts, i have total power consumption around 4-6 watts, but on macOS same 2 watts for CPU result in overall battery drain around 12 watts?
I guess, we are missing something and NVidia GPU didn't get disabled properly by SSDT-DGPU patch. Seems like It's still draining battery, while working in idle state.
Maybe there is some way to verify if it's really disabled or not?

@stevezhengshiqi
Copy link
Collaborator

stevezhengshiqi commented Oct 3, 2023

isn't it supposed to be related only to CPU power consumption?

Subsystems like SBUS(System Management Bus), LPCB(Low Pin Count), XHC (USB Controller) all consume power, and need proper power management. Apparently, macOS does not utilize some Intel thermal daemons, because Apple customized their subsystem hardware, which could result unusual high power consumption on our non-Apple hacks.

I guess, we are missing something and NVidia GPU didn't get disabled properly by SSDT-DGPU patch.

There's limited way to disable Discrete GPU on our laptops. What we do in SSDT-DDPU is to call _OFF () method from our DGPU device(\_SB.PCI0.RP0X.PXSX). You can check if it works by removing

Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            If (_OSI ("Darwin"))
            {
                Return (0x0F)
            }
            Else
            {
                Return (Zero)
            }
        }
    }

And see if Device Manager in Windows can still find discrete graphics card. (I already tested it, the patch works pretty well)

By the way, even if the patch does not block out the discrete graphics card completely, we have few other way to disable it, apart from calling the _OFF () function.

@Moris-Shalon
Copy link
Author

You can check if it works by removing

And see if Device Manager in Windows can still find discrete graphics card. (I already tested it, the patch works pretty well)

I have removed _STA Method from SSDT-DDGPU.aml in "patched" folder, rebooted to Clover, choose "boot Microsoft from EFI" and... It's still there. Something seems to be wrong there.

image

So, yeah, it's seems like the main problem, actually, was NVidia's GPU, which worked all this time. Want to understand, why it does not shutdown by this patch, and why it still consumes energy.

By the way, even if the patch does not block out the discrete graphics card completely, we have few other way to disable it, apart from calling the _OFF () function.

Ok, what else can I do to get dGPU turned off?

@stevezhengshiqi
Copy link
Collaborator

stevezhengshiqi commented Oct 3, 2023

@Moris-Shalon

I have removed _STA Method from SSDT-DDGPU.aml in "patched" folder, rebooted to Clover, choose "boot Microsoft from EFI" and... It's still there. Something seems to be wrong there.

You have to use OpenCore to do this, because Clover will always disable all the ACPI patches when you boot non-macOS.

So, yeah, it's seems like the main problem, actually, was NVidia's GPU, which worked all this time. Want to understand, why it does not shutdown by this patch, and why it still consumes energy.

I really wish the power consumption problem can be solved that easily, but really, nothing for now can de done for discrete GPU. It has been disabled on macOS by using the vendor-provided _OFF () method. To dig this deeper, one may have to go through the MX150 specification sheet and figure out all the related variables in DSDT.

@Moris-Shalon
Copy link
Author

Moris-Shalon commented Oct 3, 2023

You have to use OpenCore to do this, because Clover will always disable all the ACPI patches when you boot non-macOS.

Ok, i will check it later. Didn't work with OpenCore yet, i know nothing about it as of now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Battery Battery related issue Clover Clover related issue help wanted KBL Issue on Kaby Lake Refresh model
Projects
None yet
Development

No branches or pull requests

2 participants