Jump to content

[DEV] Disabling the nvidia card for battery life (optimus)


hk93
 Share

20 posts in this topic

Recommended Posts

Yesterday I told myself as a n53sv owner that if there were not any way to use the DGPU (nvidia 540m in my case) there must be at least a way to disable it to save battery power.

I never used anything programming-on-osx-related but I got Xcode and started playing with it.

I must say that it was really easy.

This is the result:

NoNvidia: NoNvidia by michyprima, init
NoNvidia: got the ACPI device
NoNvidia: disabling nvidia card
NoNvidia: nvidia card successfully disabled

The code gets the ACPI device from the PCI device and calls the DOFF method. If your DGPU device (GFX0 in my case) has a DOFF method, you do not have to modify anything (if you don't care about the GFX led remaining white), since the ACPI device is got from the device id (0x0df410de in my case) set in the Info.plist

If your device has not a DOFF method or you want the led to turn blue, you have to do a little mod to your dsdt.

If your disabling function is not DOFF but i.e. GPUOFF is enough to replace any occurrence of GPUOFF with DOFF. (it's not the asus n53sv case)

If you want a complete disable, including the blue led (asus n53sv case) find where the DOFF function is called, in my case the _PS3 method inside the LCDD device:

		Method (_PS3, 0, NotSerialized)
	{
		If (LEqual (^^^GFX0.P3MO, 0x03))
		{
			DOFF ()
			SGPL (0x23, One, Zero)
			Store (0x03, ^^^GFX0._PSC)
			Store (One, ^^^GFX0.DGPS)
			Store (0x02, ^^^GFX0.P3MO)
		}
	}

and move everything under the DOFF() call at the end of the DOFF method, so you will have:

		Method (_PS3, 0, NotSerialized)
	{
		If (LEqual (^^^GFX0.P3MO, 0x03))
		{
			DOFF ()
		}
	}
[…]
Method (DOFF, 0, NotSerialized)
	{
		If (LNotEqual (MFTM, One))
		{
			_OFF ()
			If (LEqual (CTBO, One))
			{
				OBCP (Zero)
			}
		}

		SGPL (0x23, One, Zero)
		Store (0x03, ^^^GFX0._PSC)
		Store (One, ^^^GFX0.DGPS)
		Store (0x02, ^^^GFX0.P3MO)
	}

Congratulations, you got a better battery life, a cooler laptop, and the blue led back.

 

Result:

img20111030144315.th.jpg

 

(yes, michyprima is my 2nd nickname)

 

NoNvidia.kext.zip

 

Please report success or problems.

Enjoy

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
Congratulations, you got a better battery life, a cooler laptop, and the blue led back.

 

Result:

img20111030144315.th.jpg

 

Please report success or problems.

Enjoy

 

Which guide/method did you use to install Lion on that laptop. I have the exact same model but when I try to install Lion my mouse and keyboard do not work and the graphics are messed up. When I say messed up I mean shifted to the right, snowy effect with a pink tinge. Cannot do nothing. I used Maldon's guide on here but no luck. Any advice would be greatly appreciated.

 

Thanks

Link to comment
Share on other sites

Hello! Nice work man, I've used this kext here and is working perfectly after some changes in the plist.

 

Now I am trying to make the inverse thing, like the bumblebee guys.

 

 

 

Can you put a link to the source here? so I can make the nvidia working, and I will report back here and put the code back to you and all who want this on their systems.

 

 

 

Thank you.

Link to comment
Share on other sites

Hi IDPPioneer,

 

yeah the reverse would be really nice but the first big step for me would be to be able to switch off my Nvidia.

 

I have found the Acpi on/off calls. I tried to hardcode the NVOP Call in my _DSM but it doesn't seem to be called. Could you perhaps help me out to get this Disabler working ?

 

Here is the link : https://lists.launchpad.net/hybrid-graphics...x/msg00663.html

Link to comment
Share on other sites

Good work mate. But no success either. NoNvidia.kext is loaded succesfully but it breaks boot. This is wierd because i have asus n53sn. Only differences between your pc and mine is that i have nvidia geforce gt550m 2gb. I also added gt550m's device id which is 0x0df610de. And i would like to ask which kexts you use for battery manager and touchpad?.

Link to comment
Share on other sites

hi morbid angel the only thing you need to do is to rename your ACPI ON/OFF calls that you have found to DON and DOFF and of course to adjust the id of your device in the plist file.

 

Example:

Method (_ON, 0, Serialized) this you rename to: Method (DON, 0, Serialized) and

Method (_OFF, 0, Serialized) this you rename to: Method (DOFF, 0, Serialized)

 

it is so easy as you've seen here.

Link to comment
Share on other sites

  • 11 months later...

Hi! I have the same N53sv, I used your DSDT and my system boot whit garbage on all the screen but the os is functional because I can turn up or down the volume, I can sleep and shut down.

 

I trying to patch my own DSDT but the DOFF function is not called.

 

Ps: the only way I can boot with correct video is deleting the intelgraphicssnbfb.kext

 

What can I do?

 

Thanks for reading

Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...
  • 7 months later...
 Share

×
×
  • Create New...