Installing cuda 7.0 with Bumblebee with Opensuse 13.2

Hi,

More than a year ago I bought an Acer laptop with Nvidia GPU 860M. I installed Opensuse 13.2 and the display failed to work
properly.
I then installed Bumblebee and everything is fine. The display works and so does the optirun command.
I have studiously avoided to update my system since then to avoid problems. Other installations, like proprietary, licensed
sw were painful too.

Now I would really like to install CUDA 7.0. I had a look around and, from various posts, that seem to have the potential to
screw up Bumblebee. I need to travel in two weeks for a couple of months during which time the laptop will be my only machine
and so it’ll be mission critical. And I really would like to avoid re-installing OS etc. and chasing problems in those two weeks.

My question here is what can I do to avoid that the CUDA installation doesn’t leave me with a non working machine ?
So far, the main suggestion I seem to have gathered is to install CUDA from the .run file so that I don’t install Nvidia drivers
(and stuff up Bumblebee). Is that right ? Anything else I should do ?
Please assume I don’t know a lot : if you suggest, for example, “check drivers”, please give simple, clear instructions how to
do so as well.
BTW, I plan to use CUDA just for computing,not graphics (if that makes any difference).

Thank you very much in advance.

Things are looking confusing so far.
I started following Nvidia guide : http://developer.download.nvidia.com/compute/cuda/6_5/rel/docs/CUDA_Getting_Started_Linux.pdf
at page 11, section 4 , it says

When installing cuda, the correct driver packages should also be specified. Without
doing this, zypper will select packages that may not work on the system. Run the
following to detect the flavor of kernel and install cuda with the appropriate driver
packages:
$
uname -r
3.4.6-2.10-<flavor>
$
sudo zypper install cuda nvidia-gfxG03-kmp-<flavor>
nvidia-uvm-gfxG03-kmp-<flavor>

On my system, uname -r returns 3.16.7-21-desktop

Looking into the cuda7 package for Opensuse13.2 with rpm -qlp shows no 3.16.7-21-desktop,only 3.16.6_2
Somethings tells me it’s going to be a problem.
Any ideas ?

Also, in desperation, I started looking at other distributions guides for clues.
For example this one that looked nice and clean :
https://forums.kali.org/showthread.php?21956-(Guide)-Installing-Nvidia-Bumblebee-CUDA-for-Optimus-enabled-Laptops

Unfortunately, by following steps 10-14 broke my Bumblebee that stopped working.
Fortunately, reverting to the old /etc/bumblebee/bumblebee.conf and /etc/bumblebee/xorg.conf.nvidia fixed it.
That has not increased my confidence one bit.
The same instructions, at step 17, suggest to use the .run for the CUDA install and say NO to the drivers.

What do you think of trying this ?

Looking inside the CUDA 7 rpm for Opensuse13.2 with rpm -qlp shows references to drivers 346.46 .
Any idea how to check what driver version Bumblebee uses ?
My Bumblebee is version 3.2.1

Look in Yast for nvidia it will tell the version. but bumblebee uses a modified nvidia driver so…

Hi,

I think you helped me before with Bumblebee.

I never installed the Nvidia drivers. I’m not sure how to check with Yast. However, I did find this useful command in another thread:

rpm -qa | grep nvidia
nvidia-bumblebee-346.59-1.1.x86_64
nvidia-bumblebee-32bit-346.59-1.1.x86_64

And that seems to confirm it, also telling me that the modified drivers Nvidia is using is 346.59 .
Also, if I look into the CUDA 7.0 rpm :

rpm -qlp cuda-repo-opensuse132-7-0-local-7.0-28.x86_64.rpm 
warning: cuda-repo-opensuse132-7-0-local-7.0-28.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5c37d3be: NOKEY
..........
/var/cuda-repo-7-0-local/nvidia-gfxG03-kmp-default-346.46_k3.16.6_2-0.x86_64.rpm
/var/cuda-repo-7-0-local/nvidia-gfxG03-kmp-desktop-346.46_k3.16.6_2-0.x86_64.rpm
/var/cuda-repo-7-0-local/nvidia-glG03-346.46-0.x86_64.rpm
/var/cuda-repo-7-0-local/nvidia-uvm-gfxG03-kmp-default-346.46_k3.16.6_2-0.x86_64.rpm
/var/cuda-repo-7-0-local/nvidia-uvm-gfxG03-kmp-desktop-346.46_k3.16.6_2-0.x86_64.rpm
...........

Which suggests that installing the Nvidia drivers included in Cuda7.0 are 346.46 . Tantalizingly close to Bumblebee’s which are
slightly newer.
A sign that it might work if I install the CUDA 7.0 .run file and say NO to driver installation ?

Another thing : looking at this post https://forums.opensuse.org/showthread.php/502460-Hints-to-get-Bumblebee-working-on-an-Optimus-laptop-with-discrete-Nvidia-graphics-card?p=2698769#post2698769

One should change /etc/modprobe.d/50-bbswitch.conf to

options bbswitch load_state=1 unload_state=1

Mine is :

cat /etc/modprobe.d/50-bbswitch.conf 
options bbswitch load_state=0 unload_state=1

Worth changing ?

Also :


lspci -v
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev ff) (prog-if ff)
        !!! Unknown header type 7f
        Kernel modules: nouveau, nvidia

Even though nouveau is blacklisted in /etc/modprobe.d/50-blacklist.conf

Why ? Is that a problem ?

Not a problem nouveau is installed and thus is in the list. You are probably running on the Intel when you ran that command. It is good to keep nouveau as a backup.

nvidia-bumblebee is the NVIDIA driver just in a modified package.

In yast -software management just search for nvidia. You should learn this since it it’s easy to see and control what is installed ad available. Think of it as the openSUSE app store

Got no clue on the other questions maybe try and see what it does.

Thank you. I think the reason I installed Bumblebee in the first place was that nouveau was not working stably on my laptop at the time.
Newer versions might have fixed this.

Anyway, I decided to go ahead with CUDA 7.0 rpm installation, I followed the instructions from NVIDIA page and, to my amazement, they did not
break Bubmblebee. Compiling Nvidia examples failed on something based on textures.
But the good news is that devicequery, compiled and that is the program Nvidia advises to use to test the installation.
The result is a PASS!!!

optirun --no-xorg ./deviceQuery
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 860M"
  CUDA Driver Version / Runtime Version          7.0 / 7.0
  CUDA Capability Major/Minor version number:    5.0
  Total amount of global memory:                 2048 MBytes (2147352576 bytes)
  ( 5) Multiprocessors, (128) CUDA Cores/MP:     640 CUDA Cores
  GPU Max Clock rate:                            1020 MHz (1.02 GHz)
  Memory Clock rate:                             2505 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 2097152 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       49152 bytes
  Total number of registers available per block: 65536
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  2048
  Maximum number of threads per block:           1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
  Run time limit on kernels:                     No
  Integrated GPU sharing Host Memory:            No
  Support host page-locked memory mapping:       Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support:                        Disabled
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.0, CUDA Runtime Version = 7.0, NumDevs = 1, Device0 = GeForce GTX 860M
Result = PASS

That seems to mean that it is working. Need to investigate why not everything compiled, but I feel a lot better.

I only used optirun to run, not to compile.

You probably need to be in NVIDIA mode to compile NVIDA dependent programs

Maybe, but it looks more like something missing. I get this warning at the start, after typing make to compile the examples :

-----------------------------------------------------------------------------------------------
WARNING - No MPI compiler found.
-----------------------------------------------------------------------------------------------
CUDA Sample "simpleMPI" cannot be built without an MPI Compiler.
This will be a dry-run of the Makefile.
For more information on how to set up your environment to build and run this 
sample, please refer the CUDA Samples documentation and release notes
-----------------------------------------------------------------------------------------------
@] mpicxx -I../../common/inc -o simpleMPI_mpi.o -c simpleMPI.cpp
........

which mpicxx returns nothing and Yast doesn’t know it either.

Also I get an error soon after compiling deviceQuery (the Nvidia test program mentioned above).

The error, related to textures is :

/usr/local/cuda-7.0/bin/nvcc -ccbin g++   -m64      -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_52,code=compute_52 -o bindlessTexture bindlessTexture.o bindlessTexture_kernel.o  -L../../common/lib/linux/x86_64 -L/usr/X11R6/lib64 -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: warning: libnvidia-tls.so.346.46, needed by /usr/X11R6/lib64/libGL.so, not found (try using -rpath or -rpath-link)
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv018tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv023tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv015tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv019tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv017tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv013tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv024tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv022tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv007tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv009tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv020tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv016tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv008tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv006tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv021tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv011tls'
/usr/X11R6/lib64/libGL.so: undefined reference to `_nv014tls'
collect2: error: ld returned 1 exit status
Makefile:253: recipe for target 'bindlessTexture' failed
make[1]: *** [bindlessTexture] Error 1
make[1]: Leaving directory '/home/enzo/NVIDIA_CUDA-7.0_Samples/NVIDIA_CUDA-7.0_Samples/2_Graphics/bindlessTexture'
Makefile:52: recipe for target '2_Graphics/bindlessTexture/Makefile.ph_build' failed
make: *** [2_Graphics/bindlessTexture/Makefile.ph_build] Error 2

I even installed nvidia-texture-tool that Yast was showing but it din’t help.
Any ideas ?

Regarding the MPI problem, I found this :https://devtalk.nvidia.com/default/topic/706720/no-mpi-compiler-found/
but the commands are for another distribution : don’t know the Opensuse equivalent.

Regarding libnvidia-tls.so.346.46, I found this : http://askubuntu.com/questions/600711/cuda-7-0-test-failed-on-ubuntu-14-04

I found libnvidia-tls.so.346.46 in /local/usr/nvidia

ls /usr/lib/nvidia/
alternate-install-present          libGL.so    libGL.so.346.59  libOpenCL.so.1.0.0  pre-install
alternate-install-present-default  libGL.so.1  libOpenCL.so     post-uninstall
ldd /usr/lib/nvidia/libGL.so
        linux-gate.so.1 (0xf77a0000)
        libnvidia-tls.so.346.59 => /usr/lib/libnvidia-tls.so.346.59 (0xf7656000)
        libnvidia-glcore.so.346.59 => /usr/lib/libnvidia-glcore.so.346.59 (0xf4fc8000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xf4e8d000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xf4e7a000)
        libc.so.6 => /lib/libc.so.6 (0xf4ccd000)
        libdl.so.2 => /lib/libdl.so.2 (0xf4cc8000)
        libm.so.6 => /lib/libm.so.6 (0xf4c82000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0xf4c5f000)
        /lib/ld-linux.so.2 (0xf77a3000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xf4c5b000)

I added /usr/local/nvidia to $LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH
source .bashrc
echo $LD_LIBRARY_PATH
/usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:/usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:usr/lib/nvidia/:/usr/local/cuda-7.0/lib64:/usr/local/cuda-7.0/lib64:/usr/local/cuda-7.0/lib64:

Unfortunately the compilation fails in exactly the same way. I was sure it would fix it.

Try add optirun before compile command

EDIT:
or in console run the entire bash under optirun

>optirun bash

Hello again, can you post result of

linux-ikd7:~ # rpm -qa | grep nvidia

and

rpm -qa | grep cuda

and

rpm -qa | grep bumble

See that you try to compile bindlessTexture, but still

-Why answer in one post when I can divide it?

Hi,
I tried

make clean
optirun --no-xorg bash
make
..........failed as before
optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is on.
exit
optirun --status
Bumblebee status: Ready (3.2.1). X inactive. Discrete video card is off.

Same error about libnvidia-tls.so.346.46 .Thanks for the suggestion.

Here it is:

rpm -qa | grep nvidia
> nvidia-glG03-346.46-0.x86_64
nvidia-computeG03-346.46-0.x86_64
nvidia-uvm-gfxG03-kmp-default-346.46_k3.16.6_2-0.x86_64
nvidia-texture-tools-2.0.6-25.1.8.x86_64
nvidia-gfxG03-kmp-default-346.46_k3.16.6_2-0.x86_64
nvidia-bumblebee-346.59-1.1.x86_64
nvidia-bumblebee-32bit-346.59-1.1.x86_64
> rpm -qa | grep cuda
cuda-cusparse-7-0-7.0-28.x86_64
cuda-runtime-7-0-7.0-28.x86_64
cuda-curand-7-0-7.0-28.x86_64
cuda-curand-dev-7-0-7.0-28.x86_64
cuda-driver-dev-7-0-7.0-28.x86_64
cuda-npp-dev-7-0-7.0-28.x86_64
cuda-command-line-tools-7-0-7.0-28.x86_64
cuda-cudart-7-0-7.0-28.x86_64
cuda-cufft-dev-7-0-7.0-28.x86_64
cuda-visual-tools-7-0-7.0-28.x86_64
cuda-npp-7-0-7.0-28.x86_64
cuda-cublas-7-0-7.0-28.x86_64
cuda-cusparse-dev-7-0-7.0-28.x86_64
cuda-7-0-7.0-28.x86_64
cuda-cufft-7-0-7.0-28.x86_64
cuda-core-7-0-7.0-28.x86_64
cuda-cublas-dev-7-0-7.0-28.x86_64
cuda-documentation-7-0-7.0-28.x86_64
cuda-7.0-28.x86_64
cuda-license-7-0-7.0-28.x86_64
cuda-cusolver-7-0-7.0-28.x86_64
cuda-nvrtc-dev-7-0-7.0-28.x86_64
cuda-drivers-346.46-0.x86_64
cuda-misc-headers-7-0-7.0-28.x86_64
cuda-cusolver-dev-7-0-7.0-28.x86_64
cuda-samples-7-0-7.0-28.x86_64
cuda-repo-opensuse132-7-0-local-7.0-28.x86_64
cuda-cudart-dev-7-0-7.0-28.x86_64
cuda-nvrtc-7-0-7.0-28.x86_64
cuda-toolkit-7-0-7.0-28.x86_64
> rpm -qa | grep bumble
nvidia-bumblebee-346.59-1.1.x86_64
nvidia-bumblebee-32bit-346.59-1.1.x86_64
bumblebee-3.2.1-20.1.x86_64

For the record, I also installed :
nvidia-uvm-gfxG03-kmp-desktop-346.46_k3.16.6_2-0.x86_64
nvidia-gfxG03-kmp-desktop.346.46_k3.16.6_2-0.x86_64

And then removed them with Yast. I was trying to follow confusing Nvidia instructions for the installation.
But then I noticed, in one of your posts, that you only had the default flavours.
Still confused if I need those or not.

Hmmm, can you run

mkinitrd

and reboot.
If that gives nothing, try in YaST2 (search for “346.”), unconditionally update nVidia driver to the same version of the driver, no need to uninstall. And again run mkinitrd followed by a reboot.
May be that the driver needs to be installed last of all…
I had no problems with the mix of 346.46 and 346.59 https://forums.opensuse.org/showthread.php/507847-How-to-give-information-I-manage-to-get-CUDA-under-Bumblebee-to-work

(I’m really like mkinitrd, either it fix my problem, or not)

Hi,
Thanks for the suggestions. mkinitrd made no difference.
I had a look in Yast and there are some possible Bubmblebee updates. But I am reluctant : I am leaving in a week for
two months and this will be my only machine during that period. I am reluctant to meddle any more with the drivers.
I have posted a similar thread on Nvidia CUDA forums. Finger crossed.

I found this that is somewhat similar but I’m unsure what to do :

I hoping to still be able to use CUDA for computation only, not graphics.

I made a search on my whole hard drive for download libnvidia-tls.so.346 and I only found download libnvidia-tls.so.346.59 in various locations.
346.59 is the version of the Bumblebee Nvidia driver.

I could not find any libnvidia-tls.so.346.46 which is the version that should come with CUDA7.0 and that cause the warning :

/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: warning: libnvidia-tls.so.346.46, needed by /usr/X11R6/lib64/libGL.so, not found (try using -rpath or -rpath-link)

one of the places weare I could find ibnvidia-tls.so.346.59 is:

> ls -l /usr/lib/libnvidia-*
-rwxr-xr-x 1 root root 34121648 May 14  2015 /usr/lib/libnvidia-compiler.so.346.59
-rwxr-xr-x 1 root root 36964972 Feb 18  2015 /usr/lib/libnvidia-eglcore.so.346.46
-rwxr-xr-x 1 root root 40317828 Feb 18  2015 /usr/lib/libnvidia-glcore.so.346.46
-rwxr-xr-x 1 root root 40330756 May 14  2015 /usr/lib/libnvidia-glcore.so.346.59
-rwxr-xr-x 1 root root   494308 Feb 18  2015 /usr/lib/libnvidia-glsi.so.346.46
lrwxrwxrwx 1 root root       23 May 12 11:07 /usr/lib/libnvidia-ifr.so.1 -> libnvidia-ifr.so.346.46
-rwxr-xr-x 1 root root   166280 Feb 18  2015 /usr/lib/libnvidia-ifr.so.346.46
lrwxrwxrwx 1 root root       22 May 14  2015 /usr/lib/libnvidia-ml.so.1 -> libnvidia-ml.so.346.59
-rwxr-xr-x 1 root root   930480 May 14  2015 /usr/lib/libnvidia-ml.so.346.59
lrwxrwxrwx 1 root root       26 May 14  2015 /usr/lib/libnvidia-opencl.so.1 -> libnvidia-opencl.so.346.59                                            
-rwxr-xr-x 1 root root 13239316 May 14  2015 /usr/lib/libnvidia-opencl.so.346.59                                                                     
-rwxr-xr-x 1 root root    13752 May 14  2015 /usr/lib/libnvidia-tls.so.346.59      

So it looks like iit can’t be found because it’s not on my system.

In YAST, when I search for Nvidia, I can see an uninstalled x11-video-nvidiaG03 (346.46-0) :

# Status             Package                        | Summary                                  | Installed (Available)     |       Size

[Keep]               bumblebee                      | NVidia Optimus support for GNU/Linux ... | 3.2.1-20.1 (3.2.1-23.1)   |  176.8 KiB
[Keep]               cuda-repo-opensuse132-7-0-local | Contains configuration files needed t... | 7.0-28                    |   1.04 GiB
[Keep]               libdrm_nouveau2                | Userspace interface for Kernel DRM se... | 2.4.58-1.1                |   26.3 KiB
[Keep]               libdrm_nouveau2-32bit          | Userspace interface for Kernel DRM se... | 2.4.58-1.1                |   25.5 KiB
[Keep]               nvidia-bumblebee               | Installer for the proprietary graphic... | 346.59-1.1 (361.28-1.1)   |      885 B
[Keep]               nvidia-bumblebee-32bit         | Installer for the proprietary graphic... | 346.59-1.1 (361.28-1.1)   |      495 B
[Keep]               nvidia-computeG03              | NVIDIA driver for computing with GPGPU   | 346.46-0                  |   39.0 MiB
[Keep]               nvidia-gfxG03-kmp-default      | NVIDIA graphics driver kernel module ... | 346.46_k3.16.6_2-0        |   28.0 MiB
[Keep]               nvidia-gfxG03-kmp-desktop      | NVIDIA graphics driver kernel module ... | 346.46_k3.16.6_2-0        |   28.0 MiB
[Keep]               nvidia-glG03                   | NVIDIA GL libraries for OpenGL accele... | 346.46-0                  |  135.4 MiB
[Keep]               nvidia-texture-tools           | NVIDIA Texture Tools                     | 2.0.6-25.1.8              |  514.7 KiB
[Keep]               nvidia-uvm-gfxG03-kmp-default  | NVIDIA Unified Memory kernel module      | 346.46_k3.16.6_2-0        |   14.7 MiB
[Keep]               nvidia-uvm-gfxG03-kmp-desktop  | NVIDIA Unified Memory kernel module      | 346.46_k3.16.6_2-0        |   14.7 MiB
[Keep]               xf86-video-nouveau             | Accelerated Open Source driver for nV... | 1.0.11-1.3                |  217.4 KiB
[Keep]               xf86-video-nv                  | NVIDIA video driver for the Xorg X se... | 2.1.20-10.1.4             |  174.7 KiB
[Do Not Install]     asusfan                        | Fan Control for Nvidia-Based ASUS Gra... | (0.1-205.1.3)             |   70.0 KiB
[Do Not Install]     gpu-deployment-kit             | NVIDIA® Cluster Management Tools         | (346.46-0)                |  762.9 KiB
[Do Not Install]     nvdock                         | Tray icon for launching NVIDIA Settings  | (1.02-12.1.4)             |   24.0 KiB
[Do Not Install]     x11-video-nvidiaG03            | NVIDIA graphics driver for GeForce 8x... | (346.46-0)                |  135.9 MiB

Could that contain the missing libnvidia-tls.so.346.46 ?
Will trying to install it stuff up Bumblebee ?