HowTo Install nvidia-331 with bumblebee for optimus cards in Ubuntu

Bumblebee, by default, installs nvidia-304 graphics drivers. The current Nvidia graphics driver which supports optimus cards is nvidia-331. You can follow the following steps to get the latest Nvidia driver on your laptop.

Please note: The following steps have been performed on a laptop with optimus graphics card GeForce 310M running on Ubuntu 13.10 x64.

First and foremost, install the kernel header file. This header file will be required to recompile dkms package for the new Nvidia driver.

sudo apt-get install linux-headers-generic

Install the xorg-edgers ppa for the latest drivers and upgrade

sudo apt-add-repository ppa:xorg-edgers/ppa
sudo apt-get update && sudo apt-get upgrade

Install bumblebee if you haven’t done already

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

Then, install nvidia-331 package available in the xorg-edgers repository

sudo apt-get install nvidia-331 nvidia-settings-331

Once installation is done, edit the bumblebee.conf using your favourite text editor (I use vim)

sudo vim /etc/bumblebee/bumblebee.conf

In line no 22, set the following:


You will also need to specify which nvidia driver to use in line no 55:


Change the following in line no 58:


And in line no 61 :


Reinstall bbswitch-dkms

sudo apt-get install --reinstall bbswitch-dkms

Once the installation is complete, stop and start bumblebee. You can also reboot your laptop if you like.

sudo /etc/init.d/bumblebeed stop
sudo /etc/init.d/bumblebeed start

Check the framerates using glxgears. For 64bit Ubuntu 13.10, go to the folder /opt/VirtualGL/bin and run the following :

Without bumblebee

Polygons in scene: 62464
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) Ironlake Mobile
54.904578 frames/sec - 48.678399 Mpixels/sec
48.468766 frames/sec - 42.972408 Mpixels/sec
48.846437 frames/sec - 43.307251 Mpixels/sec
46.377243 frames/sec - 41.118064 Mpixels/sec
45.301144 frames/sec - 40.163994 Mpixels/sec
45.122996 frames/sec - 40.006049 Mpixels/sec
44.936607 frames/sec - 39.840796 Mpixels/sec
45.184967 frames/sec - 40.060992 Mpixels/sec

With bumblebee

$ optirun ./glxspheres64
Polygons in scene: 62464
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: GeForce 310M/PCIe/SSE2
150.717345 frames/sec - 133.625998 Mpixels/sec
157.407923 frames/sec - 139.557864 Mpixels/sec
152.623146 frames/sec - 135.315681 Mpixels/sec
154.634365 frames/sec - 137.098828 Mpixels/sec
148.475822 frames/sec - 131.638664 Mpixels/sec
155.948467 frames/sec - 138.263911 Mpixels/sec

That’s it! The latest driver is now installed.

I am a Sr. IT Consultant working at Srinsoft Technologies, Chennai. I have over 6 years of work experience with more than 4 years as a Linux System Administrator. I am a Linux enthusiast and a blogger. I am also a regular contributor to the Ubuntu Manual.
  • Pingback: Links 15/6/2014: News Catchup, Build-up for Another Iraq Invasion | Techrights()

  • oh.diego

    It seems to work, this looks like the ultimate tutorial for optimus laptops, thanks

  • Vikri Aulia

    Thanks. i have many problem with my Laptop power.
    after install bumblebee my battery have longer life time.. :)

  • karan


  • Mehdi Sadeghi

    Worked for me, thanks.

  • عاهد عيد

    Thanks that work