Monday, April 22, 2013

How To Make NVIDIA’s Optimus Work on Linux

image
Many new laptops come with NVIDIA’s Optimus technology – the laptop includes both a discrete NVIDIA GPU for gaming power and an onboard Intel GPU for power savings. The notebook switches between the two when necessary.
However, this isn’t yet well-supported on Linux. Linus Torvalds had some choice words for NVIDIA regarding Optimus not working on Linux, and NVIDIA is now currently working on official support.
However, if you have a laptop with Optimus support, you don’t have to wait for NVIDIA — you can use the Bumblebee project’s solution to enable Optimus on Linux today.
Image Credit: Jemimus on Flickr

Installing Bumblebee

We’ll be going over installation instructions for Ubuntu here. Installation on many other Linux distributions is fairly simple — you can find instructions on the Bumblee project’s website. The page includes instructions for Fedora, Debian, Arch, Mandriva, and Gentoo.
First, you’ll have to run the following command in a terminal window to add the Bumblebee project’s software repository to your Ubuntu system:
sudo add-apt-repository ppa:bumblebee/stable

Next, run the following command to download updated information about available packages:
sudo apt-get update
Run the following command to install Optimus support:
sudo apt-get install bumblebee bumblebee-nvidia

Restart your computer or log out and log back in after running this command.

Switching Between Integrated Graphics and NVIDIA

Your laptop will now use its integrated Intel graphics most of the time, cutting off power to the NVIDIA graphics card and improving your battery life.
When you want to run a program that takes advantage of your NVIDIA graphics, you’ll need to run it with the optirun command.
For example, if you want to run a game named game with NVIDIA graphics support, you’d run the following command in the terminal:
optirun game
While the game is running with the optirun command, the NVIDIA graphics will be enabled. When the game quits and optirun is no longer running, your notebook will switch to integrated graphics.
You should only use this command with games and other applications that require 3D graphics acceleration — don’t use it with an application that runs most of the time, such as your window manager, or you won’t see any power savings because the NVIDIA graphics will be in-use all of the time.
To test whether it’s working, you can try using the glxspheres graphics demo. First, run it without optirun:
glxspheres
Next, run glxspheres with optirun:
optirun glxspheres
You should see higher FPS with the second command, as it’s using your NVIDIA graphics.


NVIDIA will ideally bring official support that works out-of-the-box for everyone in the future, but Bumblebee is the best we can do for now.

No comments:

Post a Comment