From Fedora Project Wiki

(Install Dependencies)
Line 5: Line 5:
 
== Installation ==
 
== Installation ==
  
===Install Dependencies===
+
=== How can you tell if you have an optimus notebook computer? ===
 +
 
 +
If you purchased a notebook with an NVidia sticker on it, you ''might'' have a optimus computer. If you don’t have an optimus technology computer nothing in this documentation is relevant to your PC. (Optimus was slated at one point to go in desktop PCs but the industry ended up rejecting that concept…)
 +
 
 +
To tell, after you have installed the OS, open a terminal window and type:
  
'''Fedora 22'''
 
 
<pre>
 
<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
+
$ lspci | grep VGA
 
</pre>
 
</pre>
  
'''Fedora 20/21'''
+
If you see two video cards in the output like:
 +
 
 
<pre>
 
<pre>
# 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
+
$ lspci | grep VGA
 +
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
 +
01:00.0 VGA compatible controller: NVIDIA Corporation GK208M [GeForce GT 730M] (rev ff)
 
</pre>
 
</pre>
  
 +
And one is a Intel “Integrated Graphics Controller” and the other is a “NVIDIA Corporation” chip, then you probably have an optimus notebook.
  
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.
+
To further verify, if you have the two VGA devices with one as Intel Integrated and other as NVIDIA, as root look for the /sys/kernel/debug/vgaswitcheroo/switch file. If it exists, then you have an optimus PC. If its missing, then you do not.
  
'''Fedora 22'''
+
=== Before you get started ===
<pre># dnf -y install VirtualGL </pre>
 
  
'''Fedora 20/21'''
+
Most users will want to turn off “Secure boot” in the bios or UEFI screen if you need nvidia drivers or bbswitch-dkms. If you want to make your own public / private keys for kernel module signing you can look [https://docs.fedoraproject.org/en-US/Fedora/22/html/System_Administrators_Guide/sect-signing-kernel-module-with-the-private-key.html here] or [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-signing-kernel-modules-for-secure-boot.html here] for more information on the subject. If you end up doing that and use the closed source NVidia driver, you will need to edit the /etc/bumblebee/bumblebee-nvidia-sign.conf file.
<pre># yum -y install VirtualGL </pre>
 
  
 +
Next, do a yum update or a dnf update before you begin. And just to be safe, reboot your PC so that you are booted into the newest kernel. You only need to yum update or dnf update and a reboot if you are using bbswitch-dkms and / or the closed source NVidia video drivers. The reason for this is that you want the kernel-devel package to match the kernel you are running under. If you don’t reboot after a yum / dnf update these versions may differ which will cause compiling problems.
  
If you want to run 32 bit apps on your 64 bit system, then also install the 32-bit VirtualGL package.
 
  
'''Fedora 22'''
+
=== For Free or Open Source solution ===
<pre># dnf -y install VirtualGL.i686 </pre>
 
  
'''Fedora 20/21'''
+
Some users [http://www.kroah.com/log/linux/stable_api_nonsense.html feel strongly] that they should not use closed source kernel modules. This is understandable. In almost all cases, [http://nouveau.freedesktop.org/wiki/Optimus/ PRIME] will work better then using bumblebee with the nouveau module as far as raw FPS (Frames Per Second) in a given OpenGL application.
<pre># yum -y install VirtualGL.i686 </pre>
 
  
 +
There exists certain notebooks that have a “VGA-1-2 connected” when listing displays with xrandr. This “bogus” display prevents “PRIME” from working properly on certain notebooks.
 +
One is able able to disable this “bogus” connected display on these notebooks by adding:
 +
 +
<pre>
 +
video=VGA-2:d
 +
</pre>
  
Now, you are ready to install the Bumblebee dnf|yum repository, drivers, and software packages.
+
To the kernel command line by editing /etc/default/grub and then running “grub2-mkconfig -o /boot/grub2/grub.cfg” if you have a BIOS based notebook or by running “grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg” if you have a UEFI based notebook. You might need to do this to get your notebook working with PRIME properly so that the kernel can shutoff the card when its not in use.
  
=== Install Bumblebee for Nouveau ===
+
You can verify this by typing:
To use bumblebee with the free nouveau video drivers (the default in Fedora, initially), install the bumblebee free-software repo and packages.
 
  
==== Fedora 22 ====
 
 
<pre>
 
<pre>
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
+
$ xrandr
# dnf -y install bbswitch bumblebee
 
 
</pre>
 
</pre>
  
==== Fedora 21 ====
+
Look for:
 +
 
 
<pre>
 
<pre>
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
+
VGA-1-2 connected ...
# yum -y install bbswitch bumblebee
 
 
</pre>
 
</pre>
  
==== Fedora 20 ====
+
After you edit your kernel command line, reboot and type as root:
 +
 
 
<pre>
 
<pre>
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
+
# cat /sys/kernel/debug/vgaswitcheroo/switch
# yum -y install bbswitch bumblebee
 
 
</pre>
 
</pre>
  
=== Install Bumblebee for NVIDIA proprietary drivers ===
+
and look for:
  
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.
+
<pre>
 +
0:IGD:+:Pwr:0000:00:02.0
 +
1:DIS: :DynOff:0000:01:00.0
 +
</pre>
  
==== Fedora 22 ====
+
'''DIS''' stands for your '''Discrete GPU''', which on a optimus laptop is the NVidia GPU. We want it to be ” DynOff” which means its off and saving power.
 +
 
 +
 
 +
So even though I encourage you to use PRIME if you want to use the nouveau module as 100% free solution I will still explain how to use bumblebee with nouveau in case you have a weird reason for wanting to use it that I did not think of…
 +
 
 +
=== For Free / Open Source solution fedora ===
 +
 
 +
 
 +
Please NOTE: bumblebee + nouveau '''does not work''' with the [https://en.wikipedia.org/wiki/GNOME_Display_Manager GDM login manager] in fedora 22+. So you will probably need to use some other login manager if you need this to work such as lightdm or kdm. It broke after gdm-3.14.2 and before or in gdm-3.16.1.1. I have not had a chance to bisect this bug yet. I am unsure if this is fedora specific or if it affects other distros. GDM does work ok with the closed source solution which we will discuss later in this documentation.
 +
 
 +
Add bumblebee repo: (depending on what release you are on)
 +
 
 +
'''fedora 21:'''
 +
<pre>
 +
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
 +
</pre>
 +
'''fedora 22:'''
 
<pre>
 
<pre>
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
+
# dnf -y --nogpgcheck 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
+
</pre>
# dnf -y install bbswitch bumblebee bumblebee-nvidia
+
'''fedora 23:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora23/noarch/bumblebee-release-1.2-1.noarch.rpm
 +
</pre>
 +
 
 +
bumblebee + nouveau drivers, fedora 21.
 +
 
 +
<pre>
 +
# yum install bumblebee-nouveau
 +
</pre>
 +
 
 +
or optionally
 +
 
 +
<pre>
 +
# yum install bumblebee-nouveau bbswitch-dkms kernel-devel
 
</pre>
 
</pre>
  
==== Fedora 21 ====
+
bumblebee + nouveau drivers, fedora 22+.
 +
 
 
<pre>
 
<pre>
# yum -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora21/noarch/bumblebee-release-1.2-1.noarch.rpm
+
# dnf install bumblebee-nouveau
# 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 ====
+
or optionally
 +
 
 +
<pre>
 +
# dnf install bumblebee-nouveau bbswitch-dkms kernel-devel
 +
</pre>
 +
 
 +
 
 +
bbswitch-dkms (bbswitch module) is an “out of tree” kernel module that is not strictly required to use bumblebee with the nouveau module. But some user’s might like its easy interface for disabling or enabling the NVidia chip. It is [http://nouveau.freedesktop.org/wiki/Optimus/ discussed very briefly] on the nouveau optimus wiki page for older kernels, for example. bbswitch is GPLV3 but it is "out of tree" so you may wish to avoid it if you have a problem with out of tree modules.
 +
 
 +
You will need to reboot before you can test if bumblebee + nouveau is working.
 +
 
 +
 
 +
=== For closed source solution ===
 +
 
 +
Do not use the NVidia video drivers from '''http://rpmfusion.org/''', '''http://negativo17.org/'''. I’m sure they are fine drivers and I am not trying to criticize them at all. But they DO NOT support or work with bumblebee without modifications. I have created a pair of drivers packages you may use that require no modifications to work. There is a managed version which contains a reasonably recent “long lived branch” driver blob. There is also a unmanaged repo which contains an empty drivers package. The unmanaged version requires you to download a “blob” from [http://www.nvidia.com/object/unix.html here] and then copy the file manually to the /etc/sysconfig/nvidia/ directory as root. You might need the “unmanaged” version if your laptop requires a “legacy” driver version or if you need the “short lived branch” driver for some reason. Do not install both the managed and unmanaged repos. You should pick one or the other depending on your needs. If you are unsure which to use, use the managed repo.
 +
 
 +
 
 +
'''Special note concerning “short lived branch” version 355.11+:'''
 +
 
 +
There is a bug which prevents the short lived branch version from working with the unmanaged version of the bumblebee-nvidia shell script wrapper. I have opened a discussion thread [https://devtalk.nvidia.com/default/topic/885657/linux/can-t-install-driver-to-work-with-bumblebee-with-version-355-11/ here] concerning this problem. It remains unknown if NVidia engineers are allowed to work on this bug. We’ll just have to wait and see what happens with that. If this version of the installer gets moved into the “long lived branch” with the bug intact I will probably retire these packages and move on and stop supporting bumblebee as these packages will no longer be viable in an easy to use way. (Sorry, there may be a VERY UGLY way to hack around it but it would have to become a “run it by hand every time your kernel updates” kind of solution which I have little interest in supporting…)
 +
 
 +
We’ll have to see if they were sincere [http://www.phoronix.com/scan.php?page=news_item&px=MTEyMjk in this press release] or if it was just more of a public relations move.
 +
 
 +
 
 +
 
 +
=== For closed source solution fedora ===
 +
 
 +
Add bumblebee repo: (depending on what release you are on)
 +
 
 +
'''fedora 21:'''
 
<pre>
 
<pre>
# 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/fedora21/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
+
</pre>
# yum -y install bbswitch bumblebee bumblebee-nvidia
+
'''fedora 22:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
 +
</pre>
 +
'''fedora 23:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora23/noarch/bumblebee-release-1.2-1.noarch.rpm
 
</pre>
 
</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.
 
  
=== Install Bumblebee for non-standard or legacy NVIDIA proprietary drivers ===
+
Managed NVidia repo: (depending on what release you are on)
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 ====
+
'''fedora 21:'''
 
<pre>
 
<pre>
# dnf -y install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora22/noarch/bumblebee-release-1.2-1.noarch.rpm
+
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora21/noarch/bumblebee-nonfree-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
+
</pre>
# dnf -y install bbswitch bumblebee bumblebee-nvidia
+
'''fedora 22:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora22/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
 +
</pre>
 +
'''fedora 23:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree/fedora23/noarch/bumblebee-nonfree-release-1.2-1.noarch.rpm
 
</pre>
 
</pre>
  
==== Fedora 21 ====
+
or Unmanaged NVidia repo: (depending on what release you are on)
 +
 
 +
'''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 --nogpgcheck 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 http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora21/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
+
</pre>
# yum -y install bbswitch bumblebee bumblebee-nvidia
+
'''fedora 22:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora22/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
 +
</pre>
 +
'''fedora 23:'''
 +
<pre>
 +
# dnf -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee-nonfree-unmanaged/fedora23/noarch/bumblebee-nonfree-unmanaged-release-1.2-1.noarch.rpm
 
</pre>
 
</pre>
  
==== Fedora 20 ====
+
'''Remember, you do not want to install both the managed and unmanaged repos. Pick one or the other but not both!
 +
'''
 +
 
 +
No multilib fedora 21:
 +
 
 
<pre>
 
<pre>
# yum -y --nogpgcheck install http://install.linux.ncsu.edu/pub/yum/itecs/public/bumblebee/fedora20/noarch/bumblebee-release-1.2-1.noarch.rpm
+
# dnf install bumblebee-nvidia bbswitch-dkms primus kernel-devel
# 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>
  
==== Download and build NVIDIA binary drivers ====
 
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.
 
  
=== Reboot to complete installation ===
+
No multilib fedora 22+:
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):
 
 
<pre>
 
<pre>
optirun glxgears -info | grep "GL_VENDOR"
+
# dnf install bumblebee-nvidia bbswitch-dkms primus kernel-devel
 
</pre>
 
</pre>
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===
+
Multilib on a 64 bit install fedora 21: (You may need to add additional 32 bit packages to get your 32 bit applications to work with bumblebee/primus)
 +
 
 +
<pre>
 +
# yum install bumblebee-nvidia bbswitch-dkms VirtualGL.x86_64 VirtualGL.i686 primus.x86_64 primus.i686 kernel-devel
 +
</pre>
  
'''Fedora 22'''
 
<pre># dnf -y install primus</pre>
 
  
'''Fedora 20/21'''
+
Multilib on a 64 bit install fedora 22+: (You may need to add additional 32 bit packages to get your 32 bit applications to work with bumblebee/primus)
<pre># yum -y install primus</pre>
 
  
 +
<pre>
 +
# dnf install bumblebee-nvidia bbswitch-dkms VirtualGL.x86_64 VirtualGL.i686 primus.x86_64 primus.i686 kernel-devel
 +
</pre>
  
If you want to run 32 bit apps on your 64 bit system, then also install:
 
  
'''Fedora 22'''
+
You will need to reboot before you can test if its working. '''If you used the “unmanaged” repo don’t forget to copy the NVidia “blob” to /etc/sysconfig/nvidia/ before you reboot!''' Most folks will want the “managed” version rather then the “unmanaged” version.
<pre># dnf -y install primus.i686</pre>
 
  
'''Fedora 20/21'''
 
<pre># yum -y install primus.i686</pre>
 
  
=== Testing primus ===
+
== Using bumblebee software ==
Open up a terminal and run:
 
<pre>PRIMUS_VERBOSE=2 optirun -b primus glxgears -info</pre>
 
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'''
  
General Usage:
 
 
<pre>
 
<pre>
optirun [options] <application> [application-parameters]
+
$ optirun [options] application [application-parameters]
 
</pre>
 
</pre>
  
If you installed primus, then you can use the following command to take advantage of it:
+
For example, start a Windows applications with optimus named application.exe:
 +
 
 
<pre>
 
<pre>
optirun -b primus <application> [application-parameters]
+
$ optirun wine application.exe
 
</pre>
 
</pre>
  
Start Windows applications:
+
For another example, open NVidia settings panel with optimus:
 +
 
 
<pre>
 
<pre>
optirun wine <windows application>.exe
+
$ optirun -b none nvidia-settings -c :8
 
</pre>
 
</pre>
  
with primus:
+
For another example, open the java based Minecraft with primus bridge:
 +
 
 
<pre>
 
<pre>
optirun -b primus wine <windows application>.exe
+
$ optirun -b primus java -jar /PATH/TO/Minecraft.jar
 
</pre>
 
</pre>
  
By default, primus renders up to 60 fps. To render more frames per second:
+
For a list of the options for optirun, view its manual page:
 +
 
 
<pre>
 
<pre>
vblank_mode=0 optirun -b primus <application> [application-parameters]
+
$ man optirun
 
</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.
+
In general, using the primus bridge gives better performance then using the default VirtualGL bridge. But primus only works with the closed source NVidia driver so you need to take that into consideration.
 +
 
 +
For primus, there is a separate shell script you can use to invoke it called “primusrun.”
 +
 
 +
For a list of the options for primusrun, view its manual page:
 +
 
 +
<pre>
 +
$ man primusrun
 +
</pre>
 +
 
 +
<pre>
 +
$ primusrun java -jar /PATH/TO/Minecraft.jar
 +
</pre>
 +
 
 +
and
 +
 
 +
<pre>
 +
$ optirun -b primus java -jar /PATH/TO/Minecraft.jar
 +
</pre>
 +
 
 +
are functionally equivalent commands.
 +
 
 +
It may become tedious to always use the optirun program in a terminal to launch 3D games or other 3D opengl applications. You may wish to create desktop launchers which use the optirun or primusrun commands in order to streamline this process.
 +
 
 +
For example, in MATE desktop environment, when you right click on an empty space in the desktop a popup menu is displayed. One option on this menu is “Create launcher..” which allows you to create a graphical launcher icon for your apps which can be left on the desktop or moved into some folder. Other desktop environments also offer this functionality though the methods differ from desktop to desktop.
 +
 
 +
== Multi monitor setup with closed driver, fedora 22 or later ==
 +
 
 +
These notes only work in fedora 22+ as the intel-gpu-tools rpm only became available in fedora 22. Earlier releases of fedora lack this rpm.
 +
 
 +
Optimus laptops have two video chips: an integrated Intel and a discrete NVidia one. If the port (DisplayPort / HDMI / VGA) is wired to the Intel chip, you do not need to do anything special to get external monitors to work.
 +
 
 +
When the external port is wired into the NVidia chip, you cannot currently expand the screen over monitors without extra effort. Read on if you fall into this category…
 +
 
 +
Install the intel-gpu-tools package.
 +
 
 +
<pre>
 +
# dnf install intel-gpu-tools
 +
</pre>
 +
 
 +
Running ‘intel-virtual-output’ (from the intel-gpu-tools rpm) without any extra parameters will daemonize itself and detect attached displays in the background. It will then perform all the trickery of virtualizing and cloning so that the newly attached screen can be used via conventional screen management methods, such as cloning/extending with xrandr.
 +
 
 +
For example, if your laptop’s display is called eDP1, and your using a external adapter called HDMI1, and you wanted the display to be 1920×1080 resolution, you could run the following commands:
 +
 
 +
To have your HDMI screen to the right of your desktop, run:
 +
 
 +
<pre>
 +
$ xrandr –output eDP1 –mode 1920×1080 –output HDMI1 –mode 1920×1080 –right-of eDP1
 +
</pre>
 +
 
 +
To clone your desktop, run:
 +
 
 +
<pre>
 +
$ xrandr –output eDP1 –mode 1920×1080 –output HDMI1 –mode 1920×1080 –same-as eDP1
 +
</pre>
 +
 
 +
 
 +
There are many different possibilities. Type xrandr with no arguments to see what displays you have attached. See [https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor-setup this web page] for further information on this subject. Read the manual page for xrandr for even more information on the possibilities this command provides.
 +
 
 +
If intel-virtual-output works ok running by hand you could add it to your startup automatically if you desire. One way would be to create a /etc/rc.d/rc.local script and add it into there. Another way might be to create a systemd unit file as Type=oneshot. A third way might be to run it at login using whatever mechanism your desktop environment supports for doing such things. For example, in MATE desktop environment, there is a mate-session-properties program (System -> Preferences -> Personal -> Startup Applications) that you can run programs from when you login. Most desktop environments offer similar functionality though the methods differ from desktop to desktop.
 +
 
 +
intel-virtual-output is only available in fedora 22+
  
 
== Troubleshooting ==
 
== Troubleshooting ==
  
=== Unable to use optirun with nouveau ===
+
If you are using the closed source NVidia drivers, there is a checking system you can run. To test, type this command:
  
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:
 
 
<pre>
 
<pre>
[user1@localhost ~]$ DRI_PRIME=0 glxgears -info | grep "GL_VENDOR"
+
$ bumblebee-nvidia --check
[user1@localhost ~]$ DRI_PRIME=1 glxgears -info | grep "GL_VENDOR"
 
 
</pre>
 
</pre>
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 ===
+
This will tell you if the NVidia driver and bbswitch-dkms compiled into the current kernel ok. It works with both the managed and unmanaged driver packages.
Most of the information presented here was suggested by bumblebee maintainer Gary Gatling.
+
 
 +
Some other errors you may encounter form the output from bumblebee-nvidia –check
  
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
+
Error: Too many NVidia blobs in /etc/sysconfig/nvidia/
[  52.410461] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
+
Blob count = 2.
[  52.411039] [INFO]Configured driver: nvidia
+
</pre>
[  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
+
This means that there are too many NVidia “blobs” in /etc/sysconfig/nvidia/ and the solution is to delete one of them.
  
[  52.434763] [DEBUG]Socket closed.
+
<pre>
[  52.434781] [ERROR]Aborting because fallback start is disabled.
+
Error: No Nvidia blob in /etc/sysconfig/nvidia/
[   52.434787] [DEBUG]Killing all remaining processes.
+
</pre>
 +
 
 +
This means there is no blob in /etc/sysconfig/nvidia/ and you should copy one there if using the unmanaged repo or re-install bumblebee-nvidia if using the managed repo. (dnf reinstall bumblebee-nvidia)
 +
 
 +
If the module did not compile, you can run:
 +
<pre>
 +
# bumblebee-nvidia --debug
 +
</pre>
 +
 
 +
as root or via sudo. This may give you clues as to why the nvidia installer was unable to work.
 +
 
 +
Type
 +
 
 +
<pre>
 +
$ bumblebee-nvidia --help
 +
</pre>
 +
 
 +
to see a full list of options the wrapper script provides.
 +
 
 +
If you see this error:
 +
 
 +
<pre>
 +
[ERROR]You've no permission to communicate with the Bumblebee daemon. Try adding yourself to the 'bumblebee' group
 +
[ERROR]Could not connect to bumblebee daemon - is it running?
 +
</pre>
 +
 
 +
It could be caused by adding another user account to your notebook after you have already installed the various bumblebee packages. The solution is to run:
 +
 
 +
<pre>
 +
# usermod -a -G bumblebee USERNAME
 
</pre>
 
</pre>
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.
+
where '''USERNAME''' is your account name to add to the bumblebee group. You MUST be in the bumblebee group for primusrun or optirun to work.
<pre>systemctl restart bumblebeed </pre>
+
 
2. Uninstall the nvidia module
+
'''Primusrun mouse delay/disable VSYNC'''
<pre>/usr/sbin/bumblebee-nvidia --debug --uninstall
+
 
 +
For primusrun, VSYNC is enabled by default and as a result, it could make mouse input delay lag or even slightly decrease performance. Test primusrun without VSYNC:
 +
 
 +
<pre>
 +
$ vblank_mode=0 primusrun glxgears
 +
</pre>
 +
 
 +
'''Primus issues under compositing window managers'''
 +
 
 +
Since compositing hurts performance, invoking primus when a compositing WM is active is [https://github.com/amonakov/primus#issues-under-compositing-wms 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:
 +
 
 +
<pre>
 +
$ PRIMUS_SYNC=1 primusrun ...
 
</pre>
 
</pre>
3. modinfo nvidia probably gives you an output similar to this
+
 
<pre>[root@localhost ~]# modinfo nvidia
+
'''optirun crashes after you boot into “Troubleshooting -> Start Fedora Live in basic graphics mode” and do an install that way.'''
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
+
If you did an install under “Troubleshooting -> Start Fedora Live in basic graphics mode.” bumblebee will not work. You can tell by examining the /var/log/Xorg.8.log log file and looking for Kernel command line: and seeing nomodeset on that line. When you use “Start Fedora Live in basic graphics mode.” it adds “nomodeset” to your kernel command line which will cause your machine to use the VESA driver and make bumblebee not work. (It will just crash when you try) To fix that, edit /etc/default/grub and on the GRUB_CMDLINE_LINUX= line, remove the word nomodeset and then save the file, next, either run
 +
 
 +
<pre>
 +
# grub2-mkconfig -o /boot/grub2/grub.cfg
 
</pre>
 
</pre>
4. Prepare to compile the nvidia driver at restart for the current kernel and reboot the system
 
<pre>[root@localhost ~]# touch /etc/sysconfig/nvidia/compile-nvidia-driver
 
[root@localhost ~]# reboot
 
  
 +
on a BIOS based notebook or
 +
 +
<pre>
 +
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
 
</pre>
 
</pre>
5. Post reboot should give the modinfo output something similar to this and you should be able to use optirun as intended.
 
<pre>@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</pre>
 
  
Make sure your nvidia module is unloaded when you do this steps. For some repeating the steps a couple of times was necessary.
+
on a UEFI based notebook. Then reboot. After that bumblebee/optirun/primusrun should start working.
 +
 
 +
== Quick note concerning bbswitch and bbswitch-dkms packages ==
 +
 
 +
There was a package called “bbswitch” in the yum repo which was not very well made. It has been re-written and the new package is called bbswitch-dkms. In all cases you should use the bbswitch-dkms package instead of the bbswitch package. bbswitch-dkms works better at updating then the old bbswitch package did.
  
 
== Useful links ==
 
== Useful links ==
* http://techies.ncsu.edu/wiki/bumblebee
+
* https://www.linux.ncsu.edu/bumblebee/
 
* http://bumblebee-project.org/
 
* http://bumblebee-project.org/
 
* https://github.com/Bumblebee-Project/Bumblebee/wiki
 
* https://github.com/Bumblebee-Project/Bumblebee/wiki
 +
* https://github.com/Bumblebee-Project/Bumblebee/
 +
* https://github.com/Bumblebee-Project/bbswitch
 +
* https://github.com/amonakov/primus
 +
[http://www.thelinuxrain.com/articles/the-state-of-nvidia-optimus-on-linux The State of NVIDIA Optimus on Linux]

Revision as of 20:08, 22 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

How can you tell if you have an optimus notebook computer?

If you purchased a notebook with an NVidia sticker on it, you might have a optimus computer. If you don’t have an optimus technology computer nothing in this documentation is relevant to your PC. (Optimus was slated at one point to go in desktop PCs but the industry ended up rejecting that concept…)

To tell, after you have installed the OS, open a terminal window and type:

$ lspci | grep VGA

If you see two video cards in the output like:

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GK208M [GeForce GT 730M] (rev ff)

And one is a Intel “Integrated Graphics Controller” and the other is a “NVIDIA Corporation” chip, then you probably have an optimus notebook.

To further verify, if you have the two VGA devices with one as Intel Integrated and other as NVIDIA, as root look for the /sys/kernel/debug/vgaswitcheroo/switch file. If it exists, then you have an optimus PC. If its missing, then you do not.

Before you get started

Most users will want to turn off “Secure boot” in the bios or UEFI screen if you need nvidia drivers or bbswitch-dkms. If you want to make your own public / private keys for kernel module signing you can look here or here for more information on the subject. If you end up doing that and use the closed source NVidia driver, you will need to edit the /etc/bumblebee/bumblebee-nvidia-sign.conf file.

Next, do a yum update or a dnf update before you begin. And just to be safe, reboot your PC so that you are booted into the newest kernel. You only need to yum update or dnf update and a reboot if you are using bbswitch-dkms and / or the closed source NVidia video drivers. The reason for this is that you want the kernel-devel package to match the kernel you are running under. If you don’t reboot after a yum / dnf update these versions may differ which will cause compiling problems.


For Free or Open Source solution

Some users feel strongly that they should not use closed source kernel modules. This is understandable. In almost all cases, PRIME will work better then using bumblebee with the nouveau module as far as raw FPS (Frames Per Second) in a given OpenGL application.

There exists certain notebooks that have a “VGA-1-2 connected” when listing displays with xrandr. This “bogus” display prevents “PRIME” from working properly on certain notebooks. One is able able to disable this “bogus” connected display on these notebooks by adding:

video=VGA-2:d

To the kernel command line by editing /etc/default/grub and then running “grub2-mkconfig -o /boot/grub2/grub.cfg” if you have a BIOS based notebook or by running “grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg” if you have a UEFI based notebook. You might need to do this to get your notebook working with PRIME properly so that the kernel can shutoff the card when its not in use.

You can verify this by typing:

$ xrandr

Look for:

VGA-1-2 connected ...

After you edit your kernel command line, reboot and type as root:

# cat /sys/kernel/debug/vgaswitcheroo/switch

and look for:

0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynOff:0000:01:00.0

DIS stands for your Discrete GPU, which on a optimus laptop is the NVidia GPU. We want it to be ” DynOff” which means its off and saving power.


So even though I encourage you to use PRIME if you want to use the nouveau module as 100% free solution I will still explain how to use bumblebee with nouveau in case you have a weird reason for wanting to use it that I did not think of…

For Free / Open Source solution fedora

Please NOTE: bumblebee + nouveau does not work with the GDM login manager in fedora 22+. So you will probably need to use some other login manager if you need this to work such as lightdm or kdm. It broke after gdm-3.14.2 and before or in gdm-3.16.1.1. I have not had a chance to bisect this bug yet. I am unsure if this is fedora specific or if it affects other distros. GDM does work ok with the closed source solution which we will discuss later in this documentation.

Add bumblebee repo: (depending on what release you are on)

fedora 21:

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

fedora 22:

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

fedora 23:

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

bumblebee + nouveau drivers, fedora 21.

# yum install bumblebee-nouveau

or optionally

# yum install bumblebee-nouveau bbswitch-dkms kernel-devel

bumblebee + nouveau drivers, fedora 22+.

# dnf install bumblebee-nouveau

or optionally

# dnf install bumblebee-nouveau bbswitch-dkms kernel-devel


bbswitch-dkms (bbswitch module) is an “out of tree” kernel module that is not strictly required to use bumblebee with the nouveau module. But some user’s might like its easy interface for disabling or enabling the NVidia chip. It is discussed very briefly on the nouveau optimus wiki page for older kernels, for example. bbswitch is GPLV3 but it is "out of tree" so you may wish to avoid it if you have a problem with out of tree modules.

You will need to reboot before you can test if bumblebee + nouveau is working.


For closed source solution

Do not use the NVidia video drivers from http://rpmfusion.org/, http://negativo17.org/. I’m sure they are fine drivers and I am not trying to criticize them at all. But they DO NOT support or work with bumblebee without modifications. I have created a pair of drivers packages you may use that require no modifications to work. There is a managed version which contains a reasonably recent “long lived branch” driver blob. There is also a unmanaged repo which contains an empty drivers package. The unmanaged version requires you to download a “blob” from here and then copy the file manually to the /etc/sysconfig/nvidia/ directory as root. You might need the “unmanaged” version if your laptop requires a “legacy” driver version or if you need the “short lived branch” driver for some reason. Do not install both the managed and unmanaged repos. You should pick one or the other depending on your needs. If you are unsure which to use, use the managed repo.


Special note concerning “short lived branch” version 355.11+:

There is a bug which prevents the short lived branch version from working with the unmanaged version of the bumblebee-nvidia shell script wrapper. I have opened a discussion thread here concerning this problem. It remains unknown if NVidia engineers are allowed to work on this bug. We’ll just have to wait and see what happens with that. If this version of the installer gets moved into the “long lived branch” with the bug intact I will probably retire these packages and move on and stop supporting bumblebee as these packages will no longer be viable in an easy to use way. (Sorry, there may be a VERY UGLY way to hack around it but it would have to become a “run it by hand every time your kernel updates” kind of solution which I have little interest in supporting…)

We’ll have to see if they were sincere in this press release or if it was just more of a public relations move.


For closed source solution fedora

Add bumblebee repo: (depending on what release you are on)

fedora 21:

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

fedora 22:

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

fedora 23:

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


Managed NVidia repo: (depending on what release you are on)

fedora 21:

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

fedora 22:

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

fedora 23:

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

or Unmanaged NVidia repo: (depending on what release you are on)

fedora 21:

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

fedora 22:

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

fedora 23:

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

Remember, you do not want to install both the managed and unmanaged repos. Pick one or the other but not both!

No multilib fedora 21:

# dnf install bumblebee-nvidia bbswitch-dkms primus kernel-devel


No multilib fedora 22+:

# dnf install bumblebee-nvidia bbswitch-dkms primus kernel-devel


Multilib on a 64 bit install fedora 21: (You may need to add additional 32 bit packages to get your 32 bit applications to work with bumblebee/primus)

# yum install bumblebee-nvidia bbswitch-dkms VirtualGL.x86_64 VirtualGL.i686 primus.x86_64 primus.i686 kernel-devel


Multilib on a 64 bit install fedora 22+: (You may need to add additional 32 bit packages to get your 32 bit applications to work with bumblebee/primus)

# dnf install bumblebee-nvidia bbswitch-dkms VirtualGL.x86_64 VirtualGL.i686 primus.x86_64 primus.i686 kernel-devel


You will need to reboot before you can test if its working. If you used the “unmanaged” repo don’t forget to copy the NVidia “blob” to /etc/sysconfig/nvidia/ before you reboot! Most folks will want the “managed” version rather then the “unmanaged” version.


Using bumblebee software

General usage

$ optirun [options] application [application-parameters]

For example, start a Windows applications with optimus named application.exe:

$ optirun wine application.exe

For another example, open NVidia settings panel with optimus:

$ optirun -b none nvidia-settings -c :8

For another example, open the java based Minecraft with primus bridge:

$ optirun -b primus java -jar /PATH/TO/Minecraft.jar

For a list of the options for optirun, view its manual page:

$ man optirun

In general, using the primus bridge gives better performance then using the default VirtualGL bridge. But primus only works with the closed source NVidia driver so you need to take that into consideration.

For primus, there is a separate shell script you can use to invoke it called “primusrun.”

For a list of the options for primusrun, view its manual page:

$ man primusrun
$ primusrun java -jar /PATH/TO/Minecraft.jar

and

$ optirun -b primus java -jar /PATH/TO/Minecraft.jar

are functionally equivalent commands.

It may become tedious to always use the optirun program in a terminal to launch 3D games or other 3D opengl applications. You may wish to create desktop launchers which use the optirun or primusrun commands in order to streamline this process.

For example, in MATE desktop environment, when you right click on an empty space in the desktop a popup menu is displayed. One option on this menu is “Create launcher..” which allows you to create a graphical launcher icon for your apps which can be left on the desktop or moved into some folder. Other desktop environments also offer this functionality though the methods differ from desktop to desktop.

Multi monitor setup with closed driver, fedora 22 or later

These notes only work in fedora 22+ as the intel-gpu-tools rpm only became available in fedora 22. Earlier releases of fedora lack this rpm.

Optimus laptops have two video chips: an integrated Intel and a discrete NVidia one. If the port (DisplayPort / HDMI / VGA) is wired to the Intel chip, you do not need to do anything special to get external monitors to work.

When the external port is wired into the NVidia chip, you cannot currently expand the screen over monitors without extra effort. Read on if you fall into this category…

Install the intel-gpu-tools package.

# dnf install intel-gpu-tools

Running ‘intel-virtual-output’ (from the intel-gpu-tools rpm) without any extra parameters will daemonize itself and detect attached displays in the background. It will then perform all the trickery of virtualizing and cloning so that the newly attached screen can be used via conventional screen management methods, such as cloning/extending with xrandr.

For example, if your laptop’s display is called eDP1, and your using a external adapter called HDMI1, and you wanted the display to be 1920×1080 resolution, you could run the following commands:

To have your HDMI screen to the right of your desktop, run:

$ xrandr –output eDP1 –mode 1920×1080 –output HDMI1 –mode 1920×1080 –right-of eDP1

To clone your desktop, run:

$ xrandr –output eDP1 –mode 1920×1080 –output HDMI1 –mode 1920×1080 –same-as eDP1


There are many different possibilities. Type xrandr with no arguments to see what displays you have attached. See this web page for further information on this subject. Read the manual page for xrandr for even more information on the possibilities this command provides.

If intel-virtual-output works ok running by hand you could add it to your startup automatically if you desire. One way would be to create a /etc/rc.d/rc.local script and add it into there. Another way might be to create a systemd unit file as Type=oneshot. A third way might be to run it at login using whatever mechanism your desktop environment supports for doing such things. For example, in MATE desktop environment, there is a mate-session-properties program (System -> Preferences -> Personal -> Startup Applications) that you can run programs from when you login. Most desktop environments offer similar functionality though the methods differ from desktop to desktop.

intel-virtual-output is only available in fedora 22+

Troubleshooting

If you are using the closed source NVidia drivers, there is a checking system you can run. To test, type this command:

$ bumblebee-nvidia --check

This will tell you if the NVidia driver and bbswitch-dkms compiled into the current kernel ok. It works with both the managed and unmanaged driver packages.

Some other errors you may encounter form the output from bumblebee-nvidia –check

Error: Too many NVidia blobs in /etc/sysconfig/nvidia/
Blob count = 2.

This means that there are too many NVidia “blobs” in /etc/sysconfig/nvidia/ and the solution is to delete one of them.

Error: No Nvidia blob in /etc/sysconfig/nvidia/

This means there is no blob in /etc/sysconfig/nvidia/ and you should copy one there if using the unmanaged repo or re-install bumblebee-nvidia if using the managed repo. (dnf reinstall bumblebee-nvidia)

If the module did not compile, you can run:

# bumblebee-nvidia --debug

as root or via sudo. This may give you clues as to why the nvidia installer was unable to work.

Type

$ bumblebee-nvidia --help

to see a full list of options the wrapper script provides.

If you see this error:

[ERROR]You've no permission to communicate with the Bumblebee daemon. Try adding yourself to the 'bumblebee' group
[ERROR]Could not connect to bumblebee daemon - is it running?

It could be caused by adding another user account to your notebook after you have already installed the various bumblebee packages. The solution is to run:

# usermod -a -G bumblebee USERNAME

where USERNAME is your account name to add to the bumblebee group. You MUST be in the bumblebee group for primusrun or optirun to work.

Primusrun mouse delay/disable VSYNC

For primusrun, VSYNC is enabled by default and as a result, it could make mouse input delay lag or even slightly decrease performance. Test primusrun without VSYNC:

$ vblank_mode=0 primusrun glxgears

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

optirun crashes after you boot into “Troubleshooting -> Start Fedora Live in basic graphics mode” and do an install that way.

If you did an install under “Troubleshooting -> Start Fedora Live in basic graphics mode.” bumblebee will not work. You can tell by examining the /var/log/Xorg.8.log log file and looking for Kernel command line: and seeing nomodeset on that line. When you use “Start Fedora Live in basic graphics mode.” it adds “nomodeset” to your kernel command line which will cause your machine to use the VESA driver and make bumblebee not work. (It will just crash when you try) To fix that, edit /etc/default/grub and on the GRUB_CMDLINE_LINUX= line, remove the word nomodeset and then save the file, next, either run

# grub2-mkconfig -o /boot/grub2/grub.cfg

on a BIOS based notebook or

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

on a UEFI based notebook. Then reboot. After that bumblebee/optirun/primusrun should start working.

Quick note concerning bbswitch and bbswitch-dkms packages

There was a package called “bbswitch” in the yum repo which was not very well made. It has been re-written and the new package is called bbswitch-dkms. In all cases you should use the bbswitch-dkms package instead of the bbswitch package. bbswitch-dkms works better at updating then the old bbswitch package did.

Useful links

The State of NVIDIA Optimus on Linux