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 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! 
       
    • By Angelo_
      Just recently installed Mojave on my yoga 730(i5-8250u, 8gb of ram and 1080p 13.3" touchscreen) and got many features working, now the only issues are that my igpu is shown as only 7mb(and not metal capable, not sure whether it is or not) even tho I should've changed it from 5917 to 5916 (added both EFI folder and send me), the screen is shown as a 30.5" in system information and the cpu even tho I extracted the ssdt for it with ssdtPRGen.sh and appleintelinfo.kext to get low frequency info (ssdt was done with info 15,400,1600,3400 so it should go between 16-3400mhz and down to 400 in idle), idk what is wrong with my installation, can you guys help me or linke me something to fix those issues?
       
      Ps thunderbolt shows as no device found, is it regular for hackintoshes to be that way or do I need something for that too? Laptop has 2 tb3 ports as x4 pcie 3
      EFI.zip
      Send me Angeloss-MacBook-Pro.zip
    • By AppleVegas
      Hello! I was trying to install hackintosh a while ago and today I decided to install it today.
      I am able to boot it, I installed OS but have problems with iGPU. It has only 4mb vram.
      I did almost everything, I installed whatevergreen, used special clover config, but nothing. I've only got it to recognize my igpu.
       
      I have a laptop with this specs:
      Laptop brand name: Lenovo G50-80
      iGPU: Intel HD Graphics 5500 -- Only shows 4mb of vram
      CPU: Intel Core i5-5200U 2.20GHz
      dGPU: AMD Radeon R5 M230 or AMD Radeon HD 8500m (it has two brand names lol) -- will be really glad if you tell me how to launch it in High Sierra with my iGPU, now I can't even load OS when I have discrete GPU enabled
      RAM: 6GB ddr3
      Bluetooth: Qualcomm Atheros QCA61x4 -- On the way to enable it
      Wi-Fi: Qualcomm Atheros AR956x -- Managed to enable it
       
      P.S: In the windows I can see that my iGPU has Dedicated Video Memory: 128MB
       
      Any help? I think you are only my savers

    • By JhonneR
      Good morning, everyone, I'm sorry if I was wrong in choosing the topic but I need help.
      I have found it extremely difficult to mount a Hackintosh in my acer.
      Setup;
      I5 2430m 2.4 6GB RAM
      Mobo P5we0 - Intel intel Graphics 3000
      At the moment I have not found out what my audio codecs are.
      but I'll leave the link on the motherboard.
      however, my real problem is several.
      I have already used the itakos image, I have already used several images that could be installed normally and that after installing the image I do not have internet via cable or wireless.
      And another, I already looked in other forums and I know that I will be called a donkey in the logical question but I have not been able to install the [url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url] or clover to start from the Hard Disk, so I do not know what to do.At the moment I still do not know if there has already been someone who has already installed the High Sierra or just the Sierra in this notebook model and obtained permanent success.
      If anyone can help me, I'll be grateful.
      Installations without success, but with the system already installed in ACER;
      SIERRA
      HIGH SIERRA
      MOJAVE
      All with the same symptom. Starting only by the bootable USB stick and without internet connection via cable and wireless.
      Appreciate ! Acer 5750 Official Page
×