Installing cuda 9.2 on opensuse leap 15

Hi all,

Anyone had success installing cuda on opensuse leap 15? There is only a repo available for version 42.3.

I tried to use it and the installation seems to work ok, until I get to the post-installation and verification steps. I have successfully compiled the samples as specified in the doc. I have a NVidia GeForce GTX 860M and it was working well under OpenSuse Leap 42.3.

Any help would be greatly appreciated!

$ nvidia-persistenced --verbose
nvidia-persistenced failed to initialize. Check syslog for more details.
$ nvidia-smi
Failed to initialize NVML: Driver/library version mismatch
$ ./deviceQuery
./deviceQuery Starting...

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

cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL

From the doc:

If a CUDA-capable device and the CUDA Driver are installed but deviceQuery reports that no CUDA-capable devices are present, this likely means that the /dev/nvidia* files are missing or have the wrong permissions.

The related files in /dev:

$ ls /dev/nvidia*
crw-rw----+ 1 root video 195,   0 Aug 27 13:04 /dev/nvidia0
crw-rw----+ 1 root    33 195, 255 Aug 27 13:04 /dev/nvidiactl
crw-rw-rw-  1 root root  195, 254 Aug 27 13:04 /dev/nvidia-modeset
crw-rw-rw-+ 1 root root  243,   0 Aug 27 13:04 /dev/nvidia-uvm
crw-rw-rw-  1 root root  243,   1 Aug 27 14:13 /dev/nvidia-uvm-tools

These are the drivers version:

$ cat /proc/driver/nvidia/version 
NVRM version: NVIDIA UNIX x86_64 Kernel Module  390.77  Tue Jul 10 18:28:52 PDT 2018
GCC version:  gcc version 7.3.1 20180323 [gcc-7-branch revision 258812] (SUSE Linux)
$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148

I’ve these installed from nvidia:

$ sudo zypper se --installed nvidia
Loading repository data...
Reading installed packages...

S  | Name                      | Summary                                                               | Type   
---+---------------------------+-----------------------------------------------------------------------+--------
i+ | nvidia-computeG04         | NVIDIA driver for computing with GPGPU                                | package
i+ | nvidia-gfxG04-kmp-default | NVIDIA graphics driver kernel module for GeForce 400 series and newer | package
i+ | nvidia-glG04              | NVIDIA OpenGL libraries for OpenGL acceleration                       | package
i+ | x11-video-nvidiaG04       | NVIDIA graphics driver for GeForce 400 series and newer               | package

And these for cuda:

$ sudo zypper se --installed cuda
Loading repository data...
Reading installed packages...

S  | Name                         | Summary                                            | Type   
---+------------------------------+----------------------------------------------------+--------
i+ | cuda                         | CUDA meta-package                                  | package
i  | cuda-9-2                     | CUDA 9.2 meta-package                              | package
i  | cuda-command-line-tools-9-2  | CUDA command-line tools                            | package
i  | cuda-compiler-9-2            | CUDA core tools                                    | package
i  | cuda-cublas-9-2              | CUBLAS native runtime libraries                    | package
i  | cuda-cublas-dev-9-2          | CUBLAS native dev links, headers                   | package
i  | cuda-cudart-9-2              | CUDA Runtime native runtime libraries              | package
i  | cuda-cudart-dev-9-2          | CUDA Runtime native dev links, headers             | package
i  | cuda-cufft-9-2               | CUFFT native runtime libraries                     | package
i  | cuda-cufft-dev-9-2           | CUFFT native dev links, headers                    | package
i  | cuda-cuobjdump-9-2           | CUDA cuobjdump                                     | package
i  | cuda-cupti-9-2               | CUDA Profiling Tools Interface                     | package
i  | cuda-curand-9-2              | CURAND native runtime libraries                    | package
i  | cuda-curand-dev-9-2          | CURAND native dev links, headers                   | package
i  | cuda-cusolver-9-2            | CUSOLVER native runtime libraries                  | package
i  | cuda-cusolver-dev-9-2        | CUSOLVER native dev links, headers                 | package
i  | cuda-cusparse-9-2            | CUSPARSE native runtime libraries                  | package
i  | cuda-cusparse-dev-9-2        | CUSPARSE native dev links, headers                 | package
i  | cuda-demo-suite-9-2          | Set of pre-built demos using CUDA                  | package
i  | cuda-documentation-9-2       | CUDA documentation                                 | package
i  | cuda-driver-dev-9-2          | CUDA Driver native dev stub library                | package
i  | cuda-drivers                 | CUDA Driver meta-package                           | package
i  | cuda-gdb-9-2                 | CUDA debugger API                                  | package
i  | cuda-gpu-library-advisor-9-2 | CUDA GPU Library Advisor                           | package
i  | cuda-libraries-9-2           | CUDA Libraries 9.2 meta-package                    | package
i  | cuda-libraries-dev-9-2       | CUDA Libraries 9.2 development meta-package        | package
i  | cuda-license-9-2             | CUDA licenses                                      | package
i  | cuda-memcheck-9-2            | CUDA Memcheck                                      | package
i  | cuda-misc-headers-9-2        | CUDA miscellaneous headers                         | package
i  | cuda-npp-9-2                 | NPP native runtime libraries                       | package
i  | cuda-npp-dev-9-2             | NPP native dev links, headers                      | package
i  | cuda-nsight-9-2              | CUDA nsight                                        | package
i  | cuda-nvcc-9-2                | CUDA nvcc                                          | package
i  | cuda-nvdisasm-9-2            | CUDA disassembler                                  | package
i  | cuda-nvgraph-9-2             | NVGRAPH native runtime libraries                   | package
i  | cuda-nvgraph-dev-9-2         | NVGRAPH native dev links, headers                  | package
i  | cuda-nvml-dev-9-2            | NVML native dev links, headers.                    | package
i  | cuda-nvprof-9-2              | CUDA Profiler tools                                | package
i  | cuda-nvprune-9-2             | CUDA nvprune                                       | package
i  | cuda-nvrtc-9-2               | NVRTC native runtime libraries                     | package
i  | cuda-nvrtc-dev-9-2           | NVRTC native dev links, headers                    | package
i  | cuda-nvtx-9-2                | CUDA NVIDIA Tools Extension                        | package
i  | cuda-nvvp-9-2                | CUDA nvvp                                          | package
i+ | cuda-repo-opensuse423        | cuda repository configuration files                | package
i  | cuda-runtime-9-2             | CUDA Runtime 9.2 meta-package                      | package
i  | cuda-samples-9-2             | Contains an extensive set of example CUDA programs | package
i  | cuda-toolkit-9-2             | CUDA Toolkit 9.2 meta-package                      | package
i  | cuda-tools-9-2               | CUDA tools                                         | package
i  | cuda-visual-tools-9-2        | CUDA visual tools                                  | package

My setup is:

cat /proc/driver/nvidia/version:
NVRM version: NVIDIA UNIX x86_64 Kernel Module  396.37  Tue Jun 12 13:47:27 PDT 2018
GCC version:  gcc version 7.3.1 20180323 [gcc-7-branch revision 258812] (SUSE Linux)
nvidia-smi:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 396.37                 Driver Version: 396.37                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:02:00.0  On |                  N/A |
| 27%   47C    P8    13W / 250W |    359MiB / 11175MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      2532      G   /usr/bin/X                                    24MiB |
|    0      2560      G   /usr/bin/gnome-shell                          49MiB |
|    0      2732      G   /usr/bin/X                                   109MiB |
|    0      2854      G   /usr/bin/gnome-shell                         167MiB |
|    0      3952      G   /usr/lib64/firefox/firefox                     2MiB |
|    0      6167      G   /usr/lib64/firefox/firefox                     2MiB |
+-----------------------------------------------------------------------------+
nvcc -V:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148
uname -r:
4.12.14-lp150.12.16-default
cat /etc/*release:
NAME="openSUSE Leap"
VERSION="15.0"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.0"
PRETTY_NAME="openSUSE Leap 15.0"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.0"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

For the installation I used this sites:

First you need to install the NVIDIA Driver explained in the second link (in the first link you can read “Get the “right” NVIDIA driver installed” to find out which driver you should use). After the installation of the driver you can follow “How to install CUDA 9.2 on Ubuntu 18.04” from Step 3) to the end (you only need to change the Ubuntu 17.10 files to the OpenSuse 42.3 ones). All of this worked for me so fare.

I did it the dumb easy way - it took some trial and error

With a fresh opensuse leap 15 build.

1- Do NOT install the yAst Nvidia drivers.

2- Download BOTH the rpm and local run installer for cuda 9.2 for 42.3 FROM NVIDIA.

3- Install the rpm package per instructions including video driver

4- set LD_LIBRARY_PATH to the RPM install / lib64 location

5- reboot

6- optional build samples with make

7- INSTALL LOCAL bundle, but do NOT install the video driver (you should already have installed from the RPM), in a completely different file path

So yes, you will have 2 installations

8- nsight, as you may be aware won’t run on the rpm install - the required java runtime was not included. It was however included in the local bundle.

9- set cuda compiler in your projects to the RPM path. This is just precautionary.

10- Start NSIGHT from the local bundle install. VIOLA, you are done.

Why the above?

Cuda compiler in local bundle cannot find required libraries (the problem your describing) and the vid driver won’t install

Nsight in the rpm package won’t start because of missing java runtime.

A bit of hackwork described above overcomes these obstacles.

In the end, I followed the instruction I got from @torhans on the thread of this issue: [url]https://github.com/NVIDIA/nvidia-docker/issues/657[/url]

I never managed to compile the samples nor pass the test of Nvidia documentation but I am able to use tensorflow-gpu in a dedicated container which was the objective anyway :)

Hopefully, Nvidia will provide with an ad hoc installer one day but for now, I’m quite happy with the result…

Thanks to both of you for your help!