Exuding awesomage...
   
Subscribe to the exclusive RSS feedGet more of my Pleph awesomeness on Twitter!

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 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:

optirun supertuxcart

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 :

optirun glxgears

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.


Categories nvidia, ubuntu.
Tags: ubuntu, gt540m, drivers, nvidia, optimus, asus, aspire, 4750, graphics card, linux, bumblebee

Comments

Posted by Robin on 2013-01-20 16:16:18

Thanks for the post man! I had the same problem where it would show some error when trying to run optirun after installing bumblebee. Like you did, I simply updated my system from Ubuntu Software Update, which also included some updates to Xorg and other display related stuff. After the update and reboot, optirun magically started to work, just like you said!



Posted by jespestana on 2013-01-13 13:47:51

Thanks! This worked for me!



Posted by aspersieman on 2012-12-19 01:40:27

Hi there @nikola

You would only need to add the x-updates PPA if you are running Ubuntu 11.04 or older. Versions after 11.04, don't need this PPA.

I'm glad you got it to work though.



Posted by nikola on 2012-12-18 11:21:44

Thanks!

I had problem with Draftsight not displaying graphics area due to dual card laptop configuration, I followed ur instructions for installing bumblebee, and now I run DS with optirun draftsight and it works as a charm. One remark thou: sudo add-apt-repository ppa:ubuntu-x-swat/x-updates didnot work for me, but bumblebee installed ok without it.



Posted by aspersieman on 2012-11-21 07:56:03

Hey @kaladhar

If you have installed the Bumblebee package using the PPA as described in the post above you will still need to use optirun to run the game.

I suggest you use PlayOnLinux to make a short cut on your desktop for the game (Need for Speed). Then follow this post to see how to run your game using optirun so that it uses your graphics card.

HTH

Regards,

aspersieman



Posted by kaladhar on 2012-11-19 18:08:55

i'm very new to Linux. i'm running linux mint 13 Maya 64 bit edition in my rv518 laptop. it has nvidia geforce gt520m with cuda gpu. i installed playonlinux to play nfs most wanted. I'm running the game but the graphics are very bad. i'm getting the game in gray colour. i think installing the graphic card drivers could improve the game performence . i installed nvidia graphic drivers. i don't know how to use it. i installed bumblebee and tried to run the game and i'm getting the below error

[ 1005.603800] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.

[ 1005.603913] [ERROR]Could not connect to bumblebee daemon - is it running?



Posted by aspersieman on 2012-11-10 11:21:31

Hey @Carrol.E

I can't find any problems regarding images loading. If you can give me an example or be a little more specific I would like to resolve it (if it is indeed a problem with this blog)



Posted by Carrol.E on 2012-11-10 10:43:06

Hmm is anyone else having problems with the images on this phorum loading? I'm trying to find out if its a problem on my end or if it's the phorum. Any responses would be greatly appreciated. Wonderful!



Posted by Jim Jones on 2012-11-07 10:50:06

Thanks to your article I managed to put my Java code for Nasa Word Wind to run.

Thank you!

Ubuntu 12.04 x64 NVIDIA GT 540m



Posted by Kathi.Q on 2012-11-06 04:38:58

I envy your capability to publish wonderful article on pleph.appspot.com simply wanted to say I like this ! Great!



Posted by Carita.M on 2012-11-05 10:51:09

magnificent submit, very informative. I'm wondering why the opposite experts of this sector don't notice this. You should continue your writing. I'm sure, pleph.appspot.com have a huge readers' base already! Wonderful!



Posted by aspersieman on 2012-10-31 07:39:30

@Tonette02

I wouldn't say I know a lot about this, but I do like using Ubuntu/Debian based operating systems. Since I bought a new notebook with an Optimus graphics card, and found they didn't work with Ubuntu (12.04) I made a mission of finding as much info on it as I can.

I follow many technology feeds/sites, including those dedicated to Bumblebee and Optimus, and therefore know a little bit about these things.

I hoped that making this post would save other Ubuntu-ers the trouble of searching and reading as much as I had to initially. Although, now a quick Google search should point anyone to the new-ish Bumblebee Website with all the information they would need.

Thanks for reading.

aspersieman



Posted by Tonette02 on 2012-10-30 04:08:06

How could it be that you know really a lot great news connecting with this topic on pleph.appspot.com? regards



Posted by aspersieman on 2012-10-22 10:13:26

Thanks cmd-h! Bumblebee seems to be getting better and better.



Posted by cmd-h on 2012-10-20 19:49:58

Ubuntu 12.04 with the new Bumblebee 3.0 works like a charm. Simply do:

sudo add-apt-repository ppa:bumblebee/stable
sudo apt-get update
sudo apt-get install bumblebee bumblebee-nvidia

Restart and test it:

optirun glxspheres

I've recently set it up on Acer Aspire 5750ZG Everything works as expected with lower temperature and fan noise. Battery life almost doubled.



Posted by davide on 2012-10-07 12:51:51

Do not work for me i have a bug /var/cache/apt/archives/bumblebee_3.0.1-3~preciseppa1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)



Posted by Hamza on 2012-10-03 13:16:15

thank you too much that was helpful

what a great work .



Posted by aspersieman on 2012-08-30 04:46:32

Dear Still can't get it to work :(

Did you follow the instructions from here?

If you have and it's still not working, one would need a bit more information to help you out. Could you tell me:

  • What graphics card you have?
  • What Linux distribution you are running
  • What you are trying to run using Optirun and what commands you have tried to do it


Posted by Still can't get it to work :( on 2012-08-26 18:16:46

[ 273.667558] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver



Posted by aspersieman on 2012-06-23 12:39:53

Hey nenopera

Yeah, Linus being Linus is entertaining as ever.

It does seem like NVidia are doing a bit more work for us lowly Linux-ers lately.

Do you have any links about NVidia drivers working automatically with Optimus cards? I'd love to read more about that.

Thanks for commenting :)



Posted by nenopera on 2012-06-21 03:03:17

Thanks a lot!

Yesterday I was looking the "fuck you NVidia" of Linus Torvalds without knowing It was something that really affects me.

Nowadays, seems like NVidia card is switched on automaticaly when needed, so bumblebee guys, the work is done!



Posted by Onesimo on 2012-06-13 04:59:35

Thanks! It works at firts time

Grandioso Funciono a la Primera

Excelente.. Gracias



Posted by aspersieman on 2012-05-15 13:13:56

@vipeR-XPS

Awesome! I'm glad you got it to work.

Happy optimus-ing!



Posted by vipeR-XPS on 2012-05-15 13:08:32

Yes, I'm working behind a proxy. I checked out the pages you linked but the problem remains.But your above update:

UPDATE 2012-04-08: WebUp8 posted a way to get Bumblebee working on a Dell XPS L702X with Ubuntu 12.04 here.

helped. I used the following commands and they seem to work.

sudo apt-get purge bumblebee sudo apt-get install bumblebee

The heating is less and battery backup is fine too. optirun works too but there's a certain amount of delay. All done without adding the repositories. Dell XPS15-L502X



Posted by aspersieman on 2012-05-14 07:51:29

Hey vipeR-XPS!

Are you working behind a proxy? It seems some people are having problems adding PPAs behind proxies.

Have at this ask ubuntu question for more information on how to troubleshoot the problem.

Thanks for your comment.



Posted by vipeR-XPS on 2012-05-14 00:44:28

The command

sudo add-apt-repository ppa:bumblebee/stable

doesn't seem to work on my system. I tried it in 10.10 and 12.04 both. There's no activity on the terminal after that and later after 5 minutes or so I get the following message

Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 125, in ppa_info = get_ppa_info_from_lp(user, ppa_name) File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp curl.perform() pycurl.error: (7, "couldn't connect to host")

I have Dell XPS L502X, nvidia 540m optimus grapphics and intel HD 3000 graphics. In 12.04 I tried this after a fresh install and doing all the required updates. Please help



Posted by aspersieman on 2012-05-08 12:23:57

Hi there Arkaprovo

I'm glad to hear that it's working!

The commands mean the following:

  • "sudo usermod -a -G bumblebee $USER": This is a command that was required to add your current user to the "bumblebee" Unix/Linux user security group. As of version 3.0-2, which was released on April 30th, this is not necessary anymore for new installations. I will update the post accordingly.
  • "sudo apt-get install virtualgl-libs:i386 libgl1-mesa-glx:i386 libc6:i386": This command installs additional libraries to ensure better compatibility with 32bit software. The recent update I mentioned has also removed the need for this command as it is installed when Bumble is installed.

Thanks for your feedback and happy Linux-ing :)



Posted by Arkaprovo on 2012-05-08 02:34:06

hello aspersieman, i have successfully installed Bumblebee on ubuntu 12.04 64 bit with the help of your instructions(Thank you very much*) and its working perfectly but i have skipped this two lines "sudo usermod -a -G bumblebee $USER" "sudo apt-get install virtualgl-libs:i386 libgl1-mesa-glx:i386 libc6:i386"

please tell me whats the use of above lines and should i use it? as i mentioned Bumblebee is performing well on my laptop (asus k53 sv 48-51 deg C cpu temp ), without using two commands listed above.

Thanks a lot for the awesome post.



Posted by aspersieman on 2012-05-07 01:58:21

Hey there Arkaprovo.

Yes it certainly does work. At least it does so for me. I should have mentioned this in my post, so my apologies :), but I am indeed running Ubuntu 12.04 64bit.

For me it seems to work fine so, try it out! Let us know if you have any issues crop up, I'd try my best to help. Or alternatively try and troubleshoot any problems by checking the Bumblebee site.

Happy (bumble)bee keeping!



Posted by Arkaprovo on 2012-05-07 01:11:41

hello does it work for ubuntu 12.04 64 bit?



Posted by aspersieman@gmail.com on 2012-04-29 03:37:26

Hi x3qt0r!

I'm glad it's working for you. I would definitely recommend upgrading from 11.10 in most cases.

Ubuntu is definitely (and finally) becoming awesomer!



Posted by x3qt0r on 2012-04-27 17:45:37

Hey! I went on an installed it anyway. A fresh install, since my 11.10 was virtually unused due to the heating problem. 11.10 gave a little over 2 hours of battery life. 12.04 gives 5 hours. Heating problem that I faced on 11.10 is almost eliminated in 12.04 (Thanks to Bumblebee project and the newer linux kernel).

Thanks for your wonderful guide. Also does this bumblebee "switches off" my graphics card, and only switches it on when I give the optirun <application> command? I had to use acpi_call(just copy pasted instruction from some site) to switch the graphics card off while back on 11.10 The battery life has increased and heat has almost eliminated in 12.04 using bumblebee and without acpi_call. Also the battery life time is shown to change from various values. Like it shows 4 hours for some time then comes down to 3 hours 20 minutes, goes back to 4, sometimes increases to 4 hours 40 minutes. I wonder whats going on. I shall be fiddling with the new install for a while. Also I upgraded one of the computer which had 11.10, and it went pretty smoothly, no glitches whatsoever. Ubuntu is becoming awesomer and awesomer. =) Keep up your good work, its immensely helpful.



Posted by aspersieman on 2012-04-27 13:55:14

Hi x3qt0r!

Ubuntu 12.04 has added significant improvements to battery life and has many updates to the kernel to improve heating problems. This was one of the areas on which the Ubuntu team focused on a lot during development. I don't know if your battery life and heating performance will be similar to that of Windows 7, but it should be noticeably better on Ubuntu 12.04 than prior versions.

I have been running the Ubuntu 12.04 for a while from one of the betas and can definitely confirm a definite improvement in these areas.

As to whether your should do an upgrade or fresh install, I would recommend trying an upgrade. I have heard many good things from people who have upgraded and said it was rather a smooth experience. My brother for one (a relative n00b to computers and Linux in general) did it on his own, by clicking on the upgrade button in the updater, and it was incredibly smooth and easy.

Just remember to backup all your stuff before you do the upgrade. If it doesn't work, you can always just do the fresh install - which is not as easy but quite straight forward.

Also remember to update your PPA's (the Bumblebee one for example) to the new Precise (12.04) repositories. YPPA works great for this.



Posted by x3qt0r on 2012-04-26 20:05:17

Hi, I am currently running ubuntu 11.10 on Alienware m11x r3, which comes with optimus technology. After trying all the bumblebee workarounds, I could get linux to work on this laptop. But shorter battery life and heating of the laptop are few of the problems. Now I want to update my system to 12.04. Should I do a fresh install or update it from 11.10 itself?



Posted by Person69 on 2012-04-03 13:26:48

Thanks! This works for me!



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.

loading...
loading...
loading...