Optimus on Legacy Driver 340

Hello,
i have a laptop Asus N61JV, whit Optimus hardware.

# lspci -nnk | egrep 'VGA|3D' -A3
00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 12)
        Subsystem: ASUSTeK Computer Inc. Device [1043:1252]
        Kernel driver in use: i915
        Kernel modules: i915
--
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT216M [GeForce GT 325M] [10de:0a35] (rev a2)
        Subsystem: ASUSTeK Computer Inc. Device [1043:1252]
        Kernel modules: nouveau
03:00.0 Network controller [0280]: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) [168c:002b] (rev 01)


# xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x45; cap: 0xf (Source Output, Sink Output, Source Offload, Sink Offload); crtcs: 2; outputs: 4; associated providers: 0; name: modesetting
    output LVDS-1
    output VGA-1
    output HDMI-1
    output DP-1


I install Bumblebee form here https://en.opensuse.org/SDB:NVIDIA_Bumblebee with Bumblebee repo for 15.1, and it work, but Bumblebee NVIDIA driver are 440, and it don’t support my card.
What is my options on using full potential of the laptop. My setup is laptop connected to external monitor. The problem is that when i am using Mozilla in YouTube, every clip is taking 95% CPU usage and clip skip and stop from time to time. So I think that whit using of NVIDIA card for visualization the work is go smoother.

I also tray to install the driver and recover messed up GL libs:


     ./NVIDIA-Linux-x86_64-340.93.run --accept-license --no-backup --no-x-check --no-questions --ui=none --no-x-check --no-distro-scripts --utility-prefix=/nvidia --installer-prefix=/nvidia --opengl-prefix=/nvidia --opengl-libdir=glx

rm /usr/lib64/xorg/modules/extensions/libglx.so

mv /usr/lib64/xorg/modules/extensions/libglx.so.340.93 /nvidia/glx/libglx.so.340.93

ln -s /nvidia/glx/libglx.so.340.93 /nvidia/glx/libglx.so

zypper in -f xorg-x11-server Mesa Mesa-32bit Mesa-libGL1 Mesa-libGL1-32bit Mesa-libEGL1 Mesa-libEGL1-32bit xf86-video-intel xf86-video-vesa

sytemctl enable bumblebeed

  In bumblebee.conf:
     #...
## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/nvidia/lib64:/nvidia/glx
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/nvidia/glx,/nvidia/lib64,/usr/lib64/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia
#...

But without success.

Give this a try :https://forums.opensuse.org/showthread.php/537906-Cuda-Nvidia-bumblebee-codecs-quot-safe-quot-way

It installs CUDA compatible Nvidia driver which should support your card.

This is cuda output from install it
URL: https://paste.opensuse.org/39193142

First error is here, at “Change the following lines under [driver-nvidia]:”
sudo ln -s /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so /usr/lib64/nvidia/xorg/modules/extensions/libglx.so
ln: failed to create symbolic link ‘/usr/lib64/nvidia/xorg/modules/extensions/libglx.so’: file exist

Try

sudo ln -sf /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so /usr/lib64/nvidia/xorg/modules/extensions/libglx.so

changing the flag from -s to -sf to replace the symbollic link. Also, if it already exists, you can just skip this step.

-SJL

I just remove the existing file end start

ln -s /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so /usr/lib64/nvidia/xorg/modules/extensions/libglx.so

whitout errors. After that

mkinitrd

.
And than

options bbswitch load_state=-1 unload_state=1

reboot and test.

optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.
optirun glxgears

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

PS: Now i test

sudo ln -sf /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so /usr/lib64/nvidia/xorg/modules/extensions/libglx.so

reboot, update, reboot, and test

optirun --status
  101.724632] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  101.724705] [ERROR]Could not connect to bumblebee daemon - is it running?
linux-4962:/home/hristokz # sudo systemctl restart bumblebeed
linux-4962:/home/hristokz # optirun --status
  110.217413] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  110.217487] [ERROR]Could not connect to bumblebee daemon - is it running?
linux-4962:/home/hristokz # sudo systemctl enable bumblebeed
linux-4962:/home/hristokz # optirun --status
  150.728466] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  150.728529] [ERROR]Could not connect to bumblebee daemon - is it running?

Did you set the right groups and permissions? Also, did you start and enable bbswitch and bumblebeed in systemctl?

sudo usermod -aG bumblebee hristokz
linux-4962:/home/hristokz # sudo usermod -aG video hristokz

bumblebeed is enabled and start but

sudo systemctl enable bbswitch
Failed to enable unit: Unit file bbswitch.service does not exist.

TEST

optirun --status
 5604.773774] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
 5604.773841] [ERROR]Could not connect to bumblebee daemon - is it running?

After reinstall bbswitch and bbswitch-kmp-default:

sudo systemctl enable bbswitch
Failed to enable unit: Unit file bbswitch.service does not exist.
linux-4962:/home/hristokz # optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

linux-4962:/home/hristokz # sudo systemctl start bumblebeed
linux-4962:/home/hristokz # optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

linux-4962:/home/hristokz # optirun glxgears 
 7541.822120] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

 7541.822236] [ERROR]Aborting because fallback start is disabled.

PS: after just reboot

sudo systemctl start bbswitch
Failed to start bbswitch.service: Unit bbswitch.service not found.
linux-4962:/home/hristokz # optirun glxgears 
  153.124317] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  153.124374] [ERROR]Could not connect to bumblebee daemon - is it running?
linux-4962:/home/hristokz # sudo systemctl start bumblebeed
linux-4962:/home/hristokz # optirun glxgears 
  226.154855] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  226.154929] [ERROR]Could not connect to bumblebee daemon - is it running?
linux-4962:/home/hristokz # optirun --status
  231.962653] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  231.962743] [ERROR]Could not connect to bumblebee daemon - is it running?

you need to “enable” as well as starting bbswitch and bumblebeed. I don’t know why you are installing bbswitch-kmp-default.

I don’t know what went wrong since I don’t know exactly what sequence you went with but if systemctl cannot start bbswitch, obviously bbswitch and/or its dependence hasn’t been installed properly.

Don’t expect bumblebee to work without bbswitch, but you need to sort out where it went wrong.

I am sorry, I cannot help you since you haven’t even uninstalled the Nvidia driver you installed originally. As I’ve said in my set of instructions, you have to start from “clean” state first.

bbswitch-kmp-default is auto select for install with bbswitch. Now i will reinstall opensuse 15.1 form zero and try again.

Okay, give it a try, and hopefully everything will work.

sudo systemctl enable bumblebeed
linux-4j1s:/home/hristokz # sudo systemctl start bumblebeed
linux-4j1s:/home/hristokz # sudo systemctl enable bbswitch
Failed to enable unit: Unit file bbswitch.service does not exist.
linux-4j1s:/home/hristokz # optirun --status
  255.314062] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  255.314133] [ERROR]Could not connect to bumblebee daemon - is it running?
linux-4j1s:/home/hristokz # optirun glxgears 
  844.944853] [ERROR]The Bumblebee daemon has not been started yet or the socket path /var/run/bumblebee.socket was incorrect.
  844.944930] [ERROR]Could not connect to bumblebee daemon - is it running?

Output form CUDA install: https://paste.opensuse.org/94504638Output from update on step 7: https://paste.opensuse.org/78517365

Okay, that really beats me. You enabled and started bumblebeed and it’s complaining that it’s not running even when you check for status. Did you configure bumblebee correctly?

bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=true
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib64/:/usr/lib/
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib64/nvidia/xorg/,/usr/lib64/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

Did you also configure

/etc/modprobe.d/50-bbswitch.conf

to

options bbswitch load_state=-1 unload_state=1

If that doesn’t work, then try switching back to

options bbswitch load_state=0 unload_state=1

After reverse -1 to 0

linux-4j1s:/home/hristokz # optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

linux-4j1s:/home/hristokz # optirun glxgears 
 7636.797984] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

 7636.798066] [ERROR]Aborting because fallback start is disabled.
linux-4j1s:/home/hristokz # sudo systemctl enable bbswitch
Failed to enable unit: Unit file bbswitch.service does not exist.
linux-4j1s:/home/hristokz # sudo systemctl enable bumblebeed
linux-4j1s:/home/hristokz # sudo systemctl start bumblebeed
linux-4j1s:/home/hristokz # optirun --status
Bumblebee status: Error (3.2.1): Could not load GPU driver

linux-4j1s:/home/hristokz # sudo systemctl restart bumblebeed
linux-4j1s:/home/hristokz # optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

linux-4j1s:/home/hristokz # sudo systemctl enable bbswitch
Failed to enable unit: Unit file bbswitch.service does not exist.
linux-4j1s:/home/hristokz # optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

linux-4j1s:/home/hristokz # optirun glxgears 
 7702.781141] [ERROR]Cannot access secondary GPU - error: Could not load GPU driver

 7702.781260] [ERROR]Aborting because fallback start is disabled.


PS More info about the problem

dmesg | tail
 8033.277872] NVRM: No NVIDIA graphics adapter found!
 8033.278123] nvidia-nvlink: Unregistered the Nvlink Core, major device number 241
 8042.123453] nvidia-nvlink: Nvlink Core is being initialized, major device number 241
 8042.124320] NVRM: The NVIDIA GeForce GT 325M GPU installed in this system is
               NVRM:  supported through the NVIDIA 340.xx Legacy drivers. Please
               NVRM:  visit http://www.nvidia.com/object/unix.html for more
               NVRM:  information.  The 440.64.00 NVIDIA driver will ignore
               NVRM:  this GPU.  Continuing probe...
 8042.124327] NVRM: No NVIDIA graphics adapter found!
 8042.125018] nvidia-nvlink: Unregistered the Nvlink Core, major device number 241
optirun -vvv glxinfo
 8298.794532] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
 8298.795002] [INFO]Configured driver: nvidia
 8298.795247] [DEBUG]optirun version 3.2.1 starting...
 8298.795282] [DEBUG]Active configuration:
 8298.795311] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
 8298.795340] [DEBUG] X display: :8
 8298.795360] [DEBUG] LD_LIBRARY_PATH: /usr/lib64/:/usr/lib/
 8298.795380] [DEBUG] Socket path: /var/run/bumblebee.socket
 8298.795403] [DEBUG] Accel/display bridge: auto
 8298.795422] [DEBUG] VGL Compression: proxy
 8298.795439] [DEBUG] VGLrun extra options: 
 8298.795456] [DEBUG] Primus LD Path: /usr/lib64/primus:/usr/lib/primus
 8298.795569] [DEBUG]Using auto-detected bridge virtualgl
 8298.916941] [INFO]Response: No - error: Could not load GPU driver

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

 8298.917039] [DEBUG]Socket closed.
 8298.917100] [ERROR]Aborting because fallback start is disabled.
 8298.917111] [DEBUG]Killing all remaining processes.

after just 1 reboot:
URL: https://paste.opensuse.org/61635743

Okay, now we’re getting a pretty good clue.

8042.124320] NVRM: The NVIDIA GeForce GT 325M GPU installed in this system is
NVRM: supported through the NVIDIA 340.xx Legacy drivers. Please
NVRM: visit http://www.nvidia.com/object/unix.html for more
NVRM: information. The 440.64.00 NVIDIA driver will ignore
NVRM: this GPU. Continuing probe…Since the beginning of your thread, trying to install Nvidai 340.00 legacy driver. Now, the “fun” part is that assuming that you aren’t using cuda, find a matching driver version in the repository and to install a compatible version of it with bumblebee. Quite to be honest, I don’t know if they have a compatible driver that old with bumblebee.

Hi SJLPHI
http://download.opensuse.org/repositories/home:/Bumblebee-Project:/nVidia:/340.107/openSUSE_Leap_15.1/x86_64/

This is the only driver for Leap 15.1 that i can find in OpenSUSE Repo. By your opinion is it viable option for driver or not. If not what is my other options: Older version of OpenSUSE or…

Best regards Hristo