Jump to content

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


  • Please log in to reply
19 replies to this topic

#1
hk93

hk93

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
  • Gender:Male
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:
Posted Image

(yes, michyprima is my 2nd nickname)

Attached File  NoNvidia.kext.zip   9.36KB   642 downloads

Please report success or problems.
Enjoy

#2
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 6,047 posts
  • Gender:Male
  • Location:Brazil
Great work, thanks for sharing!

;)

#3
hk93

hk93

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
  • Gender:Male
welcome.
I just gave back for everything I learned on here ;)

#4
Onixs

Onixs

    Since 2007

  • Members
  • PipPipPipPipPipPipPip
  • 707 posts
  • Gender:Male
can you compile both arch please

#5
hk93

hk93

    InsanelyMac Protégé

  • Members
  • Pip
  • 23 posts
  • Gender:Male
sure
here ya go but i didn't test it in 32 bit cause my system doesn't want to boot into 32 bit mode without removing AICPUPM.
Attached File  NoNvidia.kext.zip   17.95KB   95 downloads

#6
hisho

hisho

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts
i can't this device called GFX0 or DGPU , so what i can do ?

#7
darren cox

darren cox

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 107 posts
Any further development on this?

Was wondering if perhaps this might help with an issue in the l502x thread we're (Well Doix is) trying to enable the Nvidia card (525m or 540m) and thought maybe the reverse of this might help?

Dunno just a thought - last thing on my list for a PERFECT hackintosh lol

#8
markIIdp

markIIdp

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts
I've installed the kext but the battery's life seems the same, I must do anithing else?

#9
myska

myska

    InsanelyMac Protégé

  • Members
  • PipPip
  • 72 posts
  • Gender:Female
Thanks for your work. It could be a good way to solve my freezing issues due to optimus technology. However as I have no DOFF or GPUOFF in my dsdt, I don't know how to edit it. Could you post your dsdt?

#10
jfisher007

jfisher007

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts

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

Result:
Posted Image

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

#11
morbidangel

morbidangel

    InsanelyMac Protégé

  • Members
  • Pip
  • 30 posts
Sorry no success. Im in the same boat as myska.

The DSDT from my Optimus / Dell L702x has no DOFF, GPUOFF, LCDD and _PS3.

I have the HD3000 as GFX0 and Nvidia as PEGP but dont get further

EDIT: I added my DSDT and hope that someone will help me with that or a hint what I have to do.
Attached File  DSDT.aml.zip   15.2KB   36 downloads

#12
IDDPioneer

IDDPioneer

    InsanelyMac Protégé

  • Members
  • PipPip
  • 66 posts
  • Gender:Male
  • Location:Brazil
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.

#13
morbidangel

morbidangel

    InsanelyMac Protégé

  • Members
  • Pip
  • 30 posts
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.launch...x/msg00663.html

#14
fyodor123

fyodor123

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
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?.

#15
IDDPioneer

IDDPioneer

    InsanelyMac Protégé

  • Members
  • PipPip
  • 66 posts
  • Gender:Male
  • Location:Brazil
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.

#16
Sicther

Sicther

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts
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

#17
beta992

beta992

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 338 posts
  • Gender:Male
To find out what method is working for you, you could try Bumblebee on Ubuntu.
The only thing you need to find out what method is used for your notebook.

#18
yc_richard

yc_richard

    InsanelyMac Protégé

  • Members
  • Pip
  • 4 posts
Hi, I'm using 10.8.2. and I get error loading the kext

/System/Library/Extensions/NoNvidia.kext - no compatible dependency found for com.apple.driver.AppleACPIPlatform.

Can you share your code, or update the dependency plz. thx!

#19
P3TR05

P3TR05

    InsanelyMac Protégé

  • Members
  • Pip
  • 5 posts
  • Gender:Male
  • Location:Czech Republic
Thanks for guide, finaly blue led without kext.

//Asus N53JN 10.8.2


Posted Image

#20
futurexiong

futurexiong

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts

Not work for my N53SN in Mavericks, any suggestions?







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy