Software & AppsOperating SystemLinux

How To Install Nvidia Optimus Driver on Ubuntu with Bumblebee?

Ubuntu 20

In this guide, we will walk you through the process of installing the Nvidia Optimus Driver on Ubuntu using Bumblebee. Bumblebee is a project that aims to provide support for Nvidia Optimus laptops for GNU/Linux distributions.


Before we begin, ensure you have the following:

  • A system running Ubuntu.
  • Access to a terminal window/command line (Ctrl-Alt-T).
  • Sudo or root privileges.

Step 1: Update Your System

Firstly, it’s always a good idea to ensure your system is up-to-date. Open the terminal and run the following command:

sudo apt-get update
sudo apt-get upgrade

The sudo command allows you to run programs with the security privileges of the superuser. The apt-get update command fetches the package list from the repositories and updates them to get information on the newest versions of packages and their dependencies. The apt-get upgrade command will fetch new versions of packages existing on the machine.

Step 2: Install Necessary Packages

Next, we need to install some necessary packages. Run the following commands in the terminal:

sudo apt-get install ppa-purge
sudo apt-get purge bbswitch-dkms bumblebee-nvidia
sudo apt-get install linux-headers-generic
sudo apt-get install bbswitch-dkms bumblebee-nvidia

Here, ppa-purge is a tool that removes a PPA (Personal Package Archive) from your system and downgrades all the packages installed from that PPA to their original versions. The purge command removes the packages bbswitch-dkms and bumblebee-nvidia along with their configuration files. linux-headers-generic is a package that ensures that the correct Linux headers are installed. Finally, bbswitch-dkms and bumblebee-nvidia are reinstalled.

Step 3: Enable the Bumblebee PPA

On an upgrade from Ubuntu 12.04 to 12.10, the Bumblebee PPA may become disabled. To re-enable it, run the following commands:

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

The add-apt-repository command adds a PPA to your system. Here, we’re adding the Bumblebee PPA. We then update the system and upgrade the packages as before, and reinstall bbswitch-dkms and bumblebee-nvidia.

Step 4: Check for Encrypted Home Directory

If your home directory is encrypted, the installation process may hang at update-initramfs. To resolve this, disable FRAMEBUFFER=y in /usr/share/initramfs-tools/conf-hooks.d/cryptsetup.

Step 5: Verify the Installation

Finally, verify the installation by running the command optirun glxspheres. This command uses the Bumblebee daemon to run the glxspheres program using your Nvidia GPU. You should see information about your GPU and a rendering of polygons in the scene.

optirun glxspheres

If you see an output similar to the one above, congratulations! You have successfully installed the Nvidia Optimus driver on Ubuntu with Bumblebee.


In this guide, we have shown you how to install the Nvidia Optimus Driver on Ubuntu using Bumblebee. This should enable you to take full advantage of your Nvidia GPU when running applications on your Ubuntu system. If you encounter any issues during the installation process, refer back to the steps in this guide and ensure you have followed them correctly.

What is Nvidia Optimus?

Nvidia Optimus is a technology that allows laptops to switch between integrated graphics (usually provided by Intel) and dedicated graphics (usually provided by Nvidia) to optimize performance and battery life.

Why do I need Bumblebee to install the Nvidia Optimus Driver on Ubuntu?

Bumblebee is a project that provides support for Nvidia Optimus laptops on GNU/Linux distributions. It allows you to utilize the power of your Nvidia GPU while still being able to switch to the integrated graphics for normal usage, thus optimizing performance and battery life.

How do I check if I have Nvidia Optimus on my laptop?

You can check if you have Nvidia Optimus on your laptop by running the command lspci -k | grep -A 2 -i "VGA". If it shows both an Intel and Nvidia graphics card, then you have Nvidia Optimus.

Can I install the Nvidia Optimus Driver without using Bumblebee?

Yes, you can install the Nvidia Optimus Driver without using Bumblebee, but Bumblebee provides additional functionality and support specifically for Nvidia Optimus laptops. It is recommended to use Bumblebee for the best experience.

How do I uninstall the Nvidia Optimus Driver?

To uninstall the Nvidia Optimus Driver, you can run the command sudo apt-get purge bumblebee-nvidia. This will remove the package and its configuration files from your system.

What if I encounter issues during the installation process?

If you encounter issues during the installation process, make sure you have followed the steps correctly and refer back to the guide. You can also search for solutions online or seek help from the community forums or support channels for Bumblebee and Ubuntu.

Leave a Comment

Your email address will not be published. Required fields are marked *