From Bumblebee's FAQ:
"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."
- 1 Bumblebee: Optimus for Linux
- 2 Installation
- 3 Usage
- 4 Configuration
- 4.1 Optimizing speed
- 4.2 Power management
- 4.3 Multiple monitors
- 5 Switch between discrete and integrated like Windows
- 6 CUDA without Bumblebee
- 7 Troubleshooting
- 7.1 [VGL] ERROR: Could not open display :8
- 7.2 Xlib: extension "GLX" missing on display ":0.0"
- 7.3 [ERROR]Cannot access secondary GPU: No devices detected
- 7.4 /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
- 7.5 ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded: ignored
- 7.6 Fatal IO error 11 (Resource temporarily unavailable) on X server
- 7.7 Video tearing
- 7.8 Bumblebee cannot connect to socket
- 7.9 Running X.org from console after login (rootless X.org)
- 7.10 Primusrun mouse delay/disable VSYNC
- 7.11 Primus issues under compositing window managers
- 7.12 Problems with bumblebee after resuming from standby
- 8 See also
Bumblebee: Optimus for Linux
Optimus Technology is a hybrid graphics implementation without a hardware multiplexer. The integrated GPU manages the display while the dedicated GPU manages the most demanding rendering and ships the work to the integrated GPU to be displayed. When the laptop is running on battery supply, the dedicated GPU is turned off to save power and prolong the battery life. It has also been tested successfully with desktop machines with Intel integrated graphics and an nVidia dedicated graphics card.
Bumblebee is a software implementation comprising of two parts:
- Render programs off-screen on the dedicated video card and display it on the screen using the integrated video card. This bridge is provided by VirtualGL or primus (read further) and connects to a X server started for the discrete video card.
- Disable the dedicated video card when it is not in use (see the #Power management section)
It tries to mimic the Optimus technology behavior; using the dedicated GPU for rendering when needed and power it down when not in use. The present releases only support rendering on-demand, automatically starting a program with the discrete video card based on workload is not implemented.
Before installing Bumblebee, check your BIOS and activate Optimus (older laptops call it "switchable graphics") if possible (BIOS doesn't have to provide this option). If neither "Optimus" or "switchable" is in the bios, still make sure both gpu's will be enabled and that the integrated graphics (igfx) is initial display (primary display). The display should be connected to the onboard integrated graphics, not the discrete graphics card. If integrated graphics had previously been disabled and discrete graphics drivers installed, be sure to remove
/etc/X11/xorg.conf or the conf file in
/etc/X11/xorg.conf.d related to the discrete graphics card.
Installing Bumblebee with Intel/NVIDIA
- - The main package providing the daemon and client programs.
- - An open-source implementation of the OpenGL specification.
- - Intel driver.
- NVIDIA#Installation. or or - Install appropriate NVIDIA driver. For more information read
For 32-bit (Multilib must be enabled) applications support on 64-bit machines, install:
- - A render/display bridge for 32 bit applications.
- or or - match the version of the 64 bit package.
- and make sure that is not installed
In order to use Bumblebee, it is necessary to add your regular user to the
# gpasswd -a user bumblebee
Installing Bumblebee with Intel/Nouveau
- - experimental 3D acceleration driver.
- - Mesa classic DRI with Gallium3D drivers and 3D graphics libraries.
glxgears to test if if Bumblebee works with your Optimus system:
$ optirun glxgears -info
If it fails, try the following commands:
- 64 bit system:
$ optirun glxspheres64
- 32 bit system:
$ optirun glxspheres32
If the window with animation shows up - Optimus with Bumblebee is working.
$ optirun [options] application [application-parameters]
For example, start Windows applications with Optimus:
$ optirun wine application.exe
For another example, open NVIDIA Settings panel with Optimus:
$ optirun -b none nvidia-settings -c :8
For a list of the options for
optirun, view its manual page:
$ man optirun
You can configure the behaviour of Bumblebee to fit your needs. Fine tuning like speed optimization, power management and other stuff can be configured in
Using VirtualGL as bridge
Bumblebee renders frames for your Optimus NVIDIA card in an invisible X Server with VirtualGL and transports them back to your visible X Server. Frames will be compressed before they are transported - this saves bandwidth and can be used for speed-up optimization of bumblebee:
To use another compression method for a single application:
$ optirun -c compress-method application
The method of compress will affect performance in the GPU/CPU usage. Compressed methods will mostly load the CPU. However, uncompressed methods will mostly load the GPU.
Here is a performance table tested with ASUS N550JV laptop and benchmark app AUR:
|Command||FPS||Score||Min FPS||Max FPS|
|optirun -c jpeg unigine-heaven||24.2||610||9.5||36.8|
|optirun -c rgb unigine-heaven||25.1||632||16.6||35.5|
|optirun -c yuv unigine-heaven||24.9||626||16.5||35.8|
|optirun -c proxy unigine-heaven||25.0||629||16.0||36.1|
|optirun -c xv unigine-heaven||22.9||577||15.4||32.2|
To use a standard compression for all applications, set the
[...] [optirun] VGLTransport=proxy [...]
You can also play with the way VirtualGL reads back the pixels from your graphic card. Setting
VGL_READBACK environment variable to
pbo should increase the performance. Compare these two:
# PBO should be faster. VGL_READBACK=pbo optirun glxgears # The default value is sync. VGL_READBACK=sync optirun glxgears
primusrun (from package ) is becoming the default choice, because it consumes less power and sometimes provides better performance than
virtualgl. It may be run separately, but it does not accept options as
optirun does. Setting
primus as the bridge for
optirun provides more flexibility.
For 32-bit applications support on 64-bit machines, install multilib must be enabled).(
Usage (run separately):
$ primusrun glxgears
Usage (as a bridge for
The default configuration sets
virtualgl as the bridge. Override that on the command line:
$ optirun -b primus glxgears
/etc/bumblebee/bumblebee.conf and you won't have to specify it on the command line.
The goal of the power management feature is to turn off the NVIDIA card when it is not used by Bumblebee any more. If Optimus laptops only and will not work on desktop computers. So, Bumblebee power management is not available for desktop computers, and there is no reason to install on a desktop. (Nevertheless, the other features of Bumblebee do work on some desktop computers.)(or ) is installed, it will be detected automatically when the Bumblebee daemon starts. No additional configuration is necessary. However, is for
Default power state of NVIDIA card using bbswitch
The default behavior of bbswitch is to leave the card power state unchanged.
bumblebeed does disable the card when started, so the following is only necessary if you use bbswitch without bumblebeed.
unload_state module options according to your needs (see bbswitch documentation).
options bbswitch load_state=0 unload_state=1
Enable NVIDIA card during shutdown
The NVIDIA card may not correctly initialize during boot if the card was powered off when the system was last shutdown. One option is to set
/etc/bumblebee/bumblebee.conf, however this will enable the card everytime you stop the Bumblebee daemon, even if done manually. To ensure that the NVIDIA card is always powered on during shutdown, add the following systemd service (if using ):
[Unit] Description=Enable NVIDIA card DefaultDependencies=no [Service] Type=oneshot ExecStart=/bin/sh -c 'echo ON > /proc/acpi/bbswitch' [Install] WantedBy=shutdown.target
Then enable the service by running
systemctl enable nvidia-enable.service at the root prompt.
Enable NVIDIA card after waking from suspend
The bumblebee daemon may fail to activate the graphics card after suspending. A possible fix involves setting
[driver-nvidia] PMmethod=bbswitch # ... [driver-nouveau] PMmethod=bbswitch
Outputs wired to the Intel chip
If the port (DisplayPort/HDMI/VGA) is wired to the Intel chip, you can set up multiple monitors with xorg.conf. Set them to use the Intel card, but Bumblebee can still use the NVIDIA card. One example configuration is below for two identical screens with 1080p resolution and using the HDMI out.
Section "Screen" Identifier "Screen0" Device "intelgpu0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "0" SubSection "Display" Depth 24 Modes "1980x1080_60.00" EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "intelgpu1" Monitor "Monitor1" DefaultDepth 24 Option "TwinView" "0" SubSection "Display" Depth 24 Modes "1980x1080_60.00" EndSubSection EndSection Section "Monitor" Identifier "Monitor0" Option "Enable" "true" EndSection Section "Monitor" Identifier "Monitor1" Option "Enable" "true" EndSection Section "Device" Identifier "intelgpu0" Driver "intel" Option "XvMC" "true" Option "UseEvents" "true" Option "AccelMethod" "UXA" BusID "PCI:0:2:0" EndSection Section "Device" Identifier "intelgpu1" Driver "intel" Option "XvMC" "true" Option "UseEvents" "true" Option "AccelMethod" "UXA" BusID "PCI:0:2:0" EndSection Section "Device" Identifier "nvidiagpu1" Driver "nvidia" BusID "PCI:0:1:0" EndSection
You need to probably change the BusID for both the Intel and the NVIDIA card.
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
The BusID is 0:2:0
Output wired to the NVIDIA chip
On some notebooks, the digital Video Output (HDMI or DisplayPort) is hardwired to the NVIDIA chip. If you want to use all the displays on such a system simultaneously, you have to run 2 X Servers. The first will be using the Intel driver for the notebooks panel and a display connected on VGA. The second will be started through optirun on the NVIDIA card, and drives the digital display.
intel-virtual-output is a tool provided in the
-f switch is used. Once the tool is running, it activates Bumblebee (Bumblebee can be left as default install), and any displays attached will be automatically detected, and manageable via any desktop display manager such as xrandr or KDE Display. See the Bumblebee wiki page for more information.
Commandline usage is as follows:
intel-virtual-output [OPTION]... [TARGET_DISPLAY]... -d <source display> source display -f keep in foreground (do not detach from console and daemonize) -b start bumblebee -a connect to all local displays (e.g. :1, :2, etc) -S disable use of a singleton and launch a fresh intel-virtual-output process -v all verbose output, implies -f -V <category> specific verbose output, implies -f -h this help
If no target displays are parsed on the commandline, intel-virtual-output will attempt to connect to any local display and then start bumblebee.
The advantage of using intel-virtual-output in foreground mode is that once the external display is disconnected, intel-virtual-output can then be killed and bumblebee will disable the nvidia chip. Games can be run on the external screen by first exporting the display
export DISPLAY=:8, and then running the game with
optirun game_bin, however, cursor and keyboard are not fully captured. Use
export DISPLAY=:0 to revert back to standard operation.
Switch between discrete and integrated like Windows
In Windows, the way that Optimus works is NVIDIA has a whitelist of applications that require Optimus for, and you can add applications to this whitelist as needed. When you launch the application, it automatically decides which card to use.
mkdir -p /tmp/libgl-switcheroo-$USER/fs gtkglswitch & libgl-switcheroo /tmp/libgl-switcheroo-$USER/fs &
To enable this, you must add the below to the shell that you intend to launch applications from (I simply added it to the .xprofile file)
Once this has all been done, every application you launch from this shell will pop up a GTK+ window asking which card you want to run it with (you can also add an application to the whitelist in the configuration). The configuration is located in
CUDA without Bumblebee
You can use CUDA without bumblebee. All you need to do is ensure that the nvidia card is on:
# tee /proc/acpi/bbswitch <<< ON
Now when you start a CUDA application it is going to automatically load all the necessary modules.
To turn off the nvidia card after using CUDA do:
# rmmod nvidia_uvm # rmmod nvidia # tee /proc/acpi/bbswitch <<< OFF
[VGL] ERROR: Could not open display :8
There is a known problem with some wine applications that fork and kill the parent process without keeping track of it (for example the free to play online game "Runes of Magic")
This is a known problem with VirtualGL. As of bumblebee 3.1, so long as you have it installed, you can use Primus as your render bridge:
$ optirun -b primus wine windows program.exe
If this does not work, an alternative walkaround for this problem is:
$ optirun bash $ optirun wine windows program.exe
If using NVIDIA drivers a fix for this problem is to edit
/etc/bumblebee/xorg.conf.nvidia and change Option
Xlib: extension "GLX" missing on display ":0.0"
If you tried to install the NVIDIA driver from NVIDIA website, this is not going to work.
1. Uninstall that driver in the similar way:
# ./NVIDIA-Linux-*.run --uninstall
2. Remove generated by NVIDIA Xorg configuration file:
# rm /etc/X11/xorg.conf
3. (Re)install the correct NVIDIA driver: #Installing Bumblebee with Intel/NVIDIA
[ERROR]Cannot access secondary GPU: No devices detected
In some instances, running
optirun will return:
[ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected. [ERROR]Aborting because fallback start is disabled.
In this case, you will need to move the file
/etc/X11/xorg.conf.d/20-intel.conf to somewhere else, restart the bumblebeed daemon and it should work. If you do need to change some features for the Intel module, a workaround is to merge
It could be also necessary to comment the driver line in
If you're using the
nouveau driver you could try switching to the
You might need to define the NVIDIA card somewhere (e.g. file
/etc/X11/xorg.conf.d), using the correct
BusID according to
Section "Device" Identifier "nvidiagpu1" Driver "nvidia" BusID "PCI:0:1:0" EndSection
Observe that the format of
lspci output is in HEX, while in xorg it is in decimals. So if the output of
lspci is, for example,
BusID should be
NVIDIA(0): Failed to assign any connected display devices to X screen 0
If the console output is:
[ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(0): Failed to assign any connected display devices to X screen 0 [ERROR]Aborting because fallback start is disabled.
You can change this line in
Option "ConnectedMonitor" "DFP"
Option "ConnectedMonitor" "CRT"
Failed to initialize the NVIDIA GPU at PCI:1:0:0 (GPU fallen off the bus / RmInitAdapter failed!)
Could not load GPU driver
If the console output is:
[ERROR]Cannot access secondary GPU - error: Could not load GPU driver
and if you try to load the nvidia module you get:
modprobe nvidia modprobe: ERROR: could not insert 'nvidia': Exec format error
This could be because the nvidia driver is out of sync with the Linux kernel, for example if you installed the latest nvidia driver and haven't updated the kernel in a while. A full system update might resolve the issue. If the problem persists you should try manually compiling the nvidia packages against your current kernel, for example with ABS.or by compiling from the
NOUVEAU(0): [drm] failed to set drm interface version
Consider switching to the official nvidia driver. As commented here, nouveau driver has some issues with some cards and bumblebee.
/dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
This could be worked around by appending following lines in
/etc/bumblebee/xorg.conf.nvidia (see here):
Section "Screen" Identifier "Default Screen" Device "DiscreteNvidia" EndSection
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded: ignored
You probably want to start a 32-bit application with bumblebee on a 64-bit system. See the "For 32-bit..." section in #Installation. If the problem persists or if it is a 64-bit application, try using the primus bridge.
true. Your program forks into background and bumblebee don't know anything about it.
Video tearing is a somewhat common problem on Bumblebee. To fix it, you need to enable vsync. It should be enabled by default on the Intel card, but verify that from Xorg logs. To check whether or not it is enabled for NVIDIA, run:
$ optirun nvidia-settings -c :8
X Server XVideo Settings -> Sync to VBlank and
OpenGL Settings -> Sync to VBlank should both be enabled. The Intel card has in general less tearing, so use it for video playback. Especially use VA-API for video decoding (e.g.
mplayer-vaapi and with
Refer to the Intel article on how to fix tearing on the Intel card.
If it is still not fixed, try to disable compositing from your desktop environment. Try also disabling triple buffering.
Bumblebee cannot connect to socket
You might get something like:
$ optirun glxspheres64
or (for 32 bit):
$ optirun glxspheres32
[ 1648.179533] [ERROR]You've no permission to communicate with the Bumblebee daemon. Try adding yourself to the 'bumblebee' group [ 1648.179628] [ERROR]Could not connect to bumblebee daemon - is it running?
If you are already in the
bumblebee group (
$ groups | grep bumblebee), you may try removing the socket
Another reason for this error could be that you haven't actually turned on both gpu's in your bios, and as a result, the Bumblebee daemon is in fact not running. Check the bios settings carefully and be sure intel graphics (integrated graphics - may be abbreviated in bios as something like igfx) has been enabled or set to auto, and that it's the primary gpu. Your display should be connected to the onboard integrated graphics, not the discrete graphics card.
If you mistakenly had the display connected to the discrete graphics card and intel graphics was disabled, you probably installed Bumblebee after first trying to run Nvidia alone. In this case, be sure to remove the /etc/X11/xorg.conf or .../20-nvidia... configuration files. If Xorg is instructed to use Nvidia in a conf file, X will fail.
Running X.org from console after login (rootless X.org)
Primusrun mouse delay/disable VSYNC
VSYNC is enabled by default and as a result, it could make mouse input delay lag or even slightly decrease performance. Test
$ vblank_mode=0 primusrun glxgears
If you want to keep using it, installAUR package, which provides a script for above command. Usage:
$ optiprime glxgears
|Command||FPS||Score||Min FPS||Max FPS|
Tested with ASUS N550JV laptop and benchmark app AUR.
Primus issues under compositing window managers
Since compositing hurts performance, invoking primus when a compositing WM is active is not recommended. If you need to use primus with compositing and see flickering or bad performance, synchronizing primus' display thread with the application's rendering thread may help:
$ PRIMUS_SYNC=1 primusrun ...
This makes primus display the previously rendered frame.
Problems with bumblebee after resuming from standby
In some systems, it can happens that the nvidia module is loaded after resuming from standby. The solution for this, is to install theand package.
Join us at #bumblebee at freenode.net.