Contribute
Register

Nvidia discrete card can't be turned off

Status
Not open for further replies.
Joined
Mar 27, 2019
Messages
38
Motherboard
ASUS ROG Strix G G531GD
CPU
i5-9300H/HM370
Graphics
UHD 630 + GTX 1050
Mobile Phone
  1. Android
Help, I have tried to disable my discrete card by follow this because my laptop is consume much power and almost 1~1.5% drop per min when idling.
I follow the guide:
I have a _OFF method ***same as the post #3

Code:
Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            If (LEqual (CTXT, Zero))
            {
                If (LNotEqual (GPRF, One))
                {
                    Store (VGAR, VGAB)
                }

                Store (One, CTXT)
            }

            PGOF (Zero)
        }

As same as #3, mine also don't have a _INI method, so i patch this:
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "DGPU", 0x00000000)
{
    External (_SB_.PCI0.PEG0.PEGP._PS3, MethodObj)    // 0 Arguments (from opcode)

    Method (_SB.PCI0.PEG0.PEGP._INI, 0, NotSerialized)  // _INI: Initialize
    {
        _PS3 ()
    }
}

BUT the PGOF is not as same as the #3, mine is:
Code:
Method (PGOF, 1, Serialized)
        {
            Store (Arg0, PIOF)
            If (LEqual (PIOF, Zero))
            {
                If (LEqual (SGGP, Zero))
                {
                    Return (Zero)
                }
            }
            ElseIf (LEqual (PIOF, One))
            {
                If (LEqual (P1GP, Zero))
                {
                    Return (Zero)
                }
            }
            ElseIf (LEqual (PIOF, 0x02))
            {
                If (LEqual (P2GP, Zero))
                {
                    Return (Zero)
                }
            }

            Store (\XBAS, PEBA)
            Store (GDEV (PIOF), PDEV)
            Store (GFUN (PIOF), PFUN)
            If (LEqual (CCHK (PIOF, Zero), Zero))
            {
                Return (Zero)
            }

            Acquire (\_SB.PCI0.LPCB.EC0.CMUT, 0xFFFF)
            Store (0xC9, \_SB.PCI0.LPCB.EC0.BRAH)
            If (LNotEqual (And (\_SB.PCI0.LPCB.EC0.CNTD, 0x07), Zero))
            {
                Notify (\_SB.PCI0.PEG0.PEGP, 0xD1)
            }

            Release (\_SB.PCI0.LPCB.EC0.CMUT)
            Store (\_SB.PCI0.PEG0.LREN, \_SB.PCI0.PEG0.PEGP.LTRE)
            If (LEqual (Arg0, Zero))
            {
                Store (LCT0, ELC0)
                Store (S0VI, H0VI)
                Store (S0DI, H0DI)
                Store (LCP0, ECP0)
            }
            ElseIf (LEqual (Arg0, One))
            {
                Store (LCT1, ELC1)
                Store (S1VI, H1VI)
                Store (S1DI, H1DI)
                Store (LCP1, ECP1)
            }
            ElseIf (LEqual (Arg0, 0x02))
            {
                Store (LCT2, ELC2)
                Store (S2VI, H2VI)
                Store (S2DI, H2DI)
                Store (LCP2, ECP2)
            }

            RTDS (PIOF)
            If (LNotEqual (PBGE, Zero))
            {
                If (SBDL (PIOF))
                {
                    Store (GMXB (PIOF), MBDL)
                    PDUB (PIOF, MBDL)
                }
            }

            If (CondRefOf (SCLK))
            {
                SPCO (SCLK, Zero)
            }

            If (LEqual (Arg0, Zero))
            {
                Divide (\_SB.PCI0.PEG0.LNRD, 0x03E8, Local0, Local1)
                Sleep (Local1)
            }
            ElseIf (LEqual (Arg0, One))
            {
                Divide (\_SB.PCI0.PEG1.LNRD, 0x03E8, Local0, Local1)
                Sleep (Local1)
            }
            ElseIf (LEqual (Arg0, 0x02))
            {
                Divide (\_SB.PCI0.PEG2.LNRD, 0x03E8, Local0, Local1)
                Sleep (Local1)
            }

            GPPR (PIOF, Zero)
            DIWK (PIOF)
            Return (Zero)
        }

Apparently, there is EC code in my PGOF. I tried to patch myself with this code:
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "DGPU", 0x00000000)
{
    External (_SB_.PCI0, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.LPCB.EC0_, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.LPCB.EC0_.CMUT, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.LPCB.EC0_.CNTD, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.LPCB.EC0_.XREG, MethodObj)    // 2 Arguments (from opcode)
    External (_SB_.PCI0.PEG0.LNRD, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PEG0.LREN, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PEG0.PEGP, UnknownObj)    // Warning: Unknown object
    External (_SB_.PCI0.PEG0.PEGP.LTRE, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PEG1.LNRD, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PEG2.LNRD, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.CCHK, MethodObj)    // 2 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.DIWK, MethodObj)    // 1 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.ECP0, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.ECP1, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.ECP2, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.ELC0, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.ELC1, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.ELC2, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.GDEV, MethodObj)    // 1 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.GFUN, MethodObj)    // 1 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.GMXB, MethodObj)    // 1 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.GPPR, MethodObj)    // 2 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.H0DI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.H0VI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.H1DI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.H1VI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.H2DI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.H2VI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.LCP0, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.LCP1, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.LCP2, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.LCT0, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.LCT1, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.LCT2, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.MBDL, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.P1GP, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.P2GP, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.PBGE, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.PDEV, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.PDUB, MethodObj)    // 2 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.PEBA, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.PFUN, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.PIOF, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.RTDS, MethodObj)    // 1 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.S0DI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.S0VI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.S1DI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.S1VI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.S2DI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.S2VI, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.SBDL, MethodObj)    // 1 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.SCLK, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.SGGP, MethodObj)    // 0 Arguments (from opcode)
    External (_SB_.PCI0.PGOF.SPCO, MethodObj)    // 2 Arguments (from opcode)
    External (XBAS, MethodObj)    // 0 Arguments (from opcode)

    Scope (_SB.PCI0)
    {
        Method (PGOF, 1, Serialized)
        {
            Store (Arg0, PIOF ())
            If (LEqual (PIOF (), Zero))
            {
                If (LEqual (SGGP (), Zero))
                {
                    Return (Zero)
                }
            }
            ElseIf (LEqual (PIOF (), One))
            {
                If (LEqual (P1GP (), Zero))
                {
                    Return (Zero)
                }
            }
            ElseIf (LEqual (PIOF (), 0x02))
            {
                If (LEqual (P2GP (), Zero))
                {
                    Return (Zero)
                }
            }

            Store (\XBAS (), PEBA ())
            Store (GDEV (PIOF ()), PDEV ())
            Store (GFUN (PIOF ()), PFUN ())
            If (LEqual (CCHK (PIOF (), Zero), Zero))
            {
                Return (Zero)
            }

            Store (\_SB.PCI0.PEG0.LREN (), \_SB.PCI0.PEG0.PEGP.LTRE ())
            If (LEqual (Arg0, Zero))
            {
                Store (LCT0 (), ELC0 ())
                Store (S0VI (), H0VI ())
                Store (S0DI (), H0DI ())
                Store (LCP0 (), ECP0 ())
            }
            ElseIf (LEqual (Arg0, One))
            {
                Store (LCT1 (), ELC1 ())
                Store (S1VI (), H1VI ())
                Store (S1DI (), H1DI ())
                Store (LCP1 (), ECP1 ())
            }
            ElseIf (LEqual (Arg0, 0x02))
            {
                Store (LCT2 (), ELC2 ())
                Store (S2VI (), H2VI ())
                Store (S2DI (), H2DI ())
                Store (LCP2 (), ECP2 ())
            }

            RTDS (PIOF ())
            If (LNotEqual (PBGE (), Zero))
            {
                If (SBDL (PIOF ()))
                {
                    Store (GMXB (PIOF ()), MBDL ())
                    PDUB (PIOF (), MBDL ())
                }
            }

            If (CondRefOf (SCLK))
            {
                SPCO (SCLK (), Zero)
            }

            If (LEqual (Arg0, Zero))
            {
                Divide (\_SB.PCI0.PEG0.LNRD (), 0x03E8, Local0, Local1)
                Sleep (Local1)
            }
            ElseIf (LEqual (Arg0, One))
            {
                Divide (\_SB.PCI0.PEG1.LNRD (), 0x03E8, Local0, Local1)
                Sleep (Local1)
            }
            ElseIf (LEqual (Arg0, 0x02))
            {
                Divide (\_SB.PCI0.PEG2.LNRD (), 0x03E8, Local0, Local1)
                Sleep (Local1)
            }

            GPPR (PIOF (), Zero)
            DIWK (PIOF ())
            Return (Zero)
        }
    }

    Scope (_SB.PCI0.LPCB.EC0)
    {
        OperationRegion (RME3, EmbeddedControl, Zero, 0xFF)
        Method (_REG, 2, NotSerialized)  // _REG: Region Availability
        {
            XREG (Arg0, Arg1)
            If (LAnd (LEqual (0x03, Arg0), LEqual (One, Arg1)))
            {
                Acquire (\_SB.PCI0.LPCB.EC0.CMUT (), 0xFFFF)
                If (LNotEqual (And (\_SB.PCI0.LPCB.EC0.CNTD (), 0x07), Zero))
                {
                    Notify (\_SB.PCI0.PEG0.PEGP, 0xD1)
                }

                Release (\_SB.PCI0.LPCB.EC0.CMUT ())
            }
        }
    }
}
I save as SSDT.aml and put in EFI.
*But there is a compile error and i just "//" it below Acquire (\_SB.PCI0.LPCB.EC0.CMUT (), 0xFFFF) line.
Result: The discrete card doesn't turn off and the fan still running.
I am almost desperate because of worse battery life, Any fix or mistake?
 

Attachments

  • origin.zip
    93.5 KB · Views: 74
Your Nvidia DGPU _OFF method is: \_SB.PCI0.PEG0.PG00._OFF ()
It's included in SSDT-9-OptTabl...

Carefully follow RM guide... and use the above off method.
 
Your Nvidia DGPU _OFF method is: \_SB.PCI0.PEG0.PG00._OFF ()
It's included in SSDT-9-OptTabl...

Carefully follow RM guide... and use the above off method.
It should be \_SB.PCI0.PEG0.PEGP._OFF () not PG00 but the guide said can use _PS3 and i also tried _OFF method
 
Last edited:
PowerResource _OFF method is defined in PG00, hence, I suggested to use \_SB.PCI0.PEG0.PG00._OFF ()
I'd give it a try...
 
PowerResource _OFF method is defined in PG00, hence, I suggested to use \_SB.PCI0.PEG0.PG00._OFF ()
I'd give it a try...
ohh, i have tried this before, but i face some problem when dealing with PG00.
1. I cannot find _INI for \_SB.PCI0.PEG0.PG00
2. There is also a EC0 in _OFF and i // it.
3. And there is a PGOF in the above _OFF method and there is some EC related code in corresponding PGOF.
 
Last edited:
Duplicated Posts
 
Last edited:
Ok...
Put the attached SSDT in ACPI/patched.
Be sure of having AutoMerge set in your config.plist
Be sure DropOEM is not set in your config.plist
Reboot
 

Attachments

  • SSDT-DGPU_OFF.aml
    142 bytes · Views: 84
Ok...
Put the attached SSDT in ACPI/patched.
Be sure of having AutoMerge set in your config.plist
Be sure DropOEM is not set in your config.plist
Reboot
I have tried but fan still running...
I think I have to move all the EC related code to DSDT but i am not sure how to
 
Last edited:
UP again cuz I still trying to solve this..
 
Status
Not open for further replies.
Back
Top