You are here
openSUSE Tumbleweed (Snapshot 20161204) Nvidia Hybrid Graphics
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.
Modify zypper Configuration to Retain Older Kernels after System Update
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.
Ensure support for multversion kernels is enabled
To do this examine and edit the file /etc/zypp/zypp.conf. The line
multiversion = provides:multiversion(kernel)
should exist in the file.
Specify the kernel versions relative to the latest that should be preserved
Modify the line
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.
Enable the Bumblebee Repository for Tumbleweed
Add the Bumblebee Project openSUSE repository for Tumbleweed
zypper ar -f -n "Bumblebee for Tumbleweed" http://download.opensuse.org/repositories/X11:/Bumblebee/openSUSE_Tumbleweed/ Bumblebee_for_Tumbleweed
Raise the priority of the Bumblebee repository
This is necessary to ensure that packages related to Bumblebee and the Nvidia driver package for use with Bumblebee only come from this repository.
zypper mr -p 25 "Bumblebee for Tumbleweed"
In the above command
zypperis the command line package manager,
aris an alias for
addrepo, the options
-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.
In the above command
mris an alias for
modifyrepo, the option
-psets 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.
Install and configure Bumblebee
This can be done with zypper using the following command.
zypper in bumblebee
Add User to Relevant Groups
Add the user to the video and bumblebee groups.
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
Enable the bumblebeed Service
systemctl enable bumblebeed.service
Install the Necessary Kernel Development Packages
Install Kernel Headers
There is more than one package that can be installed to satisfy the kernel header requirement to allow building the Nvidia proprietary driver kernel module, but I chose the simplest option in terms of determining what needs to be installed. The following seems to be the simplest option when installing, but it may make the overall system more complex with some unnecessary components.
zypper in -t pattern devel_kernel
The dkms tool is necessary to build the Nvidia driver kernel module. It can be installed with
zypper in dkms
Enable the dkms Service
systemctl enable dkms
Install and Configure the Proprietary Nvidia Driver for Use with Bumblebee.
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.
Install the nvidia-bumblebee Package
zypper in nvidia-bumblebee
Install the 32-bit nvidia-bumblebee Package
zypper in nvidia-bumblebee-32bit
Ensure Conflicting Kernel Modules Are Disabled
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.
Ensure That the nouveau and the nvidia Kernel ModulesAare Disabled.
These modules are disbled if the entries
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.
Make a New Initial Ram File System
Generate a New Initrd
Instead of using the dracut program, the simpler mkinitrd script can be used, which in turn calls dracut with simple options.
- openSUSE Nvidia-Bumblebee wiki
- Reddit User Contributed Tutorial
- Arch wiki
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,
runs the framerate testing program using the default graphics processor -- the integrated one. The next command,
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.