



The The Bumblebee package available in the official Ubuntu 16.04 repositories needs a tweak to work with Nvidia 361 graphics drivers. Furthermore, if you want to use a newer Nvidia graphics drivers version, such as 370 (which is currently in beta), the discrete card is not turned off, resulting in it being used all the time, and not just when running apps or games with "optirun", as it should.





here's how to properly install and configure Bumblebee in Ubuntu 16.04, to get it to work with nvidia-361 and nvidia-370 (the latter from the Graphics Drivers PPA).



The instructions below should also work with Linux Mint 18.x, but I didn't test this in Linux Mint!



Update: the Nvidia Graphics Drivers PPA now also provides Nvidia 375 and 378 drivers. The instructions below work with these as well, but make sure to replace any instance o "nvidia-370" with the version from the PPA you use, in the instructions below!



Update 2: the instructions below now also include Ubuntu 16.10. So

Bumblebee is a daemon for managing Optimus hybrid graphics chipsets. It allows running applications and games using the discrete GPU ( on demand - e.g. using "optirun some-game").





Ubuntu already provides a way of switching between Intel and Nvidia GPUs, by using Nvidia Prime (with Nvidia Prime installed, you can select which GPU to use from Nvidia Settings > PRIME Profiles), but this sets the GPU for the whole desktop, and not just for specific applications and games. For instance, if you select Nvidia, the desktop and every application you run will use the Nvidia GPU.





For some (like me), using the whole desktop on the Nvidia GPU can cause excessive heating, making Bumblebee a better option for running games.

Install and configure Bumblebee in Ubuntu 16.04 or 16.10 / Linux Mint 18.x

Please read the whole article very carefully, and follow the instructions exactly as mentioned in this article. Misconfiguring Bumblebee can have results the desktop not loading, or the display manager not showing up, and you'll have to recover from this via TTY. So use this at your own risk and only if you know how to debug it and recover from any issues that may occur!



Bumblebee seems pretty unstable when it comes to getting it to work, so while these instructions have been tested on my laptop, it may not work for you (it can depend on hardware, installed packages and other factors). These instructions are for those familiar with Bumblebee, who know how to debug it. Don't install it unless you know exactly what you're doing.





The instructions below assume you've already installed some Nvidia graphics drivers (nvidia-361 or nvidia-370).





nvidia-361 from the official repositories (and Bumblebee from the official repositories), and with nvidia-370 from the I tested this on a Dell XPS L702x laptop running Ubuntu (w/ Unity) 16.04, withfrom the official repositories (and Bumblebee from the official repositories), and withfrom the Graphics Drivers PPA (with Bumblebee from the Bumblebee Development PPA).

To install nvidia-prime and set it to use the Intel graphics card, use the following commands:

sudo apt install nvidia-prime sudo prime-select intel

Do not use Nvidia Settings to set the Prime PROFILES to Nvidia, because it will cause issues after a reboot (in my test, it causes a black login screen)!

sudo apt install bumblebee

sudo add-apt-repository ppa:bumblebee/testing sudo apt update sudo apt install bumblebee

To install Bumblebee in Ubuntu 16.10, you don't need a PPA since the version in the official Ubuntu repositories already includes the patches available in the PPA. So to install Bumblebee in Ubuntu 16.10 from the official Ubuntu repositories, use the following command:

sudo apt install bumblebee

gksu gedit /etc/modprobe.d/bumblebee.conf

# 361 blacklist nvidia-361 blacklist nvidia-361-updates blacklist nvidia-experimental-361

# 370 blacklist nvidia-370 blacklist nvidia-370-updates blacklist nvidia-experimental-370

gksu gedit /etc/bumblebee/bumblebee.conf

Driver= nvidia

KernelDriver=nvidia- 361

LibraryPath=/usr/lib/nvidia- 361 :/usr/lib32/nvidia- 361

:/usr/lib32/nvidia- XorgModulePath=/usr/lib/nvidia-361/xorg,/usr/lib/xorg/modules

Driver= nvidia

KernelDriver=nvidia- 370

LibraryPath=/usr/lib/nvidia- 370 :/usr/lib32/nvidia- 370

:/usr/lib32/nvidia- XorgModulePath=/usr/lib/nvidia-370/xorg,/usr/lib/xorg/modules

Update

gksu gedit /etc/bumblebee/xorg.conf.nvidia

lspci | egrep 'VGA|3D'

optirun -b none /usr/bin/nvidia-settings -c :8

Extra tip: If you want to see which GPU is currently being used and manually turn the dedicated GPU on or off, you can use If you want to see which GPU is currently being used and manually turn the dedicated GPU on or off, you can use Nvidia Power Indicator . This is available in the main WebUpd8 PPA and it can be installed in Ubuntu or Linux Mint by using the following commands:

sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt update sudo apt install nvidia-power-indicator

In my test under Ubuntu 16.04, not having Nvidia Prime installed and set to "intel" results in anfile being created underupon each reboot (or LightDM restart), which causes a black login screen.In my test, I needed to edit a configuration file to get Bumblebee from the official repositories to work withdrivers (step 3).Forfrom the Graphics Drivers PPA however, the Nvidia graphics card wasn't turned off (this can be checked with "cat /proc/acpi/bbswitch" - it should say "off" when no app is using the Nvidia graphics card, e.g. if you didn't run any app or game using "optirun") and I was unable to find a workaround for this.I did get it to work though, by installing Bumblebee from its development PPA. So to get Bumblebee to work properly within Ubuntu 16.04 / Linux Mint 18.x, you'll need to install Bumblebee from THIS PPA.(bit via AskUbuntu Openwith a text editor (as root) - I'll use Gedit below:And at the end of the file, add the following:(assuming you've installed Bumblebee from the official repositories; the Bumblebee package in the Bumblebee Development PPA already has this):(from the Graphics Drivers PPA ):... and save the file.if later on you install some newer Nvidia graphics drivers (e.g. nvidia-371, nvidia-372, etc.), you'll need to add them to, in the same way as explained above, but for the new driver version.Open the Bumblebee configuration file with a text editor (as root) - I'll use Gedit for the command below:... and in this file, change the following options so they look like below:... and save the file.just like step 2, if later on you install some newer Nvidia graphics drivers (e.g. nvidia-371, nvidia-372, etc.), you'll need to change all "nvidia-xxx" occurances in /etc/bumblebee/bumblebee.conf with the new driver.(thanks to Philippe and user-az for the info!)it appears that the BusID is not set properly for some users, causing Bumblebee not to work. To check / correct this, open thefile as root with a text editor (I'll use Gedit again below):And in this file, make sure that the "BusID" line is commented out (it shouldn't have a "#" sign in front of the line), and that it matches your Nvidia graphics bus ID. If it's not, change it, then save the file., use the following command (make sure you look for the line with Nvidia, and not Intel):That's it. After rebooting, the "cat /proc/acpi/bbswitch" command should display "OFF" as ouput, meaning that the discrete card is turned off by default.To try out Bumblebee, use "optirun some_app_or_game". To configure the Nvidia settings for Bumblebee, launch the settings using the following command:I should also mention that if you later want to remove Bumblebee, make sure to purge it ("sudo apt purge bumblebee"), to make sure its configuration files are removed, or else you'll experience issues, like the Nvidia drivers remaining blacklisted.If you encounter issues, see the DEBIAN.readme file (on Debian/Ubuntu systems with Bumblebee installed) which explains some possible solutions, as well as the Bumblebee wiki