NVIDIA Optimus

This page explains the procedure to install the NVIDIA proprietary driver together with Bumblebee / bbswitch, which allows the use of NVIDIA's Optimus technology, in recent versions of openSUSE.

Situation There is a laptop with Optimus technology that uses a separate NVIDIA card and another integrated low power (usually Intel). You want to run programs using the independent card but you do not want to have it activated all the time to reduce the power consumption. You may also want to completely disable the independent card in laptops that do not offer this option in your BIOS.

Procedure

Preparation

Although the process is generally reliable, problems may appear after the installation and configuration process. Since openSUSE 13.2 uses the default Btrfs file system for the root partition, it is convenient to create a snapshot to have it as a recovery point if necessary.
To do this, the following command is executed in a console:

snapper create -d BeforeTheBumblebee

BeforeTheBumblebee is the name of the snapshot that will be created. It is just an example, any other can be used as long as it does not contain spaces. It is convenient that it is descriptive since, in case of problems appear and the changes have to be undone, it serves to identify the point to which the system is to be returned when it is executed snapper list.

Bumblebee with the free driver

If the graphics drivers offered by openSUSE are preferred, Bumblebee can be configured to use only the integrated Intel card and the free driver. This option does not require the installation of the NVIDIA proprietary driver.
First you have to add the repository either by using YaST or by running on a terminal (replace 42.3 with the version of openSUSE you have installed):

sudo zypper ar -f http://download.opensuse.org/repositories/X11:/Bumblebee/openSUSE_Leap_42.3/ Bumblebee

Next Bumblebee is installed:

sudo zypper in bumblebee

Now we have to add our user to the Bumblebee and video groups:

sudo usermod -a -G video,bumblebee User_Name

Where User_name is our username. After this you have to enable bumblebee and dkms (if necessary):

sudo systemctl enable bumblebee

Finally, check that the blacklist nouveau line exists in the file /etc/modprobe.d/50-blacklist.conf (even if you plan to use the nouveau driver).
If it does not exist, add it to the end of the file:

sudo echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/50-blacklist.conf


To finish, run:

sudo mkinitrd

Install BBswitch from sources

The repository for Opensuse Leap 42.3 has the package with the module for kernel 4.4.76 and is not rebuilt with the kernel updates. Ideally, install it from the sources and use DKMS for kernel updates.

git clone https://github.com/Bumblebee-Project/bbswitch.git

cd bbswitchmakesudo

make
load


It is tested that the module is loaded:

lsmod | grep bbswitch

If it is loaded it can be installed using dkms:

sudo make -f Makefile.dkmsd

Optional: install the NVIDIA driver

If you want to take advantage of the advanced features of the NVIDIA graphics card, you must install the proprietary driver. We started by adding the X11: Bumblebee repository of the Open Build Service following the instructions shown in Install package X11: Bumblebee. From this page you can perform the installation using the One Click Install system (one click installation) of openSUSE. Once the repository is added, the following commands are executed in a terminal:

sudo zypper in nvidia-bumblebee
systemctl enable dkms


And if you are using a 64-bit machine, also:

sudo zypper in nvidia-bumblebee-32bit

The latter allows the correct execution of 32-bit programs on Steam. If you do not plan to use the independent card (that is, you want to use the integrated card all the time), you can safely skip this section. Bumblebee will use the nouveau driver for his purposes.

Additional step after installing the driver

It is necessary to add our user to the bumblebee and video groups' for the proper functioning of the video card. If it is not done, you can not, for example, use 3D acceleration. The way to do it is to execute the following command in a terminal:

sudo usermod -a -G bumblebee,video User_Name

Where User_Name is the name used to start the session and the one with our user directory. If you prefer, you also have the option to do so using the graphical interface available in YaST → User and group management. Once the application is open, we choose our user in the list, press Edit and, in the Details tab, we mark the boxes' bumblebee and video in the list on the right of the window.
To finish, press OK and again OK.
If there is more than one user in the system, you must repeat the operation for each of them. Membership in the new groups becomes effective at the next start of the session. As it is necessary to restart after installing the driver, a good time to add our user to the bumblebee and video groups is just before doing so.
In Leap 42.3 the controller that controls and downloads the driver is bbswitch, so you must also add nvidia blacklist to the file 50-blacklist.conf:

sudo echo "blacklist nvidia" | sudo tee -a /etc/modprobe.d/50-blacklist.conf

Configure Bumblebee

To configure it, you must edit the bumblebee.conf file, placing the driver to use nouveau or nvidia, and set the card to turn off when it is finished.

sudo emacs /etc/bumblebee/bumblebee.conf


In the section:

[bumblebeed]

TurnCardOffAtExit=true

Driver=nvidia

Undo the installation in case of problems

If you can not operate the graphical environment in any way, you must perform a system restore using snapper. If your system does not use Btrfs you can not use this method. First find the number of the snapshot that you had to create before carrying out the process.

sudo snapper list


Perform the restoration, replacing xx with the number of the snapshot:

snapper rollback xx


Restart the computer.

Verify the installation

After completing the installation and restarting, verify that Bumblebee is working by opening a terminal and executing the command:

optirun --status


If you see the message "Bumblebee status: Ready (3.2.1). X inactive, Discrete video card is off.", Then it should be working correctly. To start a program using the independent card you must execute the command:

optirun program_name


You can do a test with:

optirun glxspheres

If you see spheres, then your independent card is working with Bumblebee.

Run Steam

Steam requires the use of a new command line utility called primusrun. It is absolutely necessary to have the nvidia-bumblebee-32bits package installed to work. You can run Steam like this:

primusrun steam
We are trying to bring all the content to YouTube and show every other spec and characteristics of this phone and many others, so we need your help to make it possible. Share, like, subscribe and active the notification to stay tuned and to access our giveaways.
Donate with PayPal
And we apreciate your donation to make new reviews and giveaways

Don’t forget to follow us in:

Comments

Popular posts from this blog

MegaSync in Linux

Zeal, a developer documentation browser

Installation guide for openSUSE novice Tumbleweed step by step