Jump to content
Whit3Spirit

Disabling NVIDIA Optimus card on all laptops

343 posts in this topic

Recommended Posts

Yes it is the disassembling problem.  My challenge is to get SSDTs compiled...  Even disassembling with -da *.aml leaves errors...  I am working on it, let you know if I ever succeed.

Rehabman,

 

Ok, I am really over my head now;  I reduced the problem of compiling my SSDT to two errors:

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(141) : error    6126: syntax error, unexpected PARSEOP_FIELD

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(551) : error    6126: syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File

Which I think related to:

        OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)

            {

                VGAR,   2048

            })

The culprit is EBAS(0x1000) I think, I really need your expert opinion.  I am enclosing all the aml files that I have extracted in the attached zip file and many thanks in advance for your help. 

Originals.zip

Share this post


Link to post
Share on other sites
Advertisement

Rehabman,

 

Ok, I am really over my head now;  I reduced the problem of compiling my SSDT to two errors:

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(141) : error    6126: syntax error, unexpected PARSEOP_FIELD

5/20/14, 11:25:12 PM, iASLG1lHMs.dsl(551) : error    6126: syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File

Which I think related to:

        OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)

            {

                VGAR,   2048

            })

The culprit is EBAS(0x1000) I think, I really need your expert opinion.  I am enclosing all the aml files that I have extracted in the attached zip file and many thanks in advance for your help.

Fighting Intel iasl bugs here... iasl -da doesn't work (bug in iasl)! Something about "ACPI Error: Null object, but type not ACPI_TYPE_ANY (20140214/nsobject-179)"

 

 

So you have to disassemble individually and fix the mess.

 

The disassembler thinks that EBAS is a method taking one parameter. But if you look in DSDT, you see that it isn't. It is a FieldUnitObj.

 

So...

// External (EBAS, MethodObj) 
External(EBAS, FieldObj)
..
        //OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
        //    {
        //        VGAR,   2048
       //     })
        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            }//) // balancing...

Share this post


Link to post
Share on other sites

Fighting Intel iasl bugs here... iasl -da doesn't work (bug in iasl)! Something about "ACPI Error: Null object, but type not ACPI_TYPE_ANY (20140214/nsobject-179)"

 

 

So you have to disassemble individually and fix the mess.

 

The disassembler thinks that EBAS is a method taking one parameter. But if you look in DSDT, you see that it isn't. It is a FieldUnitObj.

 

So...

// External (EBAS, MethodObj) 
External(EBAS, FieldObj)
..
        //OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
        //    {
        //        VGAR,   2048
       //     })
        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            }//) // balancing...

Ok, Now I have an option with your suggestion of commenting  above;  To use \RMDT.PUSH in SSDT is this definition correct "Extternal (\RMDT.PUSH, MethodObj)" ?

Share this post


Link to post
Share on other sites

Ok, Now I have an option with your suggestion of commenting  above;  To use \RMDT.PUSH in SSDT is this definition correct "Extternal (\RMDT.PUSH, MethodObj)" ?

There is a patch in the ACPIDebug DSDT patch repo for the externs...

Share this post


Link to post
Share on other sites

There is a patch in the ACPIDebug DSDT patch repo for the externs...

Good morning RehabMan,

 

Couple of points.  yes I did find the  patch for externs and applied to my SSDT.  However the compiler insists that it is guessing P1, P2 etc requires 6 arguments and messes up at least when disassemble.

The Other issue I have is I get compile error on External (EBAS, FieldObject)  it does not like FieldObject!  Incidently I build your version of isal and use that.

How fo you get FieldObject passed by the compiler?

Thanks in advance,

Artimess

Share this post


Link to post
Share on other sites

Good morning RehabMan,

 

Couple of points.  yes I did find the  patch for externs and applied to my SSDT.  However the compiler insists that it is guessing P1, P2 etc requires 6 arguments and messes up at least when disassemble.

Yes, of course... External declarations DO NOT carry into the AML, so the disassembler must guess. Thus the importance of disassembly in a group (with iasl -da). Just work with the .dsl as if they are source code... after initial disassembly, work only with the resulting .dsl files and never disassemble unless you update your BIOS. Disassembly is NOT something you should be doing every time...

 

The Other issue I have is I get compile error on External (EBAS, FieldObject)  it does not like FieldObject!  Incidently I build your version of isal and use that.

How fo you get FieldObject passed by the compiler?

Thanks in advance,

Artimess

It is FieldUnitObj, not FieldObject.

 

Read ACPI spec: http://acpi.info/spec.htm

Share this post


Link to post
Share on other sites

Hi Artimess,

try with that : https://www.dropbox.com/s/w84mvfaqyt7ampb/SSDT%28Artimess%29.aml

 

Apparently, external link cause the problem, this is not the OR. External link just cause an iASL bug... don't understand why but it's working now.

 

Modified :

OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            })
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

to :

        OperationRegion (GNVS, SystemMemory, 0xAAF25C18, 0x0172)
        Field (GNVS, AnyAcc, Lock, Preserve)
        {
            Offset (0x100),
            EBAS,   32
        }

        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            VGAR,   2048,
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

Share this post


Link to post
Share on other sites

Hi Artimess,

try with that : https://www.dropbox.com/s/w84mvfaqyt7ampb/SSDT(Artimess).aml

 

Apparently, external link cause the problem, this is not the OR. External link just cause an iASL bug... don't understand why but it's working now.

 

Modified :

OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            })
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }
to :

        OperationRegion (GNVS, SystemMemory, 0xAAF25C18, 0x0172)
        Field (GNVS, AnyAcc, Lock, Preserve)
        {
            Offset (0x100),
            EBAS,   32
        }

        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            VGAR,   2048,
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

 

Did you read post #105? Not an iasl bug, but rather an iasl limitation. Externals are not encoded in the resulting AML. Therefore, the iasl disassembler must guess about any unresolved symbols when disassembling an AML standalone. Sometimes it cannot guess the correct configuration of the external symbol (because guessing is always imperfect). Thus why disassembly should always be done with the entire group of AML files (iasl -da) and only when necessary (eg. after initial extraction).

 

I should probably forget about trying to explain this to people, because unless you have a background in programming, it will probably never sink in.

 

Bottom line: Disassembly of AMLs is good (surprisingly good, actually), but imperfect. Don't disassemble unless absolutely necessary. Treat your edited DSL files as source code, and the resulting AML as binary results from compilation. Never open the AMLs directly for editing -- only open properly disassembled DSL files or DSL files you previously created via disassembly and patching.

Share this post


Link to post
Share on other sites

Okay. I'm obviously not a Programmer, I'm a mason.  ^_^  But I learned over time and experiences of others. This is my passion.

 

Maybe I made a mistake in my work then?

Share this post


Link to post
Share on other sites

Okay. I'm obviously not a Programmer, I'm a mason.  ^_^  But I learned over time and experiences of others. This is my passion.

 

Maybe I made a mistake in my work then?

No. Just don't expect disassembly of an AML that has many external references to compile error free. It is an unreasonable expectation as the AML format was not designed for perfect disassembly.

Share this post


Link to post
Share on other sites

 

Hi Artimess,

try with that : https://www.dropbox.com/s/w84mvfaqyt7ampb/SSDT%28Artimess%29.aml

 

Apparently, external link cause the problem, this is not the OR. External link just cause an iASL bug... don't understand why but it's working now.

 

Modified :

OperationRegion (BPCI, SystemMemory, EBAS (0x1000), Field (BPCI, ByteAcc, NoLock, Preserve)
            {
                VGAR,   2048
            })
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

to :

        OperationRegion (GNVS, SystemMemory, 0xAAF25C18, 0x0172)
        Field (GNVS, AnyAcc, Lock, Preserve)
        {
            Offset (0x100),
            EBAS,   32
        }

        OperationRegion (BPCI, SystemMemory, EBAS, 0x1000)
        Field (BPCI, ByteAcc, NoLock, Preserve)
        {
            VGAR,   2048,
            Offset (0x48B),
                ,   1,
            NHDA,   1
        }

Bonjour, un grand merci pour ton aide. 

Thanks for your help.

Share this post


Link to post
Share on other sites

When I add the method M_ON and M_OF before the _WAK method,it comes the error:

 

"Input file does not appear to be an ASL or data table source file"

 

What should I do?

Share this post


Link to post
Share on other sites

Hi daxuexinsheng, copy these methods just in on line like that. Say to me if it's working pls.

 

Method (M_ON, 0, NotSerialized)
    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._ON)) { \_SB_.PCI0.PEG0.PEGP._ON() }  If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS0)) { \_SB_.PCI0.PEG0.PEGP._PS0() } }
Method (M_OF, 0, NotSerialized)
    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._OFF)) { \_SB_.PCI0.PEG0.PEGP._OFF() } If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS3)) { \_SB_.PCI0.PEG0.PEGP._PS3() } }

Share this post


Link to post
Share on other sites

Tried on MSI GE60 2OE, didn't work and it broke working sleep

I also attached original dsdt dsdt-hdmi1.rar


I also had same problem, I copied from here https://www.dropbox.com/s/p2epjg7mpg9cyxc/OptimusRemoved.patch instead, line that has + in front indicates that those are the line to be inserted to.

 

When I add the method M_ON and M_OF before the _WAK method,it comes the error:

 

"Input file does not appear to be an ASL or data table source file"

 

What should I do?

Share this post


Link to post
Share on other sites

can someone help me to patch my DSDT? i use a intel hd 3000 and a nvidia gt610m!

 

when i patch the dsdt with chameleon i got these errors:

/Users/PC/cw_dsdt/dsdt.dsl   3782:             \_SB.PCI0.PEG0.PEGP._ON (\_SB.PCI0.PEG0.PEGP._PS0 ())
Error    4084 -                                       Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._ON)

/Users/PC/cw_dsdt/dsdt.dsl   3782:             \_SB.PCI0.PEG0.PEGP._ON (\_SB.PCI0.PEG0.PEGP._PS0 ())
Error    4084 -                                                                 Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._PS0)

/Users/PC/cw_dsdt/dsdt.dsl   3790:             \_SB.PCI0.PEG0.PEGP._OFF (\_SB.PCI0.PEG0.PEGP._PS3 ())
Error    4084 -                                        Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._OFF)

/Users/PC/cw_dsdt/dsdt.dsl   3790:             \_SB.PCI0.PEG0.PEGP._OFF (\_SB.PCI0.PEG0.PEGP._PS3 ())
Error    4084 -                                                                  Object does not exist ^  (\_SB.PCI0.PEG0.PEGP._PS3)

attached is my DSDT! thank you :)

can someone help me?

Share this post


Link to post
Share on other sites

For some reason, this isn't working on my Dell n5110. 

 

I have to copy the entire PEG0 device from the SSDT to the DSDT and call the _PS3 method from _INI to get the nvidia card disabled.

 

Trying to call _PS3 directly as per this guide doesn't work!!

Share this post


Link to post
Share on other sites

Hi daxuexinsheng, copy these methods just in on line like that. Say to me if it's working pls.

 

Method (M_ON, 0, NotSerialized)

    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._ON)) { \_SB_.PCI0.PEG0.PEGP._ON() }  If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS0)) { \_SB_.PCI0.PEG0.PEGP._PS0() } }

Method (M_OF, 0, NotSerialized)

    { If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._OFF)) { \_SB_.PCI0.PEG0.PEGP._OFF() } If (CondRefOf(\_SB_.PCI0.PEG0.PEGP._PS3)) { \_SB_.PCI0.PEG0.PEGP._PS3() } }

 

It works,Thank you! :-)

Share this post


Link to post
Share on other sites

@Whit3Spirit:

 

Here are my untouched DSDT and SSDT dumps from AIDA64.

 

Also attached is my current patched DSDT that correctly disables the nvidia card. 

 

 

AIDA64.zip

nvidia_off.zip

Share this post


Link to post
Share on other sites

@Whit3Spirit:

 

Here are my untouched DSDT and SSDT dumps from AIDA64.

 

Also attached is my current patched DSDT that correctly disables the nvidia card. 

 

Your method is a non classic method for shutdown the discrete card. It is SGOF and SGON.

 

Try with that :

https://www.dropbox.com/s/as0jn4mrfe7s3kj/DSDT%28Dr.%20Hurt%29.aml

Share this post


Link to post
Share on other sites

Your method is a non classic method for shutdown the discrete card. It is SGOF and SGON.

 

Try with that :

https://www.dropbox.com/s/as0jn4mrfe7s3kj/DSDT%28Dr.%20Hurt%29.aml

 

That worked too :)

 

Now the question is, would I be able to the same without copying all those methods from the SSDT?

Share this post


Link to post
Share on other sites

That worked too :)

 

Now the question is, would I be able to the same without copying all those methods from the SSDT?

 

Yes, with screwdrivers and pliers :P

Share this post


Link to post
Share on other sites

Yes, with screwdrivers and pliers :P

 

gee thanks  <_<

 

What I meant is, why is it not possible to call method SGOF directly from the DSDT using "External (_SB_.PCI0.PEG0.PEGP.SGOF, MethodObj)" as per your guide? Why do I have to copy all those methods from SSDT to DSDT?

Share this post


Link to post
Share on other sites

gee thanks  <_<

 

What I meant is, why is it not possible to call method SGOF directly from the DSDT using "External (_SB_.PCI0.PEG0.PEGP.SGOF, MethodObj)" as per your guide? Why do I have to copy all those methods from SSDT to DSDT?

Probably because your SSDT is not loading or is being rejected due to other errors. See post #79 where I detail some of the causes.

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   1 member

  • 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! 
       
×