CUDA and CUDNN installation problem

Greetings!

I have some problems and questions. I’m trying to configure Cuda 10 with CudNN 7.4 on Ubuntu 18.04 and when I have installed both things they were in separated folders, Cuda have installed in /usr/local/cuda-10.0 and CudNN in /usr/local/cuda, when I tried to compile mnistCUDNN it failed, then I tried to copy files of cudNN to cuda. It has compile but instead of getting a positive effect, I’ve got segmentation failure. The last thing I have tried was changing output file privileges with chmod 777 commend. However after that program still failed at some point. Have You any idea what should I do to get the positve effect?

Yours faithfully Krzysztof Kałuża

krs@krs-GP73-Leopard-8RE:~/cudnn_samples_v7$ cd mnistCUDNN/
krs@krs-GP73-Leopard-8RE:~/cudnn_samples_v7/mnistCUDNN$ make clean && make

result

rm -rf *o
rm -rf mnistCUDNN
cat: /usr/local/cuda/include/cuda.h: No such file or directory
/bin/sh: 1: test: -ge: unexpected operator
Linking agains cublasLt = false
CUDA VERSION: 
TARGET ARCH: x86_64
HOST_ARCH: x86_64
TARGET OS: linux
SMS: 30 35 50 53 60 61 62 70
/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found
>>> WARNING - FreeImage is not set up correctly. Please ensure FreeImage is set up correctly. <<<
[@] /usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include -IFreeImage/include -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o fp16_dev.o -c fp16_dev.cu
[@] g++ -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp
[@] g++ -I/usr/local/cuda/include -IFreeImage/include -o mnistCUDNN.o -c mnistCUDNN.cpp
[@] /usr/local/cuda/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o mnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o -I/usr/local/cuda/include -IFreeImage/include -LFreeImage/lib/linux/x86_64 -LFreeImage/lib/linux -lcudart -lcublas -lcudnn -lfreeimage -lstdc++ -lm
1 Like

after I reinstall cuda and cudnn it looks like they still not cooperate, please help

It doesn’t appear that CUDA is installed correctly.

Get your CUDA installers here: [url]http://www.nvidia.com/getcuda[/url]
Follow the instructions in the linux install guide:

[url]Installation Guide Linux :: CUDA Toolkit Documentation

Like You can see, the test shows that cuda has been installed properly.

krs@krs-GP73-Leopard-8RE:/usr/local/cuda-10.0/samples/bin/x86_64/linux/release$ ./deviceQuery  
./deviceQuery Starting...

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

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 1060"
  CUDA Driver Version / Runtime Version          10.0 / 10.0
  CUDA Capability Major/Minor version number:    6.1
  Total amount of global memory:                 6078 MBytes (6373572608 bytes)
  (10) Multiprocessors, (128) CUDA Cores/MP:     1280 CUDA Cores
  GPU Max Clock rate:                            1733 MHz (1.73 GHz)
  Memory Clock rate:                             4004 Mhz
  Memory Bus Width:                              192-bit
  L2 Cache Size:                                 1572864 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
  Maximum Layered 1D Texture Size, (num) layers  1D=(32768), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(32768, 32768), 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 2 copy engine(s)
  Run time limit on kernels:                     Yes
  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 supports Compute Preemption:            Yes
  Supports Cooperative Kernel Launch:            Yes
  Supports MultiDevice Co-op Kernel Launch:      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 = 10.0, CUDA Runtime Version = 10.0, NumDevs = 1
Result = PASS

Here you have my list of directories were cuda should be installed, in cuda directory has been unpacked cudnn, cuda has been installed in cuda-10.0, the cuda header cuda.h is not where cudnn has beeun unpacked.

krs@krs-GP73-Leopard-8RE:~$ cd /usr/local
krs@krs-GP73-Leopard-8RE:/usr/local$ ls -l
total 40
drwxr-xr-x  2 root root 4096 maj 20 22:09 bin
drwxr-xr-x  4 root root 4096 maj 20 22:21 cuda
drwxr-xr-x 20 root root 4096 maj 25 15:18 cuda-10.0
drwxr-xr-x  2 root root 4096 lut 10 01:12 etc
drwxr-xr-x  2 root root 4096 lut 10 01:12 games
drwxr-xr-x  3 root root 4096 maj 20 22:09 include
drwxr-xr-x  5 root root 4096 maj 20 22:09 lib
lrwxrwxrwx  1 root root    9 maj 20 19:20 man -> share/man
drwxr-xr-x  2 root root 4096 lut 10 01:12 sbin
drwxr-xr-x  6 root root 4096 lut 10 01:15 share
drwxr-xr-x  2 root root 4096 lut 10 01:12 src

That is why

cat: /usr/local/cuda/include/cuda.h: No such file or directory

and

/bin/sh: 1: /usr/local/cuda/bin/nvcc: not found

I have installed it already with this guide twice
Please help

Should I maybe change name of cuda-10.0 directory to cuda or something? Or is there other way to do it?

/usr/local/cuda is supposed to be a symlink to the cuda directory you want to use, i.e. /usr/local/cuda-10.0.

I’m not sure what you did. Did you install with the runfile installer and then respond with “no” when asked if you want to create this symlink?

I have installed Cuda from deb(local) option, as it was recommended
So should I make a symlink to this directory?

/usr/local/cuda should be a symlink

If it exists as an ordinary directory before you run the deb installer, it may be that the deb installer doesn’t create that symlink.

You should start over with a clean load of ubuntu 18.04 and install CUDA.

The symlink should be created for you. If not, yes, /usr/local/cuda should be symlinked to /usr/local/cuda-10.0