Monthly Archives: May 2012

Disable the NVIDIA discrete graphic card in a NVIDIA Optimus laptop

I got a new laptop for work. I’m using Linux and not playing games on the pengiun OS so the NVIDIA card is just wasting the battery and making the machine uncomfortably hot. NVIDIA provides official support in MS Windows for turning off the card but not Linux OS. This post shows how to turn off the NVIDIA card in Linux using a kernel module developed by some super power programmer out there.

1. Download the latest module source code from “https://github.com/Bumblebee-Project/bbswitch/downloads“.
2. Unpack the archive file.

# gunzip -c bbswitch-x.y.z.tar.gz | tar xf -

3. Make sure you have the DKMS package install.

# aptitude install dkms

4. Change into the source directory.

# cd bbswitch-x.y.z

5. Compile and install the module

# make -f Makefile.dkms

6. TO uninstall the module

# make -f Makefile.dkms uninstall

7. Activate the module

# modprobe bbswitch

To get the status of the NVIDIA graphic card.

# cat /proc/acpi/bbswitch
0000:01:00.0 ON
or
0000:01:00.0 OFF

To turn the card off and on

# tee /proc/acpi/bbswitch <<OFF
# tee /proc/acpi/bbswitch <<ON
# tee /proc/acpi/bbswitch <<<OFF
# tee /proc/acpi/bbswitch <<<ON

If the card stays “ON” after issuing the “OFF” command, probably the driver has not been unloaded.

# dmesg |tail -1
bbswitch: device 0000:01:00.0 is in use by driver 'nouveau', refusing OFF

To unload the driver

# modprobe -r nouveau

To auto-disable the card on boot

# echo "blacklist nouveau" >> /etc/modprobe.d/blacklist
# echo “blacklist nouveau” >> /etc/modprobe.d/blacklist.conf (some Ubuntu users commented below, saying this works for them)
# echo "bbswitch load_state=0" >> /etc/modules
# update-initramfs -u

See the project website for more info regarding the module: https://github.com/Bumblebee-Project/bbswitch

Updated [2014-01-21]:
I notice some people were having problem with unloading the driver (FATAL: Module nouveau is in use).  Fear not, just proceed with the next step, “auto-disable card on boot” and reboot your machine.