Difference between revisions of "Bumblebee"

From ArchWiki
Jump to: navigation, search
Line 122: Line 122:
 
== Configuration ==
 
== Configuration ==
  
You can configure the behaviour of Bumblebee to your needs. Fine tuning like speed optimization, power managment and other stuff can be done in:
+
You can configure the behaviour of Bumblebee to your needs. Fine tuning like speed optimization, power managment and other stuff can be configured in {{ic|/etc/bumblebee/bumblebee.conf}}
 
{{ic|/etc/bumblebee/bumblebee.conf}}.
 
  
 
=== Optimizing Speed ===
 
=== Optimizing Speed ===

Revision as of 20:23, 5 March 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

About Bumblebee: Optimus for Linux

From Bumblebee's FAQ:

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.


Optimus Technology is an 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 longer the battery life.

Bumblebee is a software implementation based on VirtualGL and a kernel driver to be able to use the dedicated GPU, which is not physically connected to the screen.

Bumblebee 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, power-management is a work in progress.

The Nvidia dedicated card is managed as a separate X server connected to a "fake" screen (the screen is configured but not used). The second server is called using VirtualGL as if it were a remote server. That said, you will need a series of steps to set-up the kernel driver, the X server and a daemon.


Warning: Bumblebee is a work in progress and may not work properly on your machine - use it at your own risc ! Help is welcome ... :)


Installing Bumblebee with Intel / Nouveau

Note: Before installing Bumblebee check your BIOS if Optimus is activated (shareable graphics) !


1) Install noveau and required packages first:

# pacman -S xf86-video-nouveau nouveau-dri mesa

2) Install bumblebeeAUR from AUR:

# yaourt -S aur/bumblebee

3) Optional: if you like bumblebee to turn on the Nvidia card automatically use bbswitchAUR from AUR

# yaourt -S aur/bbswitch

4) Add your user to the bumblebee group:

# usermod -a -G bumblebee $USER

5) To start bumblebee automatically add it to your DAEMONS array in /etc/rc.conf

DAEMONS=(... @bumblebeed)


Finished - reboot the system now to test bumblebee & optimus !


Note: If you want to run a 32-bit application on a 64-bit system you must install lib32-virtualglAUR and proper lib32-* libraries.


Installing Bumblebee with Intel / NVidia

Note: Before installing Bumblebee check your BIOS if Optimus is activated (shareable graphics) !


1) Install bumblebeeAUR from AUR:

# yaourt -S aur/bumblebee

2) Install special nvidia packages for bumblebee:

# yaourt -S aur/nvidia-bumblebee aur/nvidia-utils-bumblebee
Warning: Don't install the original nvidia-utils for Bumblebee - it will break your system !

3) It is secure now to install the nvidia driver:

# pacman -S nvidia
Note: You can install dkms-nvidiaAUR from AUR instead of nvidia if you need it.

3) Optional: if you like bumblebee to turn on / off the dedicated NVidia card automatically, use bbswitchAUR from AUR:

# yaourt -S aur/bbswitch

4) Add your user to the bumblebee group:

# usermod -a -G bumblebee $USER

5) To start bumblebee automatically add it to your DAEMONS array in /etc/rc.conf

DAEMONS=(... @bumblebeed)


Finished - reboot the system now to test bumblebee & optimus !


Note: If you want to run a 32-bit application on a 64-bit system you must install lib32-virtualglAUR and proper lib32-* libraries.

Usage

Test Bumblebee if it works with your Optimus system:

# optirun glxspheres

If it succeeds and the terminal you are running from mentions something about your Nvidia. Grats - Bumblebee and Optimus is working!


Using the dedicated Nvidia graphics card with Bumblebee:

# optirun [options] <application> [application-parameters]


Some Examples:


Start Firefox accelerated with Optimus:

# optirun firefox


Start Windows application with Optimus:

# optirun wine <windows application>.exe


Use Nvidia Settings with Optimus:

# optirun nvidia-settings -c :8 


Configuration

You can configure the behaviour of Bumblebee to your needs. Fine tuning like speed optimization, power managment and other stuff can be configured in /etc/bumblebee/bumblebee.conf

Optimizing Speed

Bumblebee renders frames for your Optimus NVIDIA card in a invisible X Server with VirtualGL.

To display these frames they are transported back to your real visible X Server.

Frames will be compressed before they are transported - this saves bandwith and can be used for speedup optimization of bumblebee:


You can try different compression methods with:

# optirun -c <compress-method> application


Compressed Methods for <compress-method>: jpeg, xv, proxy, rgb or yuv

Uncompressed Methods for <compress-method>: proxy and xv


Note: Compressed methods will load the CPU and unload the GPU and vice versa for uncompressed methods


The standard compression method can be defined with VGLTransport variable in /etc/bumblebee/bumblebee.conf:

/etc/bumblebee/bumblebee.conf
...
[optirun]
VGLTransport=proxy
...


Note: CPU frequency scaling will affect directly on render performance


Multiple monitors

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.

/etc/X11/xorg.conf
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

You need to probably change the BusID:

$ 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

Power Management

The goal of power management is to turn the discrete card off when it is not used by any application, and turn it back on when it is needed. Currently the card can be used on-demand and no automatic switching is supported by default.

To enable it, first make sure you have installed bbswitchAUR.

Make sure the secondary Xorg server is stopped when not in use. Then in the driver section of bumblebee.conf set the PMMethod option to bbswitch

/etc/bumblebee/bumblebee.conf
[bumblebeed]
KeepUnusedXServer=false
...
[driver-nvidia]
PMMethod=bbswitch
...
[driver-nouveau]
PMMethod=bbswitch
...

This should be enough as the daemon will load the bbswitch kernel module and act accordingly. Then restart the daemon

# rc.d restart bumblebeed

Verify that bbswitch was loaded fine:

# lsmod 

Troubleshooting

[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")

A workaround for this problem is:

# optirun bash; optirun wine <windows program>.exe

[ERROR]Cannot access secondary GPU

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. Credit for this goes to Lekensteyn on #bumblebee at freenode.net

Video tearing

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 -vsync parameter).

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.

Note: Please report bugs at Bumblebee-Project's GitHub tracker as described in its Wiki.

Important Links