There’s a breed of laptop that comes with Nvidia Optimus technology. Even the gaming beast ‘Alienware Mx series’ has got Optimus. I, for one, happen to have a Dell XPS 15 L502X laptop that also comes with Optimus.
If you are running linux or planning to run linux on any of those, you won’t be able to make your Nvidia card work in the conventional way i.e. either by installing Nvidia drivers from repositories or by manually installing it after downloading the drivers from Nvidia’s website. Lately, I’ve helped a lot of friends who had Optimus, some of them being new to linux, didn’t know what to do. So, I thought I might as well write a blog entry on it.
For those of you who don’t know what Optimus is and how it works, let me quickly cover it.
What is Optimus?
In a nutshell, Nvidia Optimus technology automatically decides, depending on the application, whether the system has to use Nvidia GPU or the integrated graphics card. This way the user gets high performance by using the independent Nvidia GPU while a longer battery life can be obtained by using the integrated graphics card(IGP) without having to manually change settings.
Here is a short video that describes what Optimus has in store for you.
How Optimus works?
During High performance tasks: Integrated graphics card + GPU works. The GPU is enabled and handles all the high performance tasks, while the integrated graphics card is responsible for display.
During Low performance tasks:Only integrated graphics card works. In this mode, the integrated graphics card is responsible for both the tasks and the display. GPU is completely off.
Basically, with Optimus, the integrated graphics card is working at all times, the GPU is enabled or disabled, depending on the application.The problem arises for linux users due to the fact that there is no way to use only the GPU, and there is no way to disable the integrated graphics card. It is impossible, either by software or by hardware, to actually switch between the two cards.
Nvidia supports Optimus only for Windows and has no intention of supporting it for linux.
How to check if your laptop has Optimus or not?
You can check your products catalogue whether your laptap has got Optimus or not. If it is not explicitly mentioned, type
lspci | grep VGA in a terminal, if you have Optimus you’ll get output somewhat same as below:
If you are not planning on gaming, the integrated graphics card should work fine for you. One of the major problem is that you will get a lot less battery backup.
Now that you know that you have Optimus, these are your options:
First thing that you should do is to check in your BIOS setting if you’ve an option for switching/disabling the cards.( Laptops with this option are a rarity)
If you do have an option, that’s all you gotta do. But, if you don’t, your only solution is Bumblebee.
TIP:If you have Optimus then do NOT install restricted drivers, installing restricted drivers will mess up your X window system and you might not be able to boot back into GUI.
If you have installed restricted drivers, boot into the recovery mode and deactivate the nvidia driver. Reboot and you’ll get your GUI back.
What is Bumblebee?
Basically, Bumblebee is a project to support Optimus in linux. It tries to mimic the Optimus technology behavior.
Right now, it is available in the repositories of only Arch, Debian, Gentoo,Mandriva and Ubuntu. For all other distributions, you have to install it manually from source.
How to install?
To install on Ubuntu/Ubuntu-based systems (for installations on other distributions,I’ve posted links at the end of this post) ,open your terminal and enter the commands below:
1. Add the Bumblebee PPA to your repository
sudo add-apt-repository ppa:bumblebee/stable
# If you are on Ubuntu 11.04 or older and want newer drivers (recommended) than the ones available in the official repositories, run:
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
2. Install Bumblebee using the proprietary nvidia driver:
sudo apt-get install bumblebee bumblebee-nvidia
3. Add yourself to the group bumblebee
sudo usermod -a -G bumblebee $USER (no need to change $USER, this variable is set to your username)
5. If you are planning to run 32-bit programs like Wine and using Ubuntu 11.10 Oneiric or later, install 32-bit libraries:
sudo apt-get install virtualgl-libs:i386 libgl1-mesa-glx:i386 libc6:i386
How to use it:
To run any application with the Nvidia card run in the terminal:
$ optirun [options] <application> [application-parameters]
$ optirun glxspheres
Here are snapshots of running glxspheres without and with optirun. Notice the significant increase in the FPS when I run it with optirun.
With Bumblebee 3.0, codename tumbleweed, automatic power management is provided. Since I started using Bumblebee, my battery backup is increased significantly. From 1:30-2 hours,before I installed Bumblebee, to almost 5 hours now.
A feature that many people, including me, are waiting for is the HDMI output. I’m pretty sure in a couple of months it’ll be up and kicking.
One final thing, running
nvidia-settings won’t work, it will give you an error:
You have to use
optirun nvidia-settings -c :8 which will give you the output you are looking for 😉
If you are an arch linux user, go here ==> https://wiki.archlinux.org/index.php/Bumblebee
If you are using debian, go here ==> http://wiki.debian.org/Bumblebee
If you are using gentoo, go here ==> http://gpo.zugaina.org/x11-misc/bumblebee
If you are using Mandriva, go here ==> http://wiki.mandriva.com/en/Bumblebee
For others, to manually install from source, go here ==> https://github.com/Bumblebee-Project/Bumblebee/wiki/Install-and-usage
That’s all guys, this is all the information, that I’ve collected after spending days on the internet.