How to make Nvidia Optimus on OpenSUSE 13.2 (See details inside)

Hi all! Can you help me? I need install Nvidia Optimus on OpenSUSE 13.2 according to this instruction: http://us.download.nvidia.com/XFree86/Linux-x86_64/340.32/README/optimus.html
Excuse me, but I don’t understand these instruction. Please tell me how to implement it on OpensSUSE 13.2?
Thanks!

Use this instruction : https://en.opensuse.org/SDB:NVIDIA_Bumblebee

No. I’ve used it. Do Bumblebee very small performance.

Don’t use that repo for 13.2, uninstall all from it and remove the repo. You see all bumblebee components are available from the OSS repo in 13.2, except for the nvidia drivers. You’ll have to wait till someone has investigated how we are supposed to install the nvidia packages.
Give it some time.

I do not need bumblebee. It slows even Half-Life 2.
I need a guide how to setup Nvidia Optimus for the this instruction. http://us.download.nvidia.com/XFree86/Linux-x86_64/340.32/README/optimus.html

When I installed the Bumblebee packages in “Factory”, zypper gave me this message:


Message from package bumblebee:

INFO: Please ensure that users using bublebee/video card are in following group(s):
INFO:     gpasswd -a <USER> bumblebee
INFO:   If going to use nvidia binary driver:
INFO:     gpasswd -a <USER> video
INFO: Also ensure the nouveau module is blacklisted (even if you plan to use it):
INFO:     echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf
INFO:     mkinitrd

Hope that helps

snakedriver how you installed nvidia-bumblebee from factory on opensuse 13.2 ?

Works well?

Install Bumblebee packages in openSUSE 13.2:

http://download.opensuse.org/repositories/X11:/Bumblebee/openSUSE_13.2/

No! I dont need Bumblebee

Looking at http://download.opensuse.org/repositories/X11:/Bumblebee/ someone has done so last night.

This contradicts your original post. To get an Optimus config working, you need bumblebee

I was thinking if the driver in the ordinary nvidia repo would work, they have changed the file layout for some files. If you look in /etc/alternatives there’s a symlink libglx.so pointing to /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so before installing nvidia on my desktop. Installing nvidia points it to /usr/lib64…/extensions/nvidia/nvidia-libglx.so. In /usr/lib64/…/extensions there’s a symlink libglx.so pointing to /etc/alternatives/libglx.so. I was wondering if bumblebee in OSS could use that for switching? I haven’t had much luck with my netbook and 13.2, possibly there’s som incompatability. But anyhow it’s not a good idea to have the X11 repo with the same bumblebee components as in OSS.

I want to use Nvidia Optimus not through Bumblebee, and by way of written here
http://us.download.nvidia.com/XFree86/Linux-x86_64/340.32/README/optimus.html
Do you understand me? This official support Nvidia Optimus on Linux. But I have a problem, I cannot disable nouveau

The distribution-provided pre-install script completed successfully. If this is the first time you have run the installer, this script may have helped disable Nouveau, but a reboot may be required first. Would you like to continue, or would you prefer to abort installation to reboot the system? (Answer: Continue installation)
ERROR: The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution’s documentation for details on how to correctly disable the Nouveau kernel driver.
WARNING: One or more modprobe configuration files to disable Nouveau are already present at: /etc/modprobe.d/nvidia-installer-disable-nouveau.conf. Please be sure you have rebooted your system since these files were written. If you have rebooted, then Nouveau may be enabled for other reasons, such as being included in the system initial ramdisk or in your X configuration file. Please consult the NVIDIA driver README and your Linux distribution’s documentation for details on how to correctly disable the Nouveau kernel driver.
ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

Why not block the kernel module driver nouveau?

linux-jx4l:/etc/modprobe.d # cat blacklist.conf 
blacklist nouveau
linux-jx4l:/etc/modprobe.d # lsmod | grep nouveau
nouveau              1304774  0 

You must run mkinitrd or in 13.2 dracut to get it blacklisted in initrd. Both commands will work in 13.2.

Very thanks. man!

In order for programs that use the NVIDIA driver to work correctly (e.g.: X, OpenGL, and CUDA applications), the kernel module must be loaded, and the device files /dev/nvidiactl and /dev/nvidia[0-9]+ must exist with read and write permissions for any users of such applications. If the setuid root nvidia-modprobe(1) utility is installed (the default when the driver is installed from .run file), this should be handled automatically. Otherwise, the kernel module will need to be loaded, and the device files created, through your Linux distribution's mechanisms.

I dont have /dev/nvidiactl and /dev/nvidia[0-9]+. How to fix it? Command nvidia-modprobe dont help me.

I don’t seem to be able to get the nvidia module to build:
Zypper:

Output of nvidia-bumblebee-343.22-1.1.x86_64.rpm %posttrans script:
     ++ '' -x /usr/sbin/dkms ']'
     ++ /usr/sbin/dkms add -m nvidia -v 343.22 --rpm_safe_upgrade

     mktemp: failed to create file via template '/var/tmp/dkms/dkms_rpm_safe_upgrade_lock.4924.XXXXXX': No such file or directory
     Error! Unable to make temporary file.

     /usr/sbin/dkms: line 981: $lock_name: ambiguous redirect
 
     Creating symlink /var/lib/dkms/nvidia/343.22/source ->
                      /usr/src/nvidia-343.22
 
     DKMS: add completed.
     ++ /usr/sbin/dkms build -m nvidia -v 343.22
 
     Kernel preparation unnecessary for this kernel.  Skipping...
 
     Building module:
     cleaning build area...mktemp: failed to create file via template '/var/tmp/dkms/dkms.XXXXXX': No such file or directory
     Error! Unable to make temporary file.
     /usr/sbin/dkms: line 78: : No such file or directory
 
     make KERNELRELEASE=3.16.6-2-desktop -C /lib/modules/3.16.6-2-desktop/build SUBDIRS=/var/lib/dkms/nvidia/343.22/build modules...mktemp: failed to create file via template '/var/tmp/dkms/dkms.XXXXXX': No such file or directory
     Error! Unable to make temporary file.
     /usr/sbin/dkms: line 78: : No such file or directory
 
     Error!  Build of nvidia.ko failed for: 3.16.6-2-desktop (x86_64)
     Consult the make.log in the build directory
     /var/lib/dkms/nvidia/343.22/build/ for more information.
     ++ /usr/sbin/dkms install -m nvidia -v 343.22
     /usr/sbin/dkms: line 73: : No such file or directory
 
     Kernel preparation unnecessary for this kernel.  Skipping...
 
     Building module:
     cleaning build area...mktemp: failed to create file via template '/var/tmp/dkms/dkms.XXXXXX': No such file or directory
     Error! Unable to make temporary file.
     /usr/sbin/dkms: line 78: : No such file or directory
 
     make KERNELRELEASE=3.16.6-2-desktop -C /lib/modules/3.16.6-2-desktop/build SUBDIRS=/var/lib/dkms/nvidia/343.22/build modules.../usr/sbin/dkms: line 73: : No such file or directory
     mktemp: failed to create file via template '/var/tmp/dkms/dkms.XXXXXX': No such file or directory
     Error! Unable to make temporary file.
     /usr/sbin/dkms: line 78: : No such file or directory
 
     Error!  Build of nvidia.ko failed for: 3.16.6-2-desktop (x86_64)
     Consult the make.log in the build directory
     /var/lib/dkms/nvidia/343.22/build/ for more information.
     ++ popd
     /usr/sbin/dkms: line 73: : No such file or directory
     /usr/sbin/dkms: line 73: : No such file or directory

/var/lib/dkms/nvidia/343.22/build/make.log:

DKMS make.log for nvidia-343.22 for kernel 3.16.6-2-desktop (x86_64)
 Tue Nov 11 03:10:52 CET 2014
 make: Entering directory '/usr/src/linux-3.16.6-2-obj/x86_64/desktop'
 make[1]: Entering directory `/usr/src/linux-3.16.6-2-obj/x86_64/desktop'
   CC [M]  /var/lib/dkms/nvidia/343.22/build/nv.o
 In file included from /usr/src/linux-3.16.6-2/include/uapi/linux/stddef.h:1:0,
                  from /usr/src/linux-3.16.6-2/include/linux/stddef.h:4,
                  from /usr/src/linux-3.16.6-2/include/uapi/linux/posix_types.h:4,
                  from /usr/src/linux-3.16.6-2/include/uapi/linux/types.h:13,
                  from /usr/src/linux-3.16.6-2/include/linux/types.h:5,
                  from /usr/src/linux-3.16.6-2/include/uapi/linux/capability.h:16,
                  from /usr/src/linux-3.16.6-2/include/linux/capability.h:15,
                  from /usr/src/linux-3.16.6-2/include/linux/sched.h:15,
                  from /usr/src/linux-3.16.6-2/include/linux/utsname.h:5,
                  from /var/lib/dkms/nvidia/343.22/build/nv-linux.h:44,
                  from /var/lib/dkms/nvidia/343.22/build/nv.c:13:
 /usr/src/linux-3.16.6-2/include/asm-generic/qrwlock.h: In function ‘queue_write_trylock’:
 /usr/src/linux-3.16.6-2/include/asm-generic/qrwlock.h:93:35: warning: comparison between signed and unsigned integer expressions -Wsign-compare]
           cnts, cnts | _QW_LOCKED) == cnts);
                                    ^
 /usr/src/linux-3.16.6-2/include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
  # define likely(x) __builtin_expect(!!(x), 1)
                                         ^
 In file included from /usr/src/linux-3.16.6-2/include/uapi/linux/stddef.h:1:0,
                  from /usr/src/linux-3.16.6-2/include/linux/stddef.h:4,
                  from /usr/src/linux-3.16.6-2/include/uapi/linux/posix_types.h:4,
                  from /usr/src/linux-3.16.6-2/include/uapi/linux/types.h:13,
                  from /usr/src/linux-3.16.6-2/include/linux/types.h:5,
                  from /usr/src/linux-3.16.6-2/include/uapi/linux/capability.h:16,
                  from /usr/src/linux-3.16.6-2/include/linux/capability.h:15,
                  from /usr/src/linux-3.16.6-2/include/linux/sched.h:15,
                  from /usr/src/linux-3.16.6-2/include/linux/utsname.h:5,
                  from /var/lib/dkms/nvidia/343.22/build/nv-linux.h:44,
                  from /var/lib/dkms/nvidia/343.22/build/nv.c:13:
 /usr/src/linux-3.16.6-2/arch/x86/include/asm/uaccess.h: In function ‘copy_from_user’:
 /usr/src/linux-3.16.6-2/arch/x86/include/asm/uaccess.h:712:26: warning: comparison between signed and unsigned integer expressions -Wsign-compare]
   if (likely(sz &lt; 0 || sz &gt;= n))
                           ^
 /usr/src/linux-3.16.6-2/include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
  # define likely(x) __builtin_expect(!!(x), 1)
                                         ^
 /usr/src/linux-3.16.6-2/arch/x86/include/asm/uaccess.h: In function ‘copy_to_user’:
 /usr/src/linux-3.16.6-2/arch/x86/include/asm/uaccess.h:730:26: warning: comparison between signed and unsigned integer expressions -Wsign-compare]
   if (likely(sz &lt; 0 || sz &gt;= n))
                           ^
 /usr/src/linux-3.16.6-2/include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
  # define likely(x) __builtin_expect(!!(x), 1)
                                         ^
 mv: kan inte ta status på ”/var/lib/dkms/nvidia/343.22/build/.tmp_nv.o”: Filen eller katalogen finns inte
 /usr/src/linux-3.16.6-2/scripts/Makefile.build:273: receptet för målet ”/var/lib/dkms/nvidia/343.22/build/nv.o” misslyckades
 make[3]: *** [/var/lib/dkms/nvidia/343.22/build/nv.o] Fel 1
 /usr/src/linux-3.16.6-2/Makefile:1359: receptet för målet ”_module_/var/lib/dkms/nvidia/343.22/build” misslyckades
 make[2]: *** [_module_/var/lib/dkms/nvidia/343.22/build] Fel 2
 Makefile:195: recipe for target 'sub-make' failed
 make[1]: *** [sub-make] Error 2
 Makefile:24: recipe for target '__sub-make' failed
 make: *** [__sub-make] Error 2
 make: Leaving directory '/usr/src/linux-3.16.6-2-obj/x86_64/desktop'

Install the kernel development pattern. (YaST->Softwaremanagement, View->Patterns)

If it is installed already, re-install all packages (Update Unconditionally in YaST).

In particular kernel-devel and kernel-desktop-devel:

sudo zypper in -f kernel-devel kernel-desktop-devel

No, that doesn’t seem to have helped. Also I do have the “/lib/modules/3.16.6-2-desktop/build” directory.

Ah, ok.
Then it seems that /var/lib/dkms/nvidia/343.22/build is missing, and /var/tmp/dkms/ seems to be missing as well.

I’d suggest to remove nvidia-bumblebee completely before installing it again. It might not do all necessary steps if only re-installed.

zypper rm nvidia-bumblebee
zypper in nvidia-bumblebee