How to install Bumblebee on Arch Linux
In this article I will describe how to install Bumblebee on Arch Linux. The Bumblebee-Wiki provides the following description for the software: “Bumblebee is an 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”. Please be extremely cautious throughout the whole installation procedure, depending on your system you may end up with a messed up driver or system configuration! This “How To” is based on my system, here are the most relevant specs:
- Lenovo ThinkPad T420s
- CPU: Intel Core i7 – 2620M with integrated GPU
- Graphics: NVIDIA 4200M Optimus Graphics (NVIDIA GF119M)
- Only use the integrated graphics card:
Make sure that you are only using the integrated graphics device (intel) and that everything related to the Optimus technology is disabled in BIOS. Disable “OS detection for NVIDIA Optimus” and set the “Graphics device” to “Integrated Graphics” (that’s the on chip GPU) in BIOS. You can see the described configuration in the screenshot below:
- Remove any installed NVIDIA drivers:
Remove any previously installed NVIDIA drivers and tools e.g. nvidia, nvidia-utils, xf86-video-nouveau, nouveau-dri. Only the drivers for your integrated intel GPU should be installed. Example:
$ sudo pacman -R nvidia nvidia-utils xf86-video-nouveau nouveau-dri
$ sudo pacman -S mesa
- Install the drivers
First install the drivers and tools for the graphics. Notice that I used the official NVIDIA drivers, because the open source drivers (xf86-video-nouveau , nouveau-dri) sadly didn’t seem to work with Bumblebee:
pacman -S mesa nvidia nvidia-utils
Notice: Like I mention in the Preparations section the mesa drivers should already be installed!
- Install Bumblebee:
Now it’s time to install Bumblebee and all the required tools
$ pacman -S bumblebee bbswitch primus
- Enable the Bumblebee daemon:
The Bumblebee daemon will start automatically with the next system start
$ sudo systemctl enable bumblebeed
- Reboot and activate Optimus:
Reboot your system and activate the Optimus features in BIOS – Enable the “OS detection for NVIDIA Optimus” option and set the Graphics device to “NVIDIA Optimus”. You can see the described configuration in the screenshot below:
- The first test:
Try to render GLX-Gears with your NVIDIA graphics card by using the following command:
$ optirun -vv glxgears
You should see a window with the spinning GLX-Gears. You can also see in the output that the NVIDIA drivers are being used.
[42522.192710] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf [42522.193024] [DEBUG]optirun version 3.2.1 starting... [42522.193034] [DEBUG]Active configuration: [42522.193038] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf [42522.193042] [DEBUG] X display: :8 [42522.193045] [DEBUG] LD_LIBRARY_PATH: /usr/lib/nvidia:/usr/lib32/nvidia [42522.193048] [DEBUG] Socket path: /var/run/bumblebee.socket [42522.193051] [DEBUG] Accel/display bridge: auto [42522.193054] [DEBUG] VGL Compression: proxy [42522.193057] [DEBUG] VGLrun extra options: [42522.193060] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus [42522.193086] [DEBUG]Using auto-detected bridge virtualgl [42525.985376] [INFO]Response: Yes. X is active. [42525.985395] [INFO]Running application using virtualgl. [42525.985506] [DEBUG]Process vglrun started, PID 19563. 8229 frames in 5.0 seconds = 1645.525 FPS 7899 frames in 5.0 seconds = 1579.775 FPS ...
This command is also useful to test the NVIDIA card:
optirun glxgears -info
That’s it! From now on you can use the optirun command to render any application with the NVIDIA card. Make sure to also check out the next section of this article to learn the most important and some useful commands. Take a look at the Troubleshooting section if you run into any trouble.
2. Important and useful commands
- Run any program/command by using the NVIDIA graphics card:
$ optirun theCommand
- Checking if the NVIDIA card is activated:
$ cat /proc/acpi/bbswitch
- Manually activate or deactivate the NVIDIA card:
To manually activate the nvidia card:
$ sudo echo ON >> /proc/acpi/bbswitch
For manual deactivation, use:
$ sudo echo OFF >> /proc/acpi/bbswitch
- Manually start or stop Bumblebee:
To manually start the Bumblebee daemon:
$ sudo systemctl start bumblebeed
To manually stop the Bumblebee daemon:
$ sudo systemctl stop bumblebeed
- Failed to load module “mouse”
You try to run an application e.g. glxgears with optirun, but it’s not working. Optirun complains about not being able to load the module “mouse” like in the following example
$ optirun -vv glxgears [ 1164.937930] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf [ 1164.938184] [DEBUG]optirun version 3.2.1 starting... [ 1164.938191] [DEBUG]Active configuration: [ 1164.938194] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf [ 1164.938197] [DEBUG] X display: :8 [ 1164.938199] [DEBUG] LD_LIBRARY_PATH: [ 1164.938202] [DEBUG] Socket path: /var/run/bumblebee.socket [ 1164.938204] [DEBUG] Accel/display bridge: auto [ 1164.938207] [DEBUG] VGL Compression: proxy [ 1164.938209] [DEBUG] VGLrun extra options: [ 1164.938212] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib32/primus [ 1164.938224] [DEBUG]Using auto-detected bridge virtualgl[ 1164.943613] [INFO]Response: No - error: [XORG] (EE) Failed to load module "mouse" (module does not exist, 0) [ 1164.943629] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Failed to load module "mouse" (module does not exist, 0)[ 1164.943633] [DEBUG]Socket closed. [ 1164.943645] [ERROR]Aborting because fallback start is disabled. [ 1164.943651] [DEBUG]Killing all remaining processes.
install the missing module/driver
pacman -S xf86-input-mouse
- Can’t use a second monitor via Displayport:
I still had not enough time to find a working solution for this problem. However there are some things I could find out: On my system the displayport is hard-wired to the NVIDIA graphics device, so in order to use the displayport the nvidia card must be activated. In this case a second X Server is necessary to use a second monitor that’s connected via displayport.
Posted on October 14, 2013, in Audio / Video, Configure, Install, Troubleshooting and tagged Archlinux, bbswitch, Bumblebee, graphics, install, intel integrated graphics, linux, Linux M0nk3ys, Linux Monkeys, NVIDIA 4200M, nvidia optimus, optimus, optirun, primus, switch, t420s, thinkpad, troubleshoot. Bookmark the permalink. 8 Comments.