R
ryanvade
Guest
My history with Bumblebee and Optimus on Linux.
I have been using Bumblebee with Optimus on my HP Dv6t-7000 CTO laptop since February 2013. My laptop has a Nvidia GT 630M that I use primarily for gaming on Windows 7. My first thought when I got this laptop was of course "How am I going to get my Nvidia card to work on Linux?". I spent a couple of months trying to figure this out. I first started using Arch to test Bumblebee, I could install different Kernels and test suites easier with Arch than any other distribution. Later Oz Unity Black Opal was tested on my system, but do to kernel issues (the default kernel for Black Opal is not supported on Intel CORE class processors) I upgraded to Diamond II-B when it was released. While I primarily game with Windows, Steam for Linux is running fine with Bumblebee on my laptop.
What is Nvidia Optimus? Why do many Linux users not like it?
Nvidia Optimus is an computer graphics hardware power/performance optimization technology created by Nvidia which, depending on the resource load generated by client software applications, will transparently and seamlessly switch between two graphics adapters within a computer system in order to provide either maximum performance or minimum power draw from the system's graphics rendering hardware. Specifically, Optimus is a particular implementation of what is commonly known as "switchable graphics" or, more generically, as GPU switching.
What does all that mean? Well, with Nvidia Optimus you can choose when to use the more powerful and battery consuming Nvidia graphics card or to use the integrated power saving Intel or ATI graphics. This allows you to improve your battery life while also giving you access to more powerful graphics when needed. So why do many Linux users not like the idea of Nvidia Optimus? Because Nvidia has not released a driver for Linux that provides native Optimus support. Hence the need for this tutorial.
What is this article for?
The goal of this article is to show how easy it can be to setup Nvidia Optimus graphics on Linux systems. I want this tutorial to show not only how to automatically turn off the Nvidia graphics when the computer turns on but also how to put them to good use. I will try to include screenshots and sample files for everyone's convenience.
What is Bumblee?
Bumblebee is a effort to make Nvidia Optimus enabled laptops work in GNU/Linux systems. Such feature involves two graphics cards with two different power consumption profiles plugged in a layered way sharing a single framebuffer.
The project has been fully rewritten in the C programming language, providing increased performance and reliability, mostly thanks to a new developer in the project, Jaron Viëtor (a.k.a. Thulinma). That bring the number of main developers to 4, the three other ones being Peter Wu (a.k.a. Lekensteyn), Joaquín Ignacio Aramendía (a.k.a. Samsagax) and Bruno Pagani (a.k.a. ArchangeGabriel). The most important new feature is automatic power management support. Yes, since Bumblebee 3.0 "Tumbleweed", you've got Power Management working out of the box, without any manual configuration needed. That's not the only one though, the full changelog could be found at http://bumblebee-project.org/release-notes-3.0
More here: Bumblebee - NVIDIA Optimus support for Linux!
How to install bumblebee? (Assuming that the Nvidia drivers are installed)
I am assuming that you have installed the Nvidia Graphics drivers according to your distributions specific instructions. I would recommend using a driver of at least 319. I personally always use the very latest, this allows me to test how the latest drivers will work with Bumblebee. So at the time of this writing I am using nvidia-325 on Diamond II-B with the xorg edgers PPA. Also, it helps to have a newer Kernel. I would use at least kernel (at the time of this writing) 3.10 . I am using kernel 3.11-rc4 due to my wireless card.
Ubuntu:
This adds the Bumblebee project's repository to your system.
This will update and install all the required packages for Bumblebee
This will add your user to the bumblebee group which controls Bumblebee and the optimus card.
Fedora 18:
This will install all the dependencies.
This will actually install bumblebee.
" 'bumblebee-nvidia' is both a rpm package and a shell script. The "bumblebee-nvidia" package contains the shell "wrapper" script, init scripts to run it at bootup, and a SELinux security policy, and lastly a copy of the NVidia Linux binary driver "blob" downloaded from NVidia's UNIX drivers page. This is why the packages are so large compared to the bumblebee package" (Nothing else needed for Fefora).
This can install a special Bumblebee utilities, as described above, for your system.
This will add your user to the bumblebee group.
Madriva:
This installs bumblee.
This will add your user to the bumblebee group.
This makes sure bumblebee starts at boot time.
Arch (intel/Nvidia)
Arch has two varieties of Bumblebee. One for Intel/Nvidia and one for ATI/Nvidia. I am focusing on Intel/Nvidia.
This installs Bumblebee, the dependencies, and bbswitch in DKMS form.
If you want to run 32-bit applications (like games with wine) on a 64-bit system you need the lib32-nvidia-utils package too.
This will add your user to the bumblebee group.
This makes sure bumblebee starts at boot time.
Gentoo
This adds the appropriate repository.
This installs Bumblebee
This will add your user to the bumblebee group.
System dependent, for other systems:
Build from Source
At this point you should restart your computer and test to see if everything works. A basic test would be the following:

If everything is working fine, you can continue to the section called "Install the Bumblebee Indicator"
If you run into issues manual configuration may be needed.
How to manually configure Bumblebee.
******* Check in /lib/nvidia-*
The bumblee configuration file is located at /etc/bumblebee/bumblebee.conf. I am using Nano to edit the file:
- on line 22, make sure "Driver=" is set to "nvidia", like this:
This will make sure the Nvidia driver is used when Bumblebee is on.
- change the "KernelDriver=" (on line 47) to "nvidia-*", for example:
This is used to make sure the correct driver is used. For this example, I installed nvidia-325 with apt-get so I am using nvidia-325 for the driver version.
- change "LibraryPath=" (on line 51) to "/usr/lib/nvidia-325:/usr/lib32/nvidia-325", so it looks like this:
Bumblebee has to know where the Nvidia library is located. This also depends on the distribution and driver name. I am using my driver name as an example.
- change the "XorgModulePath=" (line 54) to "XorgModulePath=/usr/lib/nvidia-325-/xorg,/usr/lib/xorg/modules" so it looks like this:
This tells Bumblebee where the Xorg server module is located.
How to configure the Nvidia Xorg settings.
The Xorg configuration for Bumblebee is different than the default configuration for the Intel graphics. Again I am using Nano to edit the file.
This part can be very tricky. You will want to make sure the following is in the correct sections:
The most important part of this section is the "BusID". The BusID is the physical Bus location that the Nvidia card is located. Bumblebee may need to know its location so it can properly start and stop it. The BusID can be discovered using the following command:
The command should give output similar to this:
The "01:00.0" is the BusID and should be placed in the BusID option.
With the configuration done reboot the system and try to test Bumblebee again. Another examle of how to test Bumblebee (mesa-utils must be installed for this test)
How to use Bumblebee.
I have given multiple examples of how to use Bumblebee but I am going to talk about it a bit more. The command to run a program with the Nvidia card is optirun. This command enables Bumblebee, and runs the command with the Nvidia card. Which means that the Nvidia card is "Woken up". When you stop the program the Nvidia card is "Put to sleep" and Bumblebee is turned off.
If you need to setup the Nvidia driver settings, like you would on a normal Nvidia card, you can use the bellow command:
To explain this command, the -b stands for:
the -c means:
and the :8 says which server to use.

How to install the Bumblebee Indicator.
The Bumblebee indicator is a graphical control system for Bumblebee as well as an applet which can tell you if Bumblebee is in use. To install the indicator, please make sure git is installed.
This downloads the Indicator and moves the working directory to the indicator source directory.
If ~/.icons does not exist
then rerun the cp ./*.svg ~/.icons
This makes sure the install script is executable.
This command will start the install script.
To start the indicator, run the following command:
The install script should also place launchers and icons for use. The .desktop files should be in the /usr/share/applications/ folder.
If you want to have the indicator running at startup, which is highly recommended, place the full location to the indicator in a desktop startup application. For example in Starup Applications in Unity.
When the Bumblebee indicator is running, you should see an applet in your Desktop Environment "task bar". This applet can tell you if Bumblebee is running and can be used to start certain programs with Bumblebee enabled.
How to configure the Bumblebee Indicator.
With the Bumblebee indicator running, right click the applet and click "Configure apps".

A window will open with a list of Programs that have .desktop files. Check any programs you want Bumblebee to run with and click Apply. If you wish to adjust advanced settings for the selected applications click the "Configure applications" tab. Once you are done, close the window and right click the applet again. Now in the "Preferred Apps" menu a list of applications appears. If you click on any of those applications from THAT menu, it will be started with the Nvidia card. You should also get an indication that Bumblebee is in use.

ryanvade....
I have been using Bumblebee with Optimus on my HP Dv6t-7000 CTO laptop since February 2013. My laptop has a Nvidia GT 630M that I use primarily for gaming on Windows 7. My first thought when I got this laptop was of course "How am I going to get my Nvidia card to work on Linux?". I spent a couple of months trying to figure this out. I first started using Arch to test Bumblebee, I could install different Kernels and test suites easier with Arch than any other distribution. Later Oz Unity Black Opal was tested on my system, but do to kernel issues (the default kernel for Black Opal is not supported on Intel CORE class processors) I upgraded to Diamond II-B when it was released. While I primarily game with Windows, Steam for Linux is running fine with Bumblebee on my laptop.
What is Nvidia Optimus? Why do many Linux users not like it?
Nvidia Optimus is an computer graphics hardware power/performance optimization technology created by Nvidia which, depending on the resource load generated by client software applications, will transparently and seamlessly switch between two graphics adapters within a computer system in order to provide either maximum performance or minimum power draw from the system's graphics rendering hardware. Specifically, Optimus is a particular implementation of what is commonly known as "switchable graphics" or, more generically, as GPU switching.
What does all that mean? Well, with Nvidia Optimus you can choose when to use the more powerful and battery consuming Nvidia graphics card or to use the integrated power saving Intel or ATI graphics. This allows you to improve your battery life while also giving you access to more powerful graphics when needed. So why do many Linux users not like the idea of Nvidia Optimus? Because Nvidia has not released a driver for Linux that provides native Optimus support. Hence the need for this tutorial.
What is this article for?
The goal of this article is to show how easy it can be to setup Nvidia Optimus graphics on Linux systems. I want this tutorial to show not only how to automatically turn off the Nvidia graphics when the computer turns on but also how to put them to good use. I will try to include screenshots and sample files for everyone's convenience.
What is Bumblee?
Bumblebee is a effort to make Nvidia Optimus enabled laptops work in GNU/Linux systems. Such feature involves two graphics cards with two different power consumption profiles plugged in a layered way sharing a single framebuffer.
The project has been fully rewritten in the C programming language, providing increased performance and reliability, mostly thanks to a new developer in the project, Jaron Viëtor (a.k.a. Thulinma). That bring the number of main developers to 4, the three other ones being Peter Wu (a.k.a. Lekensteyn), Joaquín Ignacio Aramendía (a.k.a. Samsagax) and Bruno Pagani (a.k.a. ArchangeGabriel). The most important new feature is automatic power management support. Yes, since Bumblebee 3.0 "Tumbleweed", you've got Power Management working out of the box, without any manual configuration needed. That's not the only one though, the full changelog could be found at http://bumblebee-project.org/release-notes-3.0
More here: Bumblebee - NVIDIA Optimus support for Linux!
How to install bumblebee? (Assuming that the Nvidia drivers are installed)
I am assuming that you have installed the Nvidia Graphics drivers according to your distributions specific instructions. I would recommend using a driver of at least 319. I personally always use the very latest, this allows me to test how the latest drivers will work with Bumblebee. So at the time of this writing I am using nvidia-325 on Diamond II-B with the xorg edgers PPA. Also, it helps to have a newer Kernel. I would use at least kernel (at the time of this writing) 3.10 . I am using kernel 3.11-rc4 due to my wireless card.
Ubuntu:
Code:
sudo add-apt-repository ppa:bumblebee/stable
Code:
sudo apt-get update && sudo apt-get install bumblebee virtualgl linux-headers-`uname -r` mesa-utils
Code:
sudo su -c "useradd -G bumblebee USERNAME"
Fedora 18:
Code:
su -c "yum install -y libbsd-devel libbsd glibc-devel libX11-devel help2man autoconf git tar glib2 glib2-devel kernel-devel kernel-headers automake gcc gtk2-devel VirtualGL VirtualGL.i686 "
Code:
su -c "yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora18/noarch/bumblebee-nonfree-release-1.0-1.noarch.rpm"
" 'bumblebee-nvidia' is both a rpm package and a shell script. The "bumblebee-nvidia" package contains the shell "wrapper" script, init scripts to run it at bootup, and a SELinux security policy, and lastly a copy of the NVidia Linux binary driver "blob" downloaded from NVidia's UNIX drivers page. This is why the packages are so large compared to the bumblebee package" (Nothing else needed for Fefora).
Code:
su -c "yum install glibc-devel bumblebee-nvidia"
Code:
su -c "useradd -G bumblebee USERNAME"
Madriva:
Code:
urpmi bumblebee
Code:
sudo su -c "useradd -G bumblebee USERNAME"
Code:
sudo su- c "systemctl enable bumblebeed.service"
Arch (intel/Nvidia)
Arch has two varieties of Bumblebee. One for Intel/Nvidia and one for ATI/Nvidia. I am focusing on Intel/Nvidia.
Code:
sudo pacman -S intel-dri xf86-video-intel bumblebee bbswitch-dkms nvidia
If you want to run 32-bit applications (like games with wine) on a 64-bit system you need the lib32-nvidia-utils package too.
Code:
sudo su -c "gpasswd -a $USER bumblebee"
Code:
sudo systemctl enable bumblebeed
Gentoo
Code:
su -c "layman -a mva"
Code:
su -c "emerge -j2 bumblebee"
Code:
su -c "gpasswd -a $USER bumblebee"
System dependent, for other systems:
Build from Source
At this point you should restart your computer and test to see if everything works. A basic test would be the following:
Code:
optirun -vvv glxspheres

If everything is working fine, you can continue to the section called "Install the Bumblebee Indicator"
If you run into issues manual configuration may be needed.
How to manually configure Bumblebee.
******* Check in /lib/nvidia-*
The bumblee configuration file is located at /etc/bumblebee/bumblebee.conf. I am using Nano to edit the file:
Code:
sudo nano /etc/bumblebee/bumblebee.conf
- on line 22, make sure "Driver=" is set to "nvidia", like this:
Code:
Driver=nvidia
- change the "KernelDriver=" (on line 47) to "nvidia-*", for example:
Code:
KernelDriver=nvidia-325
- change "LibraryPath=" (on line 51) to "/usr/lib/nvidia-325:/usr/lib32/nvidia-325", so it looks like this:
Code:
LibraryPath=/usr/lib/nvidia-325:/usr/lib32/nvidia-325
- change the "XorgModulePath=" (line 54) to "XorgModulePath=/usr/lib/nvidia-325-/xorg,/usr/lib/xorg/modules" so it looks like this:
Code:
XorgModulePath=/usr/lib/nvidia-325/xorg,/usr/lib/xorg/modules
How to configure the Nvidia Xorg settings.
The Xorg configuration for Bumblebee is different than the default configuration for the Intel graphics. Again I am using Nano to edit the file.
Code:
sudo nano /etc/bumblebee/xorg.conf.nvidia
This part can be very tricky. You will want to make sure the following is in the correct sections:
Code:
Section "ServerLayout"
Identifier "Layout0"
Option "AutoAddDevices" "true"
Option "AutoAddGPU" "false"
EndSection
Section "Device"
Identifier "DiscreteNvidia"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "ProbeAllGpus" "false"
BusID "PCI:01:00:0"
Option "NoLogo" "false"
Option "UseEDID" "true"
Option "UseDisplayDevice" "none"
Option "ConnectedMonitor" "DFP"
EndSection
Code:
lspci | grep NVIDIA
Code:
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 630M] (rev a1)
With the configuration done reboot the system and try to test Bumblebee again. Another examle of how to test Bumblebee (mesa-utils must be installed for this test)
Code:
optirun -vvv glxgears
How to use Bumblebee.
I have given multiple examples of how to use Bumblebee but I am going to talk about it a bit more. The command to run a program with the Nvidia card is optirun. This command enables Bumblebee, and runs the command with the Nvidia card. Which means that the Nvidia card is "Woken up". When you stop the program the Nvidia card is "Put to sleep" and Bumblebee is turned off.
If you need to setup the Nvidia driver settings, like you would on a normal Nvidia card, you can use the bellow command:
Code:
optirun -b none nvidia-settings -c :8
Code:
-b, --bridge METHOD
acceleration/displaying bridge to use. Valid values are auto, virtualgl and primus. The --vgl-* options only make sense when using the virtualgl bridge, while the
--primus-* options apply only when using the primus bridge. Additionally, value none is recognized, and its effect is to add paths to driver libraries to LD_LIBRARY_PATH
(useful for nvidia-settings and CUDA applications)
Code:
-c, --vgl-compress METHOD
image compression or transport to use with VirtualGL. Valid values for METHOD are proxy, jpeg, rgb, xv and yuv. Changing this setting may affect performance, CPU usage and
image quality

How to install the Bumblebee Indicator.
The Bumblebee indicator is a graphical control system for Bumblebee as well as an applet which can tell you if Bumblebee is in use. To install the indicator, please make sure git is installed.
Code:
git clone https://github.com/Bumblebee-Project/bumblebee-ui.git && cd bumblebee-ui
Code:
cd icons && cp ./*.svg ~/.icons
Code:
mkdir ~/.icons
Code:
cd ..
Code:
chmod +x ./INSTALL
Code:
sudo ./INSTALL
To start the indicator, run the following command:
Code:
/usr/local/bin/bumblebee-indicator
The install script should also place launchers and icons for use. The .desktop files should be in the /usr/share/applications/ folder.
If you want to have the indicator running at startup, which is highly recommended, place the full location to the indicator in a desktop startup application. For example in Starup Applications in Unity.
When the Bumblebee indicator is running, you should see an applet in your Desktop Environment "task bar". This applet can tell you if Bumblebee is running and can be used to start certain programs with Bumblebee enabled.
How to configure the Bumblebee Indicator.
With the Bumblebee indicator running, right click the applet and click "Configure apps".

A window will open with a list of Programs that have .desktop files. Check any programs you want Bumblebee to run with and click Apply. If you wish to adjust advanced settings for the selected applications click the "Configure applications" tab. Once you are done, close the window and right click the applet again. Now in the "Preferred Apps" menu a list of applications appears. If you click on any of those applications from THAT menu, it will be started with the Nvidia card. You should also get an indication that Bumblebee is in use.

ryanvade....
Attachments
Last edited: