Although openSUSE is an excellent distribution in its core design, the project's adherence to certain FOSS principles prevent it from installing proprietary packages by default. This includes packages necessary to enable the proprietary Nvidia drivers through the Nvidia kernel modules. This limitation includes the Nvidia drivers specifically used with the Bumblebee graphics processor switching program. Fortunately, openSUSE provides optional repositories that contain the necessary packages. This article describes how to enable the the full capabilities of the Intel/Nvidia hybrid system as much as it is possible in Linux on openSUSE Tumbleweed (Snapshot 20161204).
Many higher end laptops are built with two graphics processors -- a so called hybrid graphics system. One graphics processor is integrated in the main processor and the other is discrete. The integrated graphics processor is used for applications with less intensive graphics demands, providing the benefit of less power consumption, while the discrete graphics processor is used for applications with intensive graphics requirements, such as games, video editors, and CAD programs.
A popular hybrid graphics system is an Intel iCore main processor with an Intel integrated graphics processor and an Nvidia dedicated graphics processor. For such a system, two drivers contained in kernel modules are necessary, one to enable the integrated graphics, and another to enable the dedicated graphics. There are two options available for the Nvidia discrete processor, the open source Nouveau driver and the proprietary closed source Nvidia driver. For a hybrid system with this configuration, the openSUSE Tumbleweed installer installs and configures only the Nouveau driver -- at least this was the case when I installed Tumbleweed Snapshot 20161204 on my Acer Aspire V Nitro Black Edition (VN7-592G-70EN) -- so it is used all of the time, decreasing battery life. Unfortunately, openSUSE does not even provide users the choice to use only the open source friendly Intel driver during installation so that only the integrated Intel driver is used.However, openSUSE makes it relatively simple to manually install and configure the proprietary Nvidia driver and the Bumblebee graphics card switching program. But, sadly in Linux, the graphics switching does not happen automatically as it does in Windows, but on a per application basis, where the Intel card is used by default and when necessary, a program can be started and instructed to use the Nvidia card.
This article discusses configuring this type of hybrid system on openSUSE Tumbleweed in order to take as full advantage of the hardware as is possible on Linux. Some precautions may be necessary as the openSUSE Tumbleweed portal warns against using the proprietary Nvidia driver with Tumbleweed because kernel developement and packaging moves faster than Nvidia driver developement and packaging, meaning that the kernel may be updated but not the Nvidia driver such that the available Nvidia driver will not work with the updated kernel. A precaution I would take to work around this situation is to make sure certain older versions of the kernel are retained after an update to allow booting into an older kernel if the updated kernel will not work with the updated driver. Note that even in this scenario, there will always be video since the integrated graphics processor is used by default in the hybrid setup.
The overall process including the zypper configuration is simple, as shown below.
The warning on the openSUSE Tumbleweed portal concerns the possibility of a scenario where the kernel may be updated but the Nvidia driver from which the kernel module is built is not updated. Since kernel modules are specifically built for a certain kernel version or versions, if this scenario occurs users will confront some video problems including a black screen when booting after an update. This warning only applies when using the standalone Nvidia driver because in a hybrid system the Nvidia driver is activated optionaly and secondarily to the Intel driver which is always available. Althout a user may not be confronted with a black screen, activating a program using the discrete processor will not be possible. For this situation, preserving some older kernel versions on the system will allow users to boot into an older kernel that works with the available Nvidia module until an updated Nvidia driver is available.
multiversion = provides:multiversion(kernel)
should exist in the file.
multiversion.kernels = latest,latest-1,running
such that it is
multiversion.kernels = latest,latest-1,latest-2,latest-3,latest-5,latest-10,running
or whatever set of kernels you think is best.
The above change will add the third, fourth, sixth, and eleventh latest kernels as those to be perserved, increasing the liklihood that a kernel that works with an unupdated Nvidia module will be available. I think this is a beneficial modification because of the very frequent and bleeding edge kernel updates in Tumbleweed, although in the past month that I have this installation it has not been necessary.
zypper ar -f -n "Bumblebee for Tumbleweed" http://download.opensuse.org/repositories/X11:/Bumblebee/openSUSE_Tumbleweed/ Bumblebee_for_Tumbleweed
zypper
is the command line package manager, ar
is an alias for addrepo
, the options -f
and -n
, respectively, will set the repository to refresh automatically during package management operations and set the name to the string in quotes. The URL of the repository and the alias given to the repository follow. Remember that the default priority number is 99, and that the lower priority setting number, the higher the priority of that repository. See this page for some more information on openSUSE package management.
zypper mr -p 25 "Bumblebee for Tumbleweed"
mr
is an alias for modifyrepo
, the option -p
sets the priority to the number following it, and the string in quotes specifies by name the repository that is to be modified. See this page for some more information on openSUSE package management.
zypper in bumblebee
usermod -G video,bumblebee username
Or according to the message from the packagers of Bumblebee that is displayed when installing Bumblebee:
gpasswd -a username bumblebee
gpasswd -a username video
systemctl enable bumblebeed.service
zypper in -t pattern devel_kernel
zypper in dkms
systemctl enable dkms
Note that there is a specific version of the proprietary Nvidia driver for use with bumblebee. Do not use the standalone proprietary Nvidia driver. The correct version can be distinguished by the "-bumblebee" in the name, as in nvidia-bumblebee.
zypper in nvidia-bumblebee
zypper in nvidia-bumblebee-32bit
The kernel module used for the hybrid setup such that the graphics processor to be used is switched by Bumblebee is nvidia-bumblebee, not the standalone one used for non-hybrid setups, nvidia. This kernel module and the nouveau kernel module must be blacklisted so that the Nvidia kernel module for hybrid setups can run properly.
blacklist nouveau
and
blacklist nvidia
exist in /etc/modprobe.d/50-blacklist.conf, or in any file in /etc/modprobe.d/. I used /etc/modprobe.d/51-blacklist-nouveau.conf, which apparently, was created automatically but with only an entry for blacklisting nouveau. I only had to create an entry for the standalone nvidia kernel module.
mkinitrd
If everything goes as it should after following this procedure and rebooting, the integrated graphics processor will be used by default. Applications for which it is desireable to use the discrete graphics processor should be started using the optirun program.
brook@VN592G-openSUSE:~> glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
348 frames in 5.0 seconds = 69.387 FPS
301 frames in 5.0 seconds = 60.008 FPS
^C
brook@VN592G-openSUSE:~> optirun glxgears
13613 frames in 5.0 seconds = 2722.343 FPS
13456 frames in 5.0 seconds = 2691.132 FPS
13761 frames in 5.0 seconds = 2752.181 FPS
^C[ 402.870734] [WARN]Received Interrupt signal.
The above code block demonstrates the use of optirun; the first command entered at the prompt,
glxgears
runs the framerate testing program using the default graphics processor -- the integrated one. The next command,
optirun glxgears
runs the framerate testing program using the discrete graphics processor. Running the glxgears program with and without optirun program verifies that the Nvidia driver for use with Bumblebee was installed and configured properly. Both invocations of optirun should run without error and the reported framerates should be significantly higher with optirun than without.
For anyone who has a need for the best possible graphics performance in certain applications and wants to use openSUSE, this procedure is worthwile. Note the significant difference in framerates between the integrated graphics processor and the discrete graphics processor. The gain in battery life by using the Intel graphics driver instead of the default open source Nvidia driver -- Nouveau -- should also be a motivator in using this procedure. In my case battery life doubled on the Acer Aspire V Nitro Black Edition (VN7-592G-70EN).
Also good news for fans of openSUSE Tumbleweed is that, of the three distributions that I have used on this laptop with Nvidia hybrid graphics, openSUSE performed best. I set up Nvidia with Bumblebee on Ubuntu 16.04, but although the optirun test pictured above works, the frame rates were no different than when using the integrated graphics. Additionally, with Ubuntu some Nvidia configuration files needed to be edited during installation and after update. On the other distribution I have used on this computer, Manjaro, which impressively configures Nvidia with Bumblebee automatically during installation, the optirun test results were the same as with Ubuntu -- same framerates with or without the discrete graphics processor.
Despite Tumbleweed's sometimes frequent updates, so far after two or three kernel minor version updates and one kernel major version update, one Nvidia driver for Bumblebee update, and several Bumblebee updates over the past month, the worst case scenario mentioned above hasn't occured. The only problems that occured were very minor such as the need to re-enable the bumblebeed service once, and the need to reboot once after the kernel major version update before the Nvidia processor could be found when running a program with optirun. In all of these cases during boot the integrated card was used by default so there was not the catastrophic black screen situation.