NVIDIA Optimus is a technology that enables Optimus on Linux systems. This article will show you how to enable NVIDIA Optimus on your Linux system. First, you need to install the NVIDIA drivers. You can find the drivers online or in the NVIDIA repositories. Once you have installed the drivers, you can start them by running: sudo apt-get install nvidia-driver Next, you need to create a file called “config” in your home directory. This file contains information about your Linux system and its Nvidia card. In this example, we will use Ubuntu 14.04 as our platform and assume that our Nvidia card is named “GeForce GTX 1070”. The contents of our config file should look like this: #! /bin/bash # config file for GeForce GTX 1070 # # Copyright (C) 2013-2018 by Thomas Gleixner tglx@lists.sourceforge.net # # This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. $HOME/.config/nvidia/conflict_free_list=1 $HOME/.config/nvidia/driver_logo=nvidia $HOME/.config/nvidia/logo_compat=1 $HOME/.config/nvidia/$USERNAME$GFXMODE$CONFIG_FILE=/etc/$USERNAME$GFXMODE/$CONFIG_DIRS/$USERNAME$GLOBALS/* $HOME/.config/nvidia/$USERNAME$GFXMODE$CONFIG_


Many new laptops come with NVIDIA’s Optimus technology — the laptop includes both a discrete NVIDIA GPU for gaming power and an onboard Intel GPU for power savings. The notebook switches between the two when necessary.

However, this isn’t yet well-supported on Linux. Linus Torvalds had some choice words for NVIDIA regarding Optimus not working on Linux, and NVIDIA is now currently working on official support.

However, if you have a laptop with Optimus support, you don’t have to wait for NVIDIA — you can use the Bumblebee project’s solution to enable Optimus on Linux today.

Image Credit: Jemimus on Flickr

Installing Bumblebee

We’ll be going over installation instructions for Ubuntu here. Installation on many other Linux distributions is fairly simple — you can find instructions on the Bumblee project’s website. The page includes instructions for Fedora, Debian, Arch, Mandriva, and Gentoo.

First, you’ll have to run the following command in a terminal window to add the Bumblebee project’s software repository to your Ubuntu system:

Next, run the following command to download updated information about available packages:

Run the following command to install Optimus support:

Restart your computer or log out and log back in after running this command.

Switching Between Integrated Graphics and NVIDIA

Your laptop will now use its integrated Intel graphics most of the time, cutting off power to the NVIDIA graphics card and improving your battery life.

When you want to run a program that takes advantage of your NVIDIA graphics, you’ll need to run it with the optirun command.

For example, if you want to run a game named game with NVIDIA graphics support, you’d run the following command in the terminal:

While the game is running with the optirun command, the NVIDIA graphics will be enabled. When the game quits and optirun is no longer running, your notebook will switch to integrated graphics.

You should only use this command with games and other applications that require 3D graphics acceleration — don’t use it with an application that runs most of the time, such as your window manager, or you won’t see any power savings because the NVIDIA graphics will be in-use all of the time.

To test whether it’s working, you can try using the glxspheres graphics demo. First, run it without optirun:

Next, run glxspheres with optirun:

You should see higher FPS with the second command, as it’s using your NVIDIA graphics.

NVIDIA will ideally bring official support that works out-of-the-box for everyone in the future, but Bumblebee is the best we can do for now.