NVidia Optimus Legacy + Bumblebee. How to get working? (TW and LEAP issue)

Hello!

I have a notebook with a Geforce 540M, and it is using legacy drivers (390.xx). Many other Nvidia Card bought before 2015 are also using. The list can be found here: https://www.nvidia.com/object/IO_32667.html

If I use the instructions in the OpenSuse Wiki, I get the non-legacy drivers (410.xx or newer) with the package nvidia-bumblebee, and not the recommended packages. Doing this, the video card won’t run and a common error is

gabriel@linux-47n2:~> optirun -vvv glxspheres
[20388.865305] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[20388.865872] [INFO]Configured driver: nvidia
[20388.866301] [DEBUG]optirun version 3.2.1 starting...
[20388.866330] [DEBUG]Active configuration:
[20388.866342] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[20388.866353] [DEBUG] X display: :8
[20388.866363] [DEBUG] LD_LIBRARY_PATH: /usr/lib64/nvidia:/usr/lib/nvidia
[20388.866374] [DEBUG] Socket path: /var/run/bumblebee.socket
[20388.866390] [DEBUG] Accel/display bridge: auto
[20388.866416] [DEBUG] VGL Compression: proxy
[20388.866441] [DEBUG] VGLrun extra options: 
[20388.866475] [DEBUG] Primus LD Path: /usr/lib64/primus:/usr/lib/primus
[20388.866606] [DEBUG]Using auto-detected bridge virtualgl
[20388.879727] [INFO]Response: No - error: Could not load GPU driver

[20388.879788] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

[20388.879818] [DEBUG]Socket closed.
[20388.879872] [ERROR]Aborting because fallback start is disabled.
[20388.879895] [DEBUG]Killing all remaining processes.

I also tried to install the drivers using the package using **x11-video-nvidiaG04 **and **zypper inr -r NVIDIA **, both contain the legacy drivers. But the above mentioned error keeps existing. I tried on Leap and Tumbleweed.

Some other outputs:

$ sudo modprobe nvidia
modprobe: ERROR: could not find module by name='nvidia'
modprobe: ERROR: could not insert 'nvidia': Unknown symbol in module, or unknown parameter (see dmesg)

$ sudo lspci
01:00.0 3D controller: NVIDIA Corporation GF108M [GeForce GT 540M] (rev a1)

$ systemctl status bumblebeed
● bumblebeed.service - Bumblebee C Daemon
   Loaded: loaded (/usr/lib/systemd/system/bumblebeed.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-11-19 14:43:07 -02; 5h 48min ago
 Main PID: 7540 (bumblebeed)
    Tasks: 1 (limit: 4915)
   Memory: 360.0K
   CGroup: /system.slice/bumblebeed.service
           └─7540 /usr/sbin/bumblebeed

Does anyone knows how to install the legacy drivers correctly?
I had this problem with Leap too.

You’ll find the legacy drivers here (choose the version you need) http://download.opensuse.org/repositories/home:/Bumblebee-Project:/nVidia:/
Please write again here if you cannot figure out how to get them working (sorry, many years since I used them on TW this way, but maybe I can find my old notes…)

Today an update of the package x11-video-nvidiaG04 came and fixed it. :slight_smile:

With tumbleweed everything works with


# zypper addrepo --refresh https://download.nvidia.com/opensuse/tumbleweed NVIDIA
# zypper inr -r NVIDIA

and then following the instructions here https://en.opensuse.org/SDB:NVIDIA_Bumblebee without installing the package that comes with bumblebee! That is, if a card that uses legacy driver is present, this:
**sudo zypper in nvidia-bumblebee nvidia-bumblebee-32bit

**should not be installed. I don’t know if it is needed, but I also blacklisted nouveau at /etc/modprobe.d/50-blacklist.conf and addedmy user to the video and bumblebee groups following the instructions after bumblebee is installed. **

**

The kernel version change to 4.19 broke it on my system.
A patch is required to get it working which is incorporated in the rpm from the repo you’ll use here.
It just so happens I have the same graphics card as you so if you follow these steps on Tumbleweed you should get a workable result if you haven’t already.

Remove any nvidia drivers you have installed and probably any changes to xorg.conf you might have made.
Install bumblebee

Installing bumblebee is pretty straightforward:
sudo zypper in bumblebee bbswitch

Add yourself to the bumblebee group (here “username” should be replaced with your real username):
sudo usermod -aG bumblebee username

Add yourself to the video group (here “username” should be replaced with your real username):
sudo usermod -aG video username

Then enable and start bumblebee:
sudo systemctl enable bumblebeed

sudo systemctl start bumblebeed

If you plan to use 32bit apps (like steam), install required libraries:
sudo zypper in Mesa-libGL1-32bit libX11-6-32bit primus-32bit

Tumbleweed

Add bumblebee repository:

sudo zypper ar -f https://download.opensuse.org/repositories/home:FrankyU2/openSUSE_Tumbleweed/home:FrankyU2.repo franky

Install the driver:
sudo zypper in -r franky nvidia-bumblebee nvidia-bumblebee-32bit

sudo systemctl enable dkms

Update the kernel image:
sudo mkinitrd

That should get the driver installed on your system properly with the new kernel.

Reboot and try running something like

primusrun glxspheres

You should get output similar to
OpenGL Renderer: GeForce GT 540M/PCIe/SSE2

If not I set
KernelDriver=nvidia

in /etc/bumblebee/bumblebee.conf at around line 55 to get primus to use the Nvidia card by default I think.

after editing restart bumblebee daemon with

**sudo systemctl restart bumblebeed

**This should give you nvidia acceleration with primus which is what you probably want.