# acpi_call Nvidia Optimus



## clod89 (Aug 29, 2012)

Hello everyone I'm new to FreeBSD and really want to run it on my NVidia optiums laptop so I took 9.1 RC1 for a spin and tried playing around with the sysutils/acpi_call port and the ACPI method I used under Linux to turn off my Nvidia video card. The first time I tried it just worked. It output 0, I heard the fans spin down and `apm` reported a battery increase of more than one hour (I guess there are better ways to tell if it was off but I didn't know any. After that I could not turn it back on but rebooting in Linux gave me the certainty that it was off (since on my laptop if it is rebooted,and not powered off and on again, with the NVidia card off the  card is not re-initialized by the BIOS and basically disappears and doesn't get listed by `lspci`). Anyway since then I haven't been able to power the NVidia card off again and I always get the Unknown object type '0' error. 
That's it, I don't know if someone can help, just wanted to share in the hope that it can be useful to someone with more skills and experience. 
Claudio


----------



## tingo (Aug 29, 2012)

I didn't know we had a acpi_call port (it's sysutils/acpi_call) - thanks for telling us.
Your post is unclear; is the problem that you can't turn on the nVidia card at all, not even in Linux?
Under FreeBSD, what is the difference in the output of `# pciconf -lv` before and after you turn off the card?


----------



## clod89 (Aug 29, 2012)

There's no problem, sorry if it was unclear but I wrote it late at night. I just wanted to inform those that have an Optimus Nvidia laptop that it looks like it's possible to turn it off using the sysutils/acpi_call port, but I succeeded only on my first attempt. Later attempts have always failed for some reason with the Unknown object type '0' error.  Anyway I did do a `pciconf -lv` to see if there were any changes before and after issuing the command but the output stayed unchanged. I'm sure it had been turned off on my first attempt only because of the battery life sudden increase and the fact that when I rebooted (which is different than turning the PC on and off from a BIOS perspective) into Linux `lspci` was not listing the card any more and this in my experience only happens when the laptop is rebooted with the Nvidia card off. I think it would be useful to investigate this since most laptops these days come with an Optimus Nvidia card and having it always on under FreeBSD means a drastically shortened battery life and much higher temperatures.


----------



## xmj (Apr 5, 2014)

For posteriority and as this post frequently shows up on Google results for 'acpi_call freebsd nvidia optimus' or the likes, I ported 
https://github.com/mkottman/acpi_call/blob/master/examples/turn_off_gpu.sh

to FreeBSD and put it to http://xmj.me/freebsd/turn_off_gpu.sh.

You'll need the acpi_call kernel module from sysutils/acpi_call.
Once the script is run it probes all known ACPI oids for NVIDIA Optimus / AMD+ATI GPU chipsets, and disables them.

This resulted on my machine in a power decrease from about 18W down to 11W, along with the resulting battery life expectency increase.


----------



## Andrew Hacking (Feb 13, 2015)

The above script successfully turns off the NVIDIA Optimus card in my ASUS R501VZ / N56V* laptop saving some 8258mW.

I refactored into a /usr/local drop-in with rc.d script at: https://github.com/ahacking/freebsd-gpu-off.


----------



## litk (Dec 6, 2017)

I have nvidia ION, and I can't turn it off. I tried this:


> I refactored into a /usr/local drop-in with rc.d script at: https://github.com/ahacking/freebsd-gpu-off.


and it doesn't work for me. I get the message

```
Trying "\_SB.PCI0.P0P4.DGPU.DOFF"
Call succedded
```
and it is still running.


----------



## SirDice (Dec 6, 2017)

ION and Optimus are two entirely different things.

https://en.wikipedia.org/wiki/Nvidia_Ion
https://en.wikipedia.org/wiki/Nvidia_Optimus


----------



## litk (Dec 6, 2017)

But there is nvidia optimus technology software for Windows 7 shipped with this netbook. Disabling this crap with http://bumblebee-project.org/ works on Linux.


----------



## SirDice (Dec 6, 2017)

What is the make and model of the netbook?


----------



## litk (Dec 6, 2017)

Asus EEEPC 1015pn. On Linux I can disable ION just with this command:

```
echo "\_SB.PCI0.P0P4.DGPU.DOFF" > /proc/acpi/call
```
In FreeBSD this:

```
Trying "\_SB.PCI0.P0P4.DGPU.DOFF"
Call succedded
```
and nothing happens.


----------



## SirDice (Dec 6, 2017)

Ah. This uses a "standard" Intel CPU/GPU and added a separate NVidia ION2 chip to that. The original ION was an NVidia GPU and Intel CPU integrated on the same chip, it had no Intel GPU (so there's nothing to switch off). 

Looking through the ArchWiki page I see you need to do 2 or 3 steps in order to switch it off. None of them seem to be included with the script that's posted here.


----------



## litk (Dec 6, 2017)

So, I think I can throw this computer out of the window, now.


----------



## SirDice (Dec 6, 2017)

Or you can try and follow the ArchWiki calls and translate that to your own script.


----------



## litk (Dec 6, 2017)

I am not so strong to do that.


----------



## SirDice (Dec 7, 2017)

Well, it's a good incentive to learn a new skill


----------

