From Fedora Project Wiki

m (Enable and disable bumblebeed.service added in usage section.)
(Changed the info so it uses the new bumblebee repositories.)
Line 14: Line 14:


<pre> yum install VirtualGL </pre>
<pre> yum install VirtualGL </pre>
If you want to run 32 bit apps on your 64 bit system, then also install:
<pre> yum install VirtualGL.i686 </pre>


== Install Bumblebee ==
== Install Bumblebee ==
Download the latest source from github.
Install the bumblebee yum repository
 
==== Fedora 17 ====
<pre>
<pre>
git clone https://github.com/Bumblebee-Project/Bumblebee.git
yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora17/noarch/bumblebee-release-1.0-1.noarch.rpm
cd Bumblebee
</pre>
</pre>


Create the install files.
==== Fedora 18 ====
<pre>
<pre>
autoreconf -fi
yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora18/noarch/bumblebee-release-1.0-1.noarch.rpm
./configure --prefix=/opt/bumblebee
make
</pre>
</pre>


Install it:
Now install bumblebee:
<pre>
<pre>
su -c "make install"
yum -y install bbswitch bumblebee
</pre>
</pre>


You will also need to create relevant users and groups:
== bumblebee with the NVIDIA proprietary drivers ==
<pre>
su -
groupadd bumblebee
usermod -a -G bumblebee $USER
</pre>


You can get help by running --help on either binaries.
The previous commands install bumbleblee with the nouveau drivers. If you want to install bumblebee with the NVIDIA proprietary drivers you must also follow these instructions:


=== Enable bumblebee in systemd ===
Install the bumblebee-nonfree repository:
If you want bumblebeed to start up on system boot, enable it in systemd:


==== Fedora 17 ====
<pre>
<pre>
su -
yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora17/noarch/bumblebee-nonfree-release-1.0-1.noarch.rpm
cp scripts/systemd/bumblebeed.service /lib/systemd/system/
systemctl enable bumblebeed.service
</pre>
</pre>


== Install bbswitch ==
==== Fedora 18 ====
bbswitch is the kernel module responsible for turning on and off your nvidia card
 
Download the latest source from github.
<pre>
<pre>
git clone https://github.com/Bumblebee-Project/bbswitch.git
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
</pre>
</pre>


=== without dkms ===


Now install bumblebee-nvidia
<pre>
<pre>
cd bbswitch
yum -y install bumblebee-nvidia
</pre>
</pre>


Create the install files and load in to the kernel.
"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.
 
Reboot.
 
=== Testing bumblebee ===
If you want to make sure you have bumblebee up and running, write:
<pre>
<pre>
make
optirun glxgears -info
su -c "make load"
</pre>
</pre>
You should see some gears rotating, and in the terminal you should see "GL_VENDOR = NVIDIA Corporation" or something similar.
== Primus ==
For speed imrovements you can use primus. Primus is a shared library that provides OpenGL and GLX APIs and implements low-overhead local-only client-side OpenGL offloading via GLX forking, similar to VirtualGL. It intercepts GLX calls and redirects GL rendering to a secondary X display, presumably driven by a faster GPU. On swapping buffers, rendered contents are read back using a PBO and copied onto the drawable it was supposed to be rendered on in the first place. Currently primus requires the NVIDIA proprietary drivers.
Install primus:
<pre>yum install primus </pre>
If you want to run 32 bit apps on your 64 bit system, then also install:
<pre>yum install primus.i686</pre>


This obviously needs to be loaded into the kernel every time and rebuilt manually with every kernel update. If you don't want to do that, use the [[#with dkms]] section below instead
=== Testing primus ===
Open up a terminal and run:
<pre>PRIMUS_VERBOSE=2 primusrun glxgears</pre>
If primus is working properly, you should see "primus: profiling:" messages every so often in the terminal you ran it from.


=== with dkms ===
== How to use bumblebee ==
Install dkms
If you didn't install primus, change "primusrun" to "optirun".
 
General Usage:
<pre>
<pre>
su -c "yum install dkms"
primusrun [options] <application> [application-parameters]
</pre>
</pre>


Install bbswitch
Start Windows applications:
<pre>
<pre>
cd bbswitch/
primusrun wine <windows application>.exe
su -c "make -f ./Makefile.dkms"
</pre>
</pre>


== Usage ==
By default, primusrun renders up to 60 fps. To render more frames per second:
Now to run bumblebee:
<pre>
<pre>
su -c "systemctl start bumblebeed.service"
vblank_mode=0 primusrun [options] <application> [application-parameters]
</pre>
Enable permanently bumblebee on system:
<pre>
su -c "systemctl enable bumblebeed.service"
</pre>
Disable permanently bumblebee on system:
<pre>
su -c "systemctl disable bumblebeed.service"
</pre>
Run a command using the nvidia graphics card:
<pre>
/opt/bumblebee/bin/optirun -- <command>
</pre>
</pre>
In practice this will probably only waste power, as most screens do not display more than 60 frames per second.
You can always run "man optirun" for more information.
== Useful links ==
* http://techies.ncsu.edu/wiki/bumblebee
* http://bumblebee-project.org/
* https://github.com/Bumblebee-Project/Bumblebee/wiki

Revision as of 20:23, 2 March 2013

Description

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.

NOTE This guide explains how to get Nvidia Optimus working with the open source nouveau driver. Fedora does not support the proprietary Nvidia drivers. For information on how to use the proprietary Nvidia drivers with Bumblebee in Fedora 16 Click Here.

Install Dependencies

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"

You also need to install VirtualGL. Download the latest version for your arch at the VirtualGL download page

Note: VirtualGL added Fedora 18 repository.You can install via yum with that command If you use Fedora 18;

 yum install VirtualGL 

If you want to run 32 bit apps on your 64 bit system, then also install:

 yum install VirtualGL.i686 

Install Bumblebee

Install the bumblebee yum repository

Fedora 17

yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora17/noarch/bumblebee-release-1.0-1.noarch.rpm

Fedora 18

yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora18/noarch/bumblebee-release-1.0-1.noarch.rpm

Now install bumblebee:

yum -y install bbswitch bumblebee

bumblebee with the NVIDIA proprietary drivers

The previous commands install bumbleblee with the nouveau drivers. If you want to install bumblebee with the NVIDIA proprietary drivers you must also follow these instructions:

Install the bumblebee-nonfree repository:

Fedora 17

yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora17/noarch/bumblebee-nonfree-release-1.0-1.noarch.rpm

Fedora 18

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


Now install bumblebee-nvidia

yum -y install bumblebee-nvidia

"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.

Reboot.

Testing bumblebee

If you want to make sure you have bumblebee up and running, write:

optirun glxgears -info

You should see some gears rotating, and in the terminal you should see "GL_VENDOR = NVIDIA Corporation" or something similar.

Primus

For speed imrovements you can use primus. Primus is a shared library that provides OpenGL and GLX APIs and implements low-overhead local-only client-side OpenGL offloading via GLX forking, similar to VirtualGL. It intercepts GLX calls and redirects GL rendering to a secondary X display, presumably driven by a faster GPU. On swapping buffers, rendered contents are read back using a PBO and copied onto the drawable it was supposed to be rendered on in the first place. Currently primus requires the NVIDIA proprietary drivers.

Install primus:

yum install primus 

If you want to run 32 bit apps on your 64 bit system, then also install:

yum install primus.i686

Testing primus

Open up a terminal and run:

PRIMUS_VERBOSE=2 primusrun glxgears

If primus is working properly, you should see "primus: profiling:" messages every so often in the terminal you ran it from.

How to use bumblebee

If you didn't install primus, change "primusrun" to "optirun".

General Usage:

primusrun [options] <application> [application-parameters]

Start Windows applications:

primusrun wine <windows application>.exe

By default, primusrun renders up to 60 fps. To render more frames per second:

vblank_mode=0 primusrun [options] <application> [application-parameters]

In practice this will probably only waste power, as most screens do not display more than 60 frames per second.

You can always run "man optirun" for more information.

Useful links