From Fedora Project Wiki

(22 intermediate revisions by 6 users not shown)
Line 3: Line 3:
From [https://github.com/Bumblebee-Project/Bumblebee/wiki/FAQ 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.
From [https://github.com/Bumblebee-Project/Bumblebee/wiki/FAQ 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.


== Install Dependencies ==
== Installation ==
 
===Install Dependencies===
 
'''Fedora 22'''
<pre>
# dnf -y install libbsd-devel libbsd glibc-devel libX11-devel help2man autoconf git tar glib2 glib2-devel kernel-devel kernel-headers automake gcc gtk2-devel
</pre>
 
'''Fedora 20/21'''
<pre>
<pre>
#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
# yum -y install libbsd-devel libbsd glibc-devel libX11-devel help2man autoconf git tar glib2 glib2-devel kernel-devel kernel-headers automake gcc gtk2-devel
</pre>
</pre>


You also need to install [http://www.virtualgl.org/VirtualGL VirtualGL]. Download the latest version for your arch at [http://www.virtualgl.org/Downloads/VirtualGL the VirtualGL download page] or use yum command


<pre>#yum install VirtualGL </pre>
You also need to install [http://www.virtualgl.org/VirtualGL VirtualGL]. Download the latest version for your arch at [http://www.virtualgl.org/Downloads/VirtualGL the VirtualGL download page] or use the following command.
 
'''Fedora 22'''
<pre># dnf -y install VirtualGL </pre>
 
'''Fedora 20/21'''
<pre># yum -y install VirtualGL </pre>
 
 
If you want to run 32 bit apps on your 64 bit system, then also install the 32-bit VirtualGL package.
 
'''Fedora 22'''
<pre># dnf -y install VirtualGL.i686 </pre>
 
'''Fedora 20/21'''
<pre># yum -y install VirtualGL.i686 </pre>


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


<pre>#yum install VirtualGL.i686 </pre>
Now, you are ready to install the Bumblebee dnf|yum repository, drivers, and software packages.


== Install Bumblebee ==
=== Install Bumblebee for Nouveau ===
Install the Bumblebee yum repository
To use bumblebee with the free nouveau video drivers (the default in Fedora, initially), install the bumblebee free-software repo and packages.


==== Fedora 20 ====
==== Fedora 22 ====
<pre>
<pre>
#yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.1-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
# dnf -y install bbswitch bumblebee
</pre>
</pre>


==== Fedora 21 ====
==== Fedora 21 ====
<pre>
<pre>
#yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee
</pre>
</pre>


==== Install Bumblebee: ====
==== Fedora 20 ====
<pre>
<pre>
#yum -y install bbswitch bumblebee
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee
</pre>
</pre>


== Bumblebee with the NVIDIA proprietary drivers ==
=== Install Bumblebee for 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:
The previous commands install bumbleblee with the nouveau drivers. If you wish to use bumblebee with the NVIDIA proprietary drivers, instead use the following commands to install bumblebee along with the bumblebee-nonfree repo.


==== Fedora 19 ====
==== Fedora 22 ====
<pre>
<pre>
#yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora19/noarch/bumblebee-nonfree-release-1.1-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora22/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# dnf -y install bbswitch bumblebee bumblebee-nvidia
</pre>
</pre>
A potentially more up-to-date driver may be installed using the bumblebee-nonfree-shortlived repo:
 
==== Fedora 21 ====
<pre>
<pre>
#yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-shortlived/fedora19/noarch/bumblebee-nonfree-shortlived-release-1.1-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora21/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia
</pre>
</pre>


==== Fedora 20 ====
==== Fedora 20 ====
<pre>
<pre>
#yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora20/noarch/bumblebee-nonfree-release-1.1-1.noarch.rpm
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora20/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia
</pre>
</pre>
A potentially more up-to-date driver may be installed using the bumblebee-nonfree-shortlived repo:
 
"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.
 
=== Install Bumblebee for non-standard or legacy NVIDIA proprietary drivers ===
If you have an older model Nvidia graphics card or one which requires special configuration to the binary drivers, you may not be able to use the prepackaged drivers from bumblebee-nonfree. In this case, the bumblebee-nonfree-unmanaged repo exists, allowing the user to manually download the necessary binary drivers from Nvidia and configure them with bumblebee. Use the following commands to install bumblebee with the bumblebee-nonfree-unmanaged repo.
 
==== Fedora 22 ====
<pre>
<pre>
#yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-shortlived/fedora20/noarch/bumblebee-nonfree-shortlived-release-1.1-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora22/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
# dnf -y install bbswitch bumblebee bumblebee-nvidia
</pre>
</pre>


==== Fedora 21 ====
==== Fedora 21 ====
<pre>
<pre>
$yum install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora21/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora21/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia
</pre>
</pre>


==== For all versions ====
==== Fedora 20 ====
Make sure you have glibc-devel installed because it is needed for bumblebee-nvidia to compile the driver
<pre>
<pre>
sudo yum install glibc-devel
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora20/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia
</pre>
</pre>


Now install bumblebee-nvidia
==== Download and build NVIDIA binary drivers ====
<pre>
See the bumblebee documentation and [https://github.com/Bumblebee-Project/Bumblebee/issues/659 this issue in GitHub] for more information on how to complete the bumblebee installation with the bumblebee-nonfree-unmanaged repo.
#yum -y install bumblebee-nvidia
</pre>


"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 to complete installation ===
 
After installing all of the necessary packages, reboot the system to load the new drivers into the kernel and enable bumblebee.
Reboot.


=== Testing Bumblebee ===
=== Testing Bumblebee ===
Line 88: Line 126:
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.
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:
===Install primus===
<pre>#yum -y install primus </pre>
 
'''Fedora 22'''
<pre># dnf -y install primus</pre>
 
'''Fedora 20/21'''
<pre># yum -y install primus</pre>
 


If you want to run 32 bit apps on your 64 bit system, then also install:
If you want to run 32 bit apps on your 64 bit system, then also install:
<pre>#yum -y install primus.i686</pre>
 
'''Fedora 22'''
<pre># dnf -y install primus.i686</pre>
 
'''Fedora 20/21'''
<pre># yum -y install primus.i686</pre>


=== Testing primus ===
=== Testing primus ===
Line 149: Line 198:
The verbose output of optirun provided by appending the switch -vv can give us an idea of the issue at hand.
The verbose output of optirun provided by appending the switch -vv can give us an idea of the issue at hand.
<pre>
<pre>
[user1@localhost ~]$optirun -vv vlc
[user1@localhost ~]$ optirun -vv vlc
[  52.410461] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[  52.410461] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[  52.411039] [INFO]Configured driver: nvidia
[  52.411039] [INFO]Configured driver: nvidia
Line 173: Line 222:
When you upgrade from one version of nvidia binary to higher version of the module, sometimes the un-install phase is not complete and in that case this following suggestion should help.
When you upgrade from one version of nvidia binary to higher version of the module, sometimes the un-install phase is not complete and in that case this following suggestion should help.


1. First unload the nvidia module by logging in as root in a terminal. Terminal output of ''cat /proc/apci/bbswitch'' should be ''OFF'' after this step.
1. First unload the nvidia module by logging in as root in a terminal. Terminal output of ''cat /proc/acpi/bbswitch'' should be ''OFF'' after this step.
<pre>systemctl restart bumblebeed </pre>
<pre>systemctl restart bumblebeed </pre>
2. Uninstall the nvidia module  
2. Uninstall the nvidia module  

Revision as of 10:53, 1 October 2015

Description

Nvidia Optimus is an 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. 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.

Installation

Install Dependencies

Fedora 22

# dnf -y install libbsd-devel libbsd glibc-devel libX11-devel help2man autoconf git tar glib2 glib2-devel kernel-devel kernel-headers automake gcc gtk2-devel

Fedora 20/21

# yum -y install 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 or use the following command.

Fedora 22

# dnf -y install VirtualGL 

Fedora 20/21

# yum -y install VirtualGL 


If you want to run 32 bit apps on your 64 bit system, then also install the 32-bit VirtualGL package.

Fedora 22

# dnf -y install VirtualGL.i686 

Fedora 20/21

# yum -y install VirtualGL.i686 


Now, you are ready to install the Bumblebee dnf|yum repository, drivers, and software packages.

Install Bumblebee for Nouveau

To use bumblebee with the free nouveau video drivers (the default in Fedora, initially), install the bumblebee free-software repo and packages.

Fedora 22

# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
# dnf -y install bbswitch bumblebee

Fedora 21

# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee

Fedora 20

# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee

Install Bumblebee for NVIDIA proprietary drivers

The previous commands install bumbleblee with the nouveau drivers. If you wish to use bumblebee with the NVIDIA proprietary drivers, instead use the following commands to install bumblebee along with the bumblebee-nonfree repo.

Fedora 22

# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora22/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# dnf -y install bbswitch bumblebee bumblebee-nvidia

Fedora 21

# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora21/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia

Fedora 20

# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora20/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee 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.

Install Bumblebee for non-standard or legacy NVIDIA proprietary drivers

If you have an older model Nvidia graphics card or one which requires special configuration to the binary drivers, you may not be able to use the prepackaged drivers from bumblebee-nonfree. In this case, the bumblebee-nonfree-unmanaged repo exists, allowing the user to manually download the necessary binary drivers from Nvidia and configure them with bumblebee. Use the following commands to install bumblebee with the bumblebee-nonfree-unmanaged repo.

Fedora 22

# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora22/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
# dnf -y install bbswitch bumblebee bumblebee-nvidia

Fedora 21

# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora21/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia

Fedora 20

# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora20/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
# yum -y install bbswitch bumblebee bumblebee-nvidia

Download and build NVIDIA binary drivers

See the bumblebee documentation and this issue in GitHub for more information on how to complete the bumblebee installation with the bumblebee-nonfree-unmanaged repo.

Reboot to complete installation

After installing all of the necessary packages, reboot the system to load the new drivers into the kernel and enable bumblebee.

Testing Bumblebee

To verify you are now using the NVIDIA driver, run the glxgears demo (from mesa-demos):

optirun glxgears -info | grep "GL_VENDOR"

You should see some gears rotating. 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

Fedora 22

# dnf -y install primus

Fedora 20/21

# yum -y install primus


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

Fedora 22

# dnf -y install primus.i686

Fedora 20/21

# yum -y install primus.i686

Testing primus

Open up a terminal and run:

PRIMUS_VERBOSE=2 optirun -b primus glxgears -info

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

General Usage:

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

If you installed primus, then you can use the following command to take advantage of it:

optirun -b primus <application> [application-parameters]

Start Windows applications:

optirun wine <windows application>.exe

with primus:

optirun -b primus wine <windows application>.exe

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

vblank_mode=0 optirun -b primus <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.

Troubleshooting

Unable to use optirun with nouveau

In some cases, users on post Linux 3.4 kernels are unable to use bumblebee with nouveau. One less then optimal workaround is to not use optirun and instead request that the window be drawn using the primary or secondary graphics cards/drivers. This can be achieved using the following:

[user1@localhost ~]$ DRI_PRIME=0 glxgears -info | grep "GL_VENDOR"
[user1@localhost ~]$ DRI_PRIME=1 glxgears -info | grep "GL_VENDOR"

These two commands should produce the demonstration gears and the driver vendor (often Intel and nouveau) in the terminal. For more information see (https://bugzilla.redhat.com/show_bug.cgi?id=964012).

Unable to load (NVIDIA) GPU driver error with optirun

Most of the information presented here was suggested by bumblebee maintainer Gary Gatling.

The verbose output of optirun provided by appending the switch -vv can give us an idea of the issue at hand.

[user1@localhost ~]$ optirun -vv vlc
[   52.410461] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[   52.411039] [INFO]Configured driver: nvidia
[   52.411659] [DEBUG]optirun version 3.2.1 starting...
[   52.411716] [DEBUG]Active configuration:
[   52.411745] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[   52.411765] [DEBUG] X display: :8
[   52.411785] [DEBUG] LD_LIBRARY_PATH: /usr/lib64/nvidia-bumblebee:/usr/lib/nvidia-bumblebee:/usr/lib64:/usr/lib
[   52.411805] [DEBUG] Socket path: /var/run/bumblebee.socket
[   52.411826] [DEBUG] Accel/display bridge: auto
[   52.411847] [DEBUG] VGL Compression: proxy
[   52.411868] [DEBUG] VGLrun extra options:
[   52.411886] [DEBUG] Primus LD Path: /usr/lib/primus:/usr/lib64/primus
[   52.411939] [DEBUG]Using auto-detected bridge virtualgl
[   52.434739] [INFO]Response: No - error: Could not load GPU driver

[   52.434758] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

[   52.434763] [DEBUG]Socket closed.
[   52.434781] [ERROR]Aborting because fallback start is disabled.
[   52.434787] [DEBUG]Killing all remaining processes.

When you upgrade from one version of nvidia binary to higher version of the module, sometimes the un-install phase is not complete and in that case this following suggestion should help.

1. First unload the nvidia module by logging in as root in a terminal. Terminal output of cat /proc/acpi/bbswitch should be OFF after this step.

systemctl restart bumblebeed 

2. Uninstall the nvidia module

/usr/sbin/bumblebee-nvidia --debug --uninstall

3. modinfo nvidia probably gives you an output similar to this

[root@localhost ~]# modinfo nvidia
filename:       /lib/modules/3.11.8-300.fc20.x86_64/kernel/drivers/video/nvidia.ko
modinfo: ERROR: could not get modinfo from 'nvidia': No such file or directory

4. Prepare to compile the nvidia driver at restart for the current kernel and reboot the system

[root@localhost ~]# touch /etc/sysconfig/nvidia/compile-nvidia-driver
[root@localhost ~]# reboot

5. Post reboot should give the modinfo output something similar to this and you should be able to use optirun as intended.

@localhost ~]$ modinfo nvidia
filename:       /lib/modules/3.11.8-300.fc20.x86_64/kernel/drivers/video/nvidia.ko
alias:          char-major-195-*
version:        331.20
supported:      external
license:        NVIDIA
alias:          pci:v000010DEd00000E00sv*sd*bc04sc80i00*
alias:          pci:v000010DEd00000AA3sv*sd*bc0Bsc40i00*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        drm,i2c-core
vermagic:       3.11.8-300.fc20.x86_64 SMP mod_unload 
parm:           NVreg_Mobile:int
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_RemapLimit:int
parm:           NVreg_UpdateMemoryTypes:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_RMEdgeIntrCheck:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_MapRegistersEarly:int
parm:           NVreg_RegisterForACPIEvents:int
parm:           NVreg_CheckPCIConfigSpace:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RmMsg:charp.
parm:           NVreg_AssignGpus:charp

Make sure your nvidia module is unloaded when you do this steps. For some repeating the steps a couple of times was necessary.

Useful links