Jump to content
Whit3Spirit

Disabling NVIDIA Optimus card on all laptops

346 posts in this topic

Recommended Posts

We do the same thing on the ProBook. You use an External declaration to gain access to the methods in SSDT from DSDT. These are the DSDT patches we use:

into definitionblock code_regex . insert
begin
External(\_SB_.PCI0.PEGP.DGFX._OFF, MethodObj)\n
External(\_SB_.PCI0.PEGP.DGFX._ON, MethodObj)\n
end;

into method label _PTS code_regex ([\s\S]*) replace_matched
begin
If (CondRefOf(\\_SB_.PCI0.PEGP.DGFX._ON)) { \\_SB_.PCI0.PEGP.DGFX._ON() }\n
%1
end;

into method label _WAK code_regex (Return\s+\(.*) replace_matched
begin
If (CondRefOf(\\_SB_.PCI0.PEGP.DGFX._OFF)) { \\_SB_.PCI0.PEGP.DGFX._OFF() }\n
%1
end;
The paths to _ON/_OFF may be different in your SSDT, so be sure to tweak the patch as necessary.

 

 

Rehab?

 

Just a question, Why do you turn the card on, on PTS?

Share this post


Link to post
Share on other sites
Advertisement

Rehab?

 

Just a question, Why do you turn the card on, on PTS?

We found that leaving the card in _OFF mode across sleep caused problems with restart and wake. So, in _PTS we restore via _ON, and _WAK turns it back off again.

Share this post


Link to post
Share on other sites

These patches could be useful for me if i could disable the HD4600 instead of the Nvidia card as it is used to control display on external screen through HDMI, good job though :)

Share this post


Link to post
Share on other sites

I use already the latest Clover...how can I use it on the fly?

 

Go make this SSDT with clover in patched DSDT folder, normaly it's good for you. Remember to disable the DropOEM tables.

 

 

I'm not even touching the DSDT but only adding _DSM methods and other things that I need in a SSDT which is injected by Clover (DSDT free Clover config). The _PTS and _WAK methods do not exist in the SSDT where I have turned off the card. Can I reference to the _PTS and _ WAK in the SSDT? How? And will that overwrite the methods with the ones defined in DSDT? Thanks again.

 

My SSDT is similar to this one as decribed by Stevo here

DefinitionBlock ("SSDT-1.aml", "SSDT", 2, "APPLE ", "Optimus", 0x00001000)
{
    External (\_SB_.PCI0.PEG0, DeviceObj)
    External (\_SB_.PCI0.PEG0.PEGP._PS3, MethodObj)
    External (\_SB_.PCI0.PEG0.PEGP._DSM, MethodObj)
    Scope (\_SB.PCI0.PEG0)
    {
        Method (_INI, 0, NotSerialized)
        {
            \_SB.PCI0.PEG0.PEGP._DSM (Buffer (0x10)
                {
                    /* 0000 */   0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,
                    /* 0008 */   0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0
                }, 0x0100, 0x1A, Buffer (0x04)
                {
                     0x01, 0x00, 0x00, 0x03
                })
            If (One)
            {
                \_SB.PCI0.PEG0.PEGP._PS3 ()
            }
        }
    }
}

Share this post


Link to post
Share on other sites

RehabMan - I already have a patched DSDT that works :)

 

I'm just trying this new method of not using a patched DSDT and using Clover to do patching on the fly. I guess I will patch in the _PTS and _WAK sections of the DSDT using Clover.

One thing you could do is rename (with Clover search/replace patching) _PTS and _WAK (to something like ZPTS/ZWAK... make sure they are not used). Then from SSDT, you can define new _PTS and _WAK, that call back into DSDTs now renamed ZPTS/ZWAK and do the extra stuff you want them to do...

Go make this SSDT with clover in patched DSDT folder, normaly it's good for you. Remember to disable the DropOEM tables.

I don't think you understand completely what webcivilian is trying to do...

Share this post


Link to post
Share on other sites

Go make this SSDT with clover in patched DSDT folder, normaly it's good for you. Remember to disable the DropOEM tables.

Always enable DropOEM when you use patched SSDT, or it will cause conflict between ssdt tables.

Share this post


Link to post
Share on other sites

One thing you could do is rename (with Clover search/replace patching) _PTS and _WAK (to something like ZPTS/ZWAK... make sure they are not used). Then from SSDT, you can define new _PTS and _WAK, that call back into DSDTs now renamed ZPTS/ZWAK and do the extra stuff you want them to do...

 

Good idea. Let me try it :)

Share this post


Link to post
Share on other sites

Restart still broken even after call the ON method on _PTS.

If you want another set of eyes, post ioreg (use IORegistryExplorer 2.1).

Share this post


Link to post
Share on other sites

OK here are the files. I have also included my modified SSDT and Clover patched DSDT. Also a patched DSDT which works.

 

Thanks again for your help.

I wasn't expecting ZPTS/ZWAK to be completely empty, but ok...

 

Looks like you just copied _WAK/_PTS to ssdt-2 and then patched (to call PINI/OPOF/etc).

 

Seems like it should work. And if I extract all your DSDT/SSDTs from ioreg and use "iasl -da *" I get successful disassembly. In addition, PNLF is loaded and attached to ACPIBacklight, so we know that ssdt-2 is loading ok.

 

Your next step would be to do some traces... Have you used ACPIDebug yet? https://github.com/RehabMan/OS-X-ACPI-Debug. It is very useful...

Share this post


Link to post
Share on other sites

I haven't used ACPIDebug yet. Let me try it and see if I find something. 

 

But can you check my working DSDT against the SSDTs. The ON and OFF methods are a little different and I'm just calling the PS3 methods from IGPU _DSM and there are no issues with restart.

Share this post


Link to post
Share on other sites

I haven't used ACPIDebug yet. Let me try it and see if I find something. 

 

But can you check my working DSDT against the SSDTs. The ON and OFF methods are a little different and I'm just calling the PS3 methods from IGPU _DSM and there are no issues with restart.

I didn't look at your "working DSDT." I assumed you were doing the *same* thing with your SSDT solution. Is that not the case? If so, why?

Share this post


Link to post
Share on other sites

There are some differences. Doix actually created the Optimus off DSDT patch for XPS laptops. I need some help understanding the difference.

I would try my way... then see if you can adapt to your desire for SSDT-based solution:

- patch SSDT to call _OFF from _INI

- patch _PTS to call _ON

- patch _WAK to call _OFF

 

I don't really think the "lets copy a bunch of code from SSDT into DSDT" technique is a good one.

Share this post


Link to post
Share on other sites

I don't understand all your work but :

 

- Why make a SSDT solution for disabled Optimus if the DSDT must be changed ?

- What is the technic for change the DSDT code on the fly in clover ? (for change WAK to ZWAK) Because if you make a SSDT solution, this is for those can't change their DSDT...

 

Can you post just a link for me so I can learn to change DSDT on the fly with clover ?

 

Thanks dudes

Share this post


Link to post
Share on other sites

@ Whit3Spirit - The DSDT doen't need to be changed because we can disable nvidia optimus from SSDT. My problem is that my computer won't restart but shutdown when I turn off Optimus so I was trying some suggestions given by Rehabman to turn on the card.

 

The technique is called Clover DSDT patching. You can read it here: http://clover-wiki.zetam.org/Configuration/ACPI#DSDT

Share this post


Link to post
Share on other sites

@ Whit3Spirit - The DSDT doen't need to be changed because we can disable nvidia optimus from SSDT. My problem is that my computer won't restart but shutdown when I turn off Optimus so I was trying some suggestions given by Rehabman to turn on the card.

 

The technique is called Clover DSDT patching. You can read it here: http://clover-wiki.zetam.org/Configuration/ACPI#DSDT

You can't, the _OFF method is called inevitably in _WAK and in _INI method and you can't call their method in a DSDT. Or i don't understand... ? :(

 

And thanks for Patches in Clovers, instructive !

Share this post


Link to post
Share on other sites

You can't, the _OFF method is called inevitably in _WAK and in _INI method and you can't call their method in a DSDT. Or i don't understand... ? :(

 

And thanks for Patches in Clovers, instructive !

I don't think you understand. You can call whatever method you want, no matter where it exists... just use External to reach it.

Share this post


Link to post
Share on other sites

I don't think you understand. You can call whatever method you want, no matter where it exists... just use External to reach it.

You can add PINI method in _WAK from SSDT then ?

 

Because you have to call the OFF method in the WAK method, not with and if you call WAK from SSDT with an External link, you can't modify it... No ?

 

Sorry if i have a very bad english :P i just learn with all your know :lol:

Share this post


Link to post
Share on other sites

You can add PINI method in _WAK from SSDT then ?

You use External to access a method defined elsewhere.

 

Because you have to call the OFF method in the WAK method, not with and if you call WAK from SSDT with an External link, you can't modify it... No ?

Not sure what you're asking.

Share this post


Link to post
Share on other sites

With clover patch :

 

Change :

Method (_WAK

base64 : TWV0aG9kIChfV0FL

 

To :

Method (PINI, 0, NotSerialized)
    {
        \_SB.PCI0.PEG0.PEGP._DSM (Buffer (0x10)
            {
                /* 0000 */   0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,
                /* 0008 */   0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0
            }, 0x0100, 0x1A, Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x03
            })
        If (One)
        {
            \_SB.PCI0.PEG0.PEGP._PS3 ()
        }
​    }
Method (_WAK

base64 : TWV0aG9kIChQSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgIHsNCiAgICAgICAgXF9TQi5QQ0kwLlBFRzAuUEVHUC5fRFNNIChCdWZmZXIgKDB4MTApDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgLyogMDAwMCAqLyAgIDB4RjgsIDB4RDgsIDB4ODYsIDB4QTQsIDB4REEsIDB4MEIsIDB4MUIsIDB4NDcsDQogICAgICAgICAgICAgICAgLyogMDAwOCAqLyAgIDB4QTcsIDB4MkIsIDB4NjAsIDB4NDIsIDB4QTYsIDB4QjUsIDB4QkUsIDB4RTANCiAgICAgICAgICAgIH0sIDB4MDEwMCwgMHgxQSwgQnVmZmVyICgweDA0KQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAzDQogICAgICAgICAgICB9KQ0KICAgICAgICBJZiAoT25lKQ0KICAgICAgICB7DQogICAgICAgICAgICBcX1NCLlBDSTAuUEVHMC5QRUdQLl9QUzMgKCkNCiAgICAgICAgfQ0K4oCLICAgIH0NCk1ldGhvZCAoX1dBSw==

 

Change :

Method (_WAK, 1, Serialized)
     {

Base64 : TWV0aG9kIChfV0FLLCAxLCBTZXJpYWxpemVkKQ0KICAgICB7

 

To :

Method (_WAK, 1, Serialized)
     {
         PINI ()

Base64 : TWV0aG9kIChfV0FLLCAxLCBTZXJpYWxpemVkKQ0KICAgICB7DQogICAgICAgICBQSU5JICgp

 

 

Change :

Method (_INI, 0, NotSerialized)
        {
            Store (0x07D0, OSYS)      

Base64 : TWV0aG9kIChfSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBTdG9yZSAoMHgwN0QwLCBPU1lTKQ==

 

To :

Method (_INI, 0, NotSerialized)
        {
            Store (0x07D0, OSYS)
            PINI()

Base64 : TWV0aG9kIChfSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBTdG9yZSAoMHgwN0QwLCBPU1lTKQ0KICAgICAgICAgICAgUElOSSgp

 

 

 

 

 

Like that in config.plist :

<key>Patches</key>
            <array>
                <dict>
                    <key>Find</key>
                    <data>TWV0aG9kIChfV0FL</data>
                    <key>Replace</key>
                    <data>TWV0aG9kIChQSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgIHsNCiAgICAgICAgXF9TQi5QQ0kwLlBFRzAuUEVHUC5fRFNNIChCdWZmZXIgKDB4MTApDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgICAgLyogMDAwMCAqLyAgIDB4RjgsIDB4RDgsIDB4ODYsIDB4QTQsIDB4REEsIDB4MEIsIDB4MUIsIDB4NDcsDQogICAgICAgICAgICAgICAgLyogMDAwOCAqLyAgIDB4QTcsIDB4MkIsIDB4NjAsIDB4NDIsIDB4QTYsIDB4QjUsIDB4QkUsIDB4RTANCiAgICAgICAgICAgIH0sIDB4MDEwMCwgMHgxQSwgQnVmZmVyICgweDA0KQ0KICAgICAgICAgICAgew0KICAgICAgICAgICAgICAgICAweDAxLCAweDAwLCAweDAwLCAweDAzDQogICAgICAgICAgICB9KQ0KICAgICAgICBJZiAoT25lKQ0KICAgICAgICB7DQogICAgICAgICAgICBcX1NCLlBDSTAuUEVHMC5QRUdQLl9QUzMgKCkNCiAgICAgICAgfQ0K4oCLICAgIH0NCk1ldGhvZCAoX1dBSw==</data>
                </dict>
                <dict>
                    <key>Find</key>
                    <data>TWV0aG9kIChfV0FLLCAxLCBTZXJpYWxpemVkKQ0KICAgICB7</data>
                    <key>Replace</key>
                    <data>TWV0aG9kIChfV0FLLCAxLCBTZXJpYWxpemVkKQ0KICAgICB7DQogICAgICAgICBQSU5JICgp</data>
                </dict>
                <dict>
                    <key>Find</key>
                    <data>TWV0aG9kIChfSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBTdG9yZSAoMHgwN0QwLCBPU1lTKQ==</data>
                    <key>Replace</key>
                    <data>TWV0aG9kIChfSU5JLCAwLCBOb3RTZXJpYWxpemVkKQ0KICAgICAgICB7DQogICAgICAgICAgICBTdG9yZSAoMHgwN0QwLCBPU1lTKQ0KICAgICAgICAgICAgUElOSSgp</data>
                </dict>
            </array>

that's good ?

Share this post


Link to post
Share on other sites

Or you can just add an SSDT file and do the following without Clover patching the DSDT:

DefinitionBlock ("SSDT-1.aml", "SSDT", 2, "DELL ", "Optimus", 0x00001000)
{
    External (\_SB_.PCI0.PEG0.PEGP._PS3, MethodObj)    
    External (\_SB_.PCI0.PEG0.PEGP._DSM, MethodObj)    
    Method (\_SB._INI, 0, NotSerialized)
    {
        \_SB.PCI0.PEG0.PEGP._DSM (Buffer (0x10)
            {
                /* 0000 */   0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,
                /* 0008 */   0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0
            }, 0x0100, 0x1A, Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x03
            })
        If (One)
        {
            \_SB.PCI0.PEG0.PEGP._PS3 ()
        }
    }
}

Share this post


Link to post
Share on other sites

Or you can just add an SSDT file and do the following without Clover patching the DSDT:

DefinitionBlock ("SSDT-1.aml", "SSDT", 2, "DELL ", "Optimus", 0x00001000)
{
    External (\_SB_.PCI0.PEG0.PEGP._PS3, MethodObj)    
    External (\_SB_.PCI0.PEG0.PEGP._DSM, MethodObj)    
    Method (\_SB._INI, 0, NotSerialized)
    {
        \_SB.PCI0.PEG0.PEGP._DSM (Buffer (0x10)
            {
                /* 0000 */   0xF8, 0xD8, 0x86, 0xA4, 0xDA, 0x0B, 0x1B, 0x47,
                /* 0008 */   0xA7, 0x2B, 0x60, 0x42, 0xA6, 0xB5, 0xBE, 0xE0
            }, 0x0100, 0x1A, Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x03
            })
        If (One)
        {
            \_SB.PCI0.PEG0.PEGP._PS3 ()
        }
    }
}

 

This only works if there is no _SB._INI already defined in DSDT.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By RamLalith
      I executed all my DSDT's and SSDTs with no errors 
      I can't patch the battery

      I need help
      I am attaching my ACPI folder
      ACPI.zip
    • By SepehrM
      I'm trying to install High Sierra 10.13.3 on an ASUS N552VW laptop, and I get stuck after this message:
      "could not recover SATA HDD after 5 attempts, terminating" 
      And some other warnings afterwards.
      Specs:
      CPU: Intel Skylake 6700HQ 2.6GHz
      RAM: 16GB DDR4
      2TB HDD + 128GB SSD
      GPU: Intel HD Graphics 530 + Nvidia GTX960m
      I'm installing using a 16GB USB3 flash drive on one of HDD volumes (UEFI Mode)
       
      I uploaded the verbose log and clover config.plist
      config-new.plist

    • By Slice
      I successfully installed macOS 10.11.6 and Windows 7 Pro SP1 in UEFI mode on the laptop.
      I know, there are detailed guides here and on osxlatitude.com but I was not agree with them and carefully check and test every step to tune my Mac.
       
      Hardware
      Intel® Core� i5-3320M CPU @ 2.60GHz, speedstep works with Clover default settings
      Chipset Intel 7 series, no patches needed
      Video: IntelHD4000 or NVS5200M switchable in BIOS, work in both cases
      LAN; Intel 82579LM, works with IntelMausiEthernet.kext v2.2.1
      Audio: IDT 92HD93BXX, works with VoodooHDA 2.9.0.
      SDHC reader O2Micro; works with native AppleSDHC.kext with Clover Arbitrary properties.
      USB3.0 works natively if not disabled in DSDT
      PS2 keyboard and touchpad works with VoodooPS2.
      WiFi: Dell Intel WiFi was replaced by Dell DW1520, Broadcom BCM943224HMS. DeviceID=4353
      LCD Screen 1366x768
      BIOS A12. Initially was A02. Then I flashed A23 and found it is quite bad. The screen is full of artefacts. Flash A12 and all is OK. Not tested other versions.
      For some reason BIOS can switched from Intel to Nvidia by itself so I have to do my solution working independent on this state.
       
      WiFi
      It is not working OOB although it has DeviceID known to Apple. The reason is WhiteList in the driver.
      I set MacModel as MacBookPro10,1 while the WiFi will work on MacBookAir. I make a patch in Clover.
      As well a patch for channels.
      I deleted a kext Brcm4331 because it has the same DeviceID. Let kext Brcm4360 to work alone.
       
      VideoCards
      In Bios we can set Optimus = Enable/Disable
      If Enable then we have two videocards Intel first and Nvidia second. In this case additional SSDT-3.aml will switch off Nvidia.
      If Disable then we have only Nvidia card. It will work if Board-ID taken from iMac13,2.
      But here there is contradiction with WiFi with required Board-ID from MacBookAir.
      So I take MacModel as MacBookPro10,1 which is most close by CPU IvyBridge.
      Set BoardID like iMac13,2 to make Nvidia working.
      Patch BoardID in Brcm4360 to make WiFi working.
      Now I have
      Inject->
      ->Intel=YES
      ->Nvidia=YES
      and SSDT-3.aml in ACPI\patched folder. This SSDT will switch off Nvidia if Intel card ON.
      For Intel graphics there is a patch against 8 apples at start.
       
      Brightness
      No special kexts.
      The brightness controlled by keys F1,F2 and slider in Control Panel in both case Intel or Nvidia. Details here  #72 
       
      DSDT and SSDT
      This is very long story and finally I have working sleep in both cases Intel or Nvidia.
       
      Sensors
      I use my HWSensors3 with FakeSMC 3.5.0.
      I got monitoring:
      CPU temperature
      GPU temperature
      GPU main frequency
      GPU shader frequency
      Battery state % full, time to charged or time to empty.
      Battery voltage dinamically.
      Battery amperage dynamically. I can see it changes on heavy games.
      HDD temperature.

       
      Audio
      I like VoodooHDA and have no problems with it.
      The sound is clear, loud, and switchable between internal speaker and headphone.
      Mic is working.
       
      Bluetooth
      Just tested with BTFirmwareUpdate.kext and it works in 10.11.6. I not needed it so switched off by wireless switch at right side.
      For 10.13.6 there is other kext BRCMInjector.
       
      Keyboard, Touchpad and Touchstick
      Post #14
       
      My config, ACPI files and kexts are in attachment.
      05.12.2017
      EFI.7z
       
      EDITED:
      Better DSDT in the post #6.
      Sleep working even when AC inserted.
       
      EDITED 06.12.2018
      Now I have HighSierra and this is my EFI folder
       

       
       
      Welcome to discussion!
      EFI-E6430.7z
      BRCMInjector.kext.zip
    • By bradipi15
      Ciao ragazzi ho un problema strano... 
      Praticamente quando avvio il pc usando il dsdt, appena connetto la tavoletta grafica huion h640p, il pc si riavvia... 
      Se invece tolgo il dsdt, funziona tutto perfettamente... 
    • By bradipi15
      Ciao ragazzi, ho bisogno di un aiuto per verificare che ho fatto tutto giusto, perché penso che la mx150 non sia effettivamente disabilitata. Ho utilizzato un dsdt fatto da gengik84 per un pc simile al mio.. Al momento penso di avere solo due problemi : la mx150, appunto... E poi il trackpad riesco ad usarlo in modalità advanced da bios proprio grazie al dsdt, però il doppio tap per trascinare oggetti ecc non va... L'ho abilitato anche dal menu accessibilità.. 
      Grazie mille! 
       
×