A Noob’s Guide to Installing NVIDIA Optimus Driver in Ubuntu (Bumblebee)

When NVIDIA Optimus technology first seen the light, it wasn’t compatible with Linux. Many solutions to this problem appeared then. Using Bumblebee is one of them. In this post I am going to show you how to do that.

optimus

Optimus Technology

As you can see in the comments bellow, the steps in this tutorial don’t work in some cases. You can follow it at your own risk.

For people who don’t know what “NVIDIA Optimus” is, I advise you to read this: http://www.nvidia.com/object/optimus_technology.html. You also need to know that “Discrete GPU” means NVIDIA graphics card.

To make things clear, we’re going to install Bumblebee in addition to some other “important packages”, and we’re going to do this through some PPA repositories.

Firstly, add the repositories, then update:

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates

sudo add-apt-repository ppa:bumblebee/stable

sudo apt-get update

The first one contains NVIDIA drivers, the second one contains Bumblebee files.

Secondly, install the “important packages” :

sudo apt-get install linux-source linux-headers-generic

Finally, install Bumblebee and the NVIDIA driver:

sudo apt-get install bumblebee bumblebee-nvidia

That’s all; but you need to restart you machine before doing anything else. After that, you will be able to run programs using your discrete graphics card. For example, let’s run Firefox using the discrete GPU:

optirun firefox

Using the CLI is awesome, especially when the background is black and the text is green, if you see what I mean. However, some people don’t like it. Let’s add a graphical user interface (bumblebee-ui) then.

First, install git, because the bumblebee-ui project doesn’t have a Launchpad PPA

sudo apt-get install git

Then, create a folder named git and navigate into it:

mkdir git

cd git

Finally download bumblebee-ui files and install it:

git clone https://github.com/Bumblebee-Project/bumblebee-ui.git

cd bumblebee-ui

sudo ./INSTALL

That’s all. After restarting you computer, you will see a an indicator that allows you to to run programs using NVIDIA GPU without calling any command.

  • Toran

    Hi, I am at the git clone https://github.com/Bumblebee-Project/bumblebee-ui.git stage it asks for a username for ‘https://github.com’ I don’t have a github account, do I need one?

    • http://followthegeeks.com Mohamed Semlali

      Could you give the complete message that is shown when it asks you for the username.

      • Toran

        I have since made a github account and now it doesn’t ask for it but I think it said:
        Cloning into ‘bumblebee-ui’…
        Username for ‘https://github.com':
        Password:

        • Toran

          EDIT: [submitted username]@github.com Password:

        • http://followthegeeks.com Mohamed Semlali

          Sorry, I don’t see what may be causing this problem. If it helps, here’s the normal output:
          Cloning into ‘bumblebee-ui’…
          remote: Counting objects: 308, done.
          remote: Compressing objects: 100% (143/143), done.
          Receiving objects: 100% (308/308), 107.95 KiB | 44 KiB/s, done.
          Resolving deltas: 100% (179/179), done.
          remote: Total 308 (delta 179), reused 284 (delta 155)

          it “normally” doesn’t ask for identification since you only want to download files from that repository.

          • Toran

            Okay, thanks for you help. Since making a git hub account and going through their set-up I downloaded everything fine with out prompting for Username or password, although I can’t be sure if it was this that fixed it.

  • Aum11

    Thanks so much Mohamed. I have been trying for days to get nvidia gtx 670m working and Your guide did the trick, on Mint 15. Cheers

  • Aum11

    Thanks so much Mohamed. I have been trying for days to get nvidia gtx 670m working and Your guide did the trick, on Mint 15. Cheers

    • http://followthegeeks.com Mohamed Semlali

      you’re welcome ;)

  • Aum11

    Even though everything seems to be set up and I am using bumblebee to start VLC and others,I am confused by the fact that when I go into Driver Manager, it shows that there are no proprietary drivers in use? Why aren’t the Nvidia drivers shown?

    Cheers

    • http://followthegeeks.com Mohamed Semlali

      Driver Manager shows that because Ubuntu detects only the integrated GPU. and even though it detects NVIDIA GPU, as it was the cas when there was no Optimus Technology, if you install the driver without using Driver Manager, it will tell you that the detected drivers are not installed.

      • Aum11

        Thanks Mohamed that has cleared up my last concern.

        Cheers/

  • Constantin Florin Ciprian

    i can’t see the beautifull indicator..

    • http://followthegeeks.com Mohamed Semlali

      Did you restart your computer?

      • Razak Teridi

        yes i did, but i cannot see the indicator..i am using ubuntu 12.04 LTS, i hv tried many times to install the nvidia drivers but failed to. Yours bumblebee installation is very easy! KUdoss!! but then, i cannot find the indicator ..even after rebooting.

        • Helder

          I am having the same issue!

  • http://www.famesbond.com/ aditya menon

    Is there a way to set up Unity to run with optirun on startup?

  • Owl

    I came across this and don’t quite understand how it is used. I have an Acer Aspire Revo running Ubuntu, and it has nVidia graphics and the nVidia driver is installed. If I play video using XBMC or the MythTV frontend it plays smoothly, but if I try to play video in a browser window (from YouTube, for example) it drops frames like crazy, more like watching a fast slide show than a video. If I followed your procedure would it fix that issue, or is this just something specifically for laptops?

    By the way, your RSS feed button isn’t working – it tries to go to http://followthegeeks.com/a-noobs-guide-to-installing-nvidia-optimus-driver-in-ubuntu/%3C?php%20bloginfo(%27rss2_url%27);%20?%3E which apparently is not a valid link.

  • Deve

    “even though it’s said that 319.12 beta driver does the work, it still not stable”

    Why do you think it’s not stable? Did you try to run it?

    It’s a little hard to run on stable system at this moment – many packages in new versions – xrandr, xserver, kernel, also some -dev libraries if you compile it yourself. Then modified xorg.conf etc.

    But I use nvidia drivers with official optimus support on my laptop and I didn’t notice that it’s not stable.

    And with optimus from nvidia drivers you have:
    – better performance
    – vdpau
    – opengl > 2.0 (primus doesn’t support many extensions. virtualgl supports them, but it’s slow)

    • http://followthegeeks.com Mohamed Semlali

      I didn’t try it indeed, but most people who have said bad things about it. I’ll try it and remove that sentence if it works fine for me. Thank you.

  • Joe Wang

    didn’t its so easy to install optirun and bumblebee right now, thank you Samlali

    • http://followthegeeks.com Mohamed Semlali

      you’re welcome ;)

  • nyancica

    hi, i’m stuck at sudo apt-get install bumblebee bumblebee-nvidia…it sais bumblebee and bumblebee-nvidia packages cannot be found..can you help me ples?

    • http://followthegeeks.com Mohamed Semlali

      After adding the repository, did you run sudo apt-get update ?

  • Dudko

    It is not working for me :( After all, when I type “optirun firefox” it says:
    /usr/bin/vglrun: 303: exec: firefox: not found

    I tried it on many other programs, but still :(
    Help ?

    • http://followthegeeks.com Mohamed Semlali

      Try installing primus : “sudo apt-get install primus primus-libs-ia32:i386″ then execute firefox using primus instead of optirun.

      • Dudko

        I installed it, but when I type “primus firefox” it says:
        No command ‘primus’ found, did you mean:

        Command ‘primes’ from package ‘bsdgames’ (universe)

        primus: command not found

        • http://followthegeeks.com Mohamed Semlali

          Uh! I’m sorry, I gave you a wrong one. try “primusrun firefox”. Sorry.

          • Dudko

            /usr/bin/primusrun: line 52: exec: firefox: not found

            Doesn’t work. :(

          • http://followthegeeks.com Mohamed Semlali

            I’m sorry, I don’t see what may be causing this. There might be a solution, just keep on searching.

          • http://followthegeeks.com Mohamed Semlali

            I’m sorry, I don’t see what may be causing this. There might be a solution, just keep on searching.

          • Gustav

            This is from the Bumblebee install;
            “If you want to use primus, you need to install it and set Bridge=primus in bumblebee.conf or use optirun -b primus. You also need to install primus-libs-ia32 if you want to run 32-bit apps.”

            Hope it helps :)

  • Jan Lennart

    Hi, I am using the latest Xubuntu. Optirun works but I cannot see any indicator after installing the bb UI. I did of course do a restart.

    • http://followthegeeks.com Mohamed Semlali

      is an app named “Bumblebee Indicator” present in your applications menu? If it is there, try to launch it manually.

      • Lennart Pettkus

        If I launch Xfce session there is. I have been able to launch the indicator however I cannot configure any of the apps. I can check off any app but thats it and the next time i open the app settings the mark is gone.

        • http://followthegeeks.com Mohamed Semlali

          You need to click “Apply” button before closing, and the the checked apps that were yellow will be green, then you’ll see them in “Preferred Apps” for a quick access.

          • Lennart Pettkus

            That does not work, nor are any of them colored.

        • http://followthegeeks.com Mohamed Semlali

          This may be a bug that faces bumblebee-ui on Xfce. Can anyone confirm it?

  • bv

    thank you for the guide but I get this error message (just followed the steps after a fresh installation of ubuntu 12.04 on a asus 1215n):

    v@v-laptop:/usr/lib$ optirun glxgears
    [ 716.931111] [ERROR]Cannot access secondary GPU – error: [XORG] (EE) No devices detected.

    [ 716.931238] [ERROR]Aborting because fallback start is disabled.

    • http://followthegeeks.com Mohamed Semlali

      Many people are facing the same problem. I still don’t find any solution to it. I’m sorry.

  • Pingback: Nvidia GTX 765m Optimus tech on ubuntu 12.04 | WyldePlayground.netWyldePlayground.net -

  • Lukáš Hermann

    If you dont want bumblebee anymore, try this guide:

    http://tuxilero.blogspot.cz/2013/09/how-to-official-nvidia-drivers.html

  • Pingback: Nvidia GTX 765M with Optimus Unclamed | Ubuntu InfoUbuntu Info

  • Pingback: Nvidia GTX 765M with Optimus Unclamed | WyldePlayground.netWyldePlayground.net -

  • Pingback: Nvidia GTX 765m Optimus tech on 12.04 | Ubuntu InfoUbuntu Info

  • Pingback: Nvidia GTX 765m Optimus tech on 12.04 | WyldePlayground.netWyldePlayground.net -

  • Gyan

    How can I tell that bumblebee/optimus is actually working and what I am seeing being displayed is coming from the discrete gpu rather than from the Intel gpu?

    • http://followthegeeks.com Mohamed Semlali

      Bumblebee indicator will become yellow then.

  • Shams

    hi,

    i have install bb following the instruction , now i can not run my blender 2.69 , the message was blender closed unexpectadly

    please help

    • http://followthegeeks.com Mohamed Semlali

      I don’t think this is because bb isn’t working. Did you try with another program?

  • krish

    hi mohamed,i do same as you said but after restarting,there is nothing from which i can switch bw gpu’s ,pls help……..

    • http://followthegeeks.com Mohamed Semlali

      at the top right of the screen you’ll see a bee’s eyes icon, click it, chose configure apps then choose the apps you want to run using nVidia GPU then click Apply. These apps will appear in “Prefered apps” and you can launch them using Nvidia gpu. You can also do this through the terminal by typing “optirun” (no quotes) followed be the name of the app. For example “optirun firefox”

  • Pablo Viollier

    Hi, does it work with Ubuntu 13.04 or is it better to use Ubuntu 12.04LTS? Thanks for the guide :)

    • http://followthegeeks.com Mohamed Semlali

      I works on both.

  • Sidharth D

    Is it safe to install both the NVIDIA binary driver and Bumblebee?
    If so, is there any advantage in doing it?

    • http://followthegeeks.com Mohamed Semlali

      NVIDIA binary driver needs a recent Kernel, I don’t think it will work fine on 12.04. Besides, it allows you to use vdpau, which is not easily possible using Bumblebee. however, installing it alongside Bumblebee is a bad idea.

  • Ri

    Hi, is it okay if I update my kernel to latest kernel first before install this?

    • http://followthegeeks.com Mohamed Semlali

      It’s recommended.

  • Luke Swart

    Hi Mohamed,

    I followed these instructions exactly and rebooted my computer. However, running “optirun firefox” gave me the error:
    [ 145.248939] [ERROR]Cannot access secondary GPU – error: [XORG] (EE) No devices detected.

    Do you know what went wrong? Here is my setup:

    ThinkPad W520 (Intel 3000 and Nvidia 1000M chipset)

    OS: Ubuntu 12.04.3.

    BIOS graphics card setting: Optimus

    BIOS OS Optimus auto-detection: disabled

    I also have a post regarding this problem here:

    http://askubuntu.com/questions/393848/external-monitor-display-on-thinkpad-w520-with-12-04

    Thank you,
    Luke

  • Pingback: Linux Ubuntu: External monitor display configuration on Thinkpad W520 with 12.04CopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery, copyquery.com, android doubt, ios question, sql query, sqlite

  • Lalo Aguilera

    I have been trying 1 year this. Seriously thank you. It worked perfectly in gtx 670m

  • Mick

    Awesome! This appears to work. For the first time I’m able to see performance improvements between ‘glxspheres64′ and ‘optirun glxspheres64′. Thanks for the simple write-up.

  • Munesh Chauhan

    I installed bumblebee and upgraded to nvidia 331 driver version. Now I am faced with a blank screen on reboot. I plan to run CUDA on my Acer V3-571G laptop. Before rebooting all went well and cuda code was compiling. Kindly help.

  • norm

    Thanks for the tutorial. I’m running 13.10 (x86_64) on a Dell XPS15R (i7-3612 ivybridge) with nvidia GT-640M, using the laptop internal display at 1920×1080 plus a second display (2560×1600) connected via the mini-DP (xorg.conf is non-existent). After installing bumblebee as shown above just now (which installs nvidia 304.116 driver) , the 2nd display is dead. Is there a way to configure bumblebee to re-activate the 2nd display? I know bumblebee is working, because optirun made glxgears go from 60fps to 1065 FPS and glxspheres64 from 66 to 180 Mpixels/sec. Thanks.