Introduction
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.
Conclusion
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.
Verifying Proper Installation and Configuration of Intel/Nvidia Hybrid Graphics on openSUSE Tumbleweed
The screenshot shows openSUSE Tumbleweed with KDE Plasma 5. In the top left corner a Konsole terminal is showing the output of glxinfo | grep "OpenGL renderer and glxinfo | grep "OpenGL renderer". In the first case glxinfo is using the default graphics processor and shows that the Intel HD Graphics 530 is the "OpenGL renderer". In the second case glxinfo shows that the "OpenGL renderer" is the [Nvidia] GeForce GTX 960M -- the discrete processor. The Konsole terminal at the lower right shows the framerates when using the discrete graphics card -- over approximately forty times higher framrates.
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.