Bumblebee and NVidia Geforce GT540M on Ubuntu 12.04
Posted by aspersieman on 2012-04-03
If you have an NVidia Optimus enabled graphics card you undoubtedly have had trouble getting it to work on Linux. About 5 months ago I purchased a new notebook, the Asus Aspire 4750G that comes with NVidia Optimus graphics card. It didn't work initially - but I did get it to work eventually. Happy times!
Optimus Prime. He loves to truck.
Optimus enabled notebooks have two graphics cards, a resource light Intel and a more intense NVidia card. The idea is that graphics intense programs will only use the heavier NVidia card when needed - the rest of the time the Intel card will be used. This is intended to conserve resources (battery life etc.).
This all sounds great, but what I didn't know is that NVidia said that for Optimus cards they "[H]ave no plans to support Optimus on Linux at this time" which I only found out after installing the graphics drivers on Linux Mint and getting an excellent black screen (instead of a working desktop). I have since tried many different suggestions and searched Google far and wide, but I haven't managed to get the NVidia card to work. The Intel card works fine, however, so I've been using that.
After some distro hopping I settled on Ubuntu 12.04, which is awesome. I have been monitoring some of the communities that are trying to get NVidia optimus to work on Linux. The project with the most promise seems to be (pun not intended) the Bumblebee project. The great thing about them is that they have a PPA which is great if your using Ubuntu.
I proceeded to follow the instructions to install Bumblebee here. It is quite easy, all that you need to do is run the following in a terminal:
sudo add-apt-repository ppa:bumblebee/stable
Then, if you're on Ubuntu 11.04 and older, you would probably need newer NVidia drivers, so run this:
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
Then run the following:
sudo apt-get update sudo apt-get install bumblebee bumblebee-nvidia
sudo usermod -a -G bumblebee $USER sudo apt-get install virtualgl-libs:i386 libgl1-mesa-glx:i386 libc6:i386
UPDATE (2012-05-08): The last two commands are no longer needed as of April 30th 2012, as an update to Bumblebee has removed the need for this. Thanks to Arkaprovo for asking about this.
Then you need to reboot. If you want to run an application (like a game or something) you need to run it from the command line preceded with "optirun". So if I want to run the game Supertuxcart using my NVidia graphics card I would need to run:
Unfortunately when I tried this initially with Ubuntu 12.04 it didn't work. I received an error (I forget what it was now) to do with not finding the correct X display.
After some more Googling I realised the reason it wasn't working was probably due to the fact that Bumblebee is built for Ubuntu 11.10 and the latest Xorg and NVidia drivers on Ubuntu 12.04 beta (that I am using) has quite a few differences. I found that there were some people who had had success in using Bumblebee on Ubuntu 12.04 with similar hardware but using the latest Xorg PPA. As I didn't want to have to deal with another potential black screen scenario, I decided to wait until they've fixed it in a more stable way.
So after a couple of weeks of (happily) using Ubuntu 12.04, I noticed some updates to the Kernel and then to the X libraries. I thought I might give Bumblebee a shot to see if it works, so I ran :
To my surprise, it worked!
Since then I have been installing a whole lot of games I forgot I had, because I couldn't really run them. I am not really a gamer, but I was so happy I just had to try out my notebook as a "whole" (and not the notebook minus graphics card I had before).
UPDATE 2012-04-08: WebUp8 posted a way to get Bumblebee working on a Dell XPS L702X with Ubuntu 12.04 here.
Have Your Say
Comments support markdown syntax.
NOTE: COMMENTS HAVE BEEN TEMPORARILY DISABLED.
NOTE: Comments are moderated and will be shown only once it's been approved by the administrator.