About error of building NVIDIA_CUDA-8.0_Samples after DIGITS installation.

Hello all,

I would like to build the cuda-toolkit’s sample code (NVIDIA_CUDA-8.0_Samples).

When I build the NVIDIA_CUDA-8.0_Samples after DIGITS installation, the following error is happened.
There was no problem before DIGITS installation.
(DIGITS will work without problems)

ubuntu@ubuntu:~/NVIDIA_CUDA-8.0_Samples$ make
make[1]: Entering directory `/home/ubuntu/NVIDIA_CUDA-8.0_Samples/0_Simple/simplePitchLinearTexture'
"/usr/local/cuda-8.0"/bin/nvcc -ccbin g++ -I../../common/inc  -m64    -gencode arch=compute_20,code=sm_20 -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_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o simplePitchLinearTexture.o -c simplePitchLinearTexture.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
In file included from <command-line>:0:0:
/usr/include/stdc-predef.h:59:1: fatal error: cuda_runtime.h: No such file or directory
 #endif
 ^
compilation terminated.
make[1]: *** [simplePitchLinearTexture.o] Error 1
make[1]: Leaving directory `/home/ubuntu/NVIDIA_CUDA-8.0_Samples/0_Simple/simplePitchLinearTexture'
make: *** [0_Simple/simplePitchLinearTexture/Makefile.ph_build] Error 2

I think, CUDA directory path has been changed by installing DIGITS. nvcc can not find include path: /usr/local/cuda-8.0/include .
(/usr/local/cuda-8.0 -> /usr/local/cuda-8.0/targets/x86_64-linux ?)

Is there a way to avoid it?

Ubuntu version : ubuntu 14.04LTS
cuda-toolkit : cuda_8.0.61_375.26_linux.run
instructions on installing DIGITS : https://github.com/NVIDIA/DIGITS/blob/master/docs/UbuntuInstall.md

thanks

You installed CUDA 8 using the runfile installer. Then you reinstalled CUDA 8 with DIGITS using the package manager method.

This is explicitly called out in the CUDA linux install guide as something to avoid. The problem is that the samples were configured against the runfile install and then you overwrote it with the package manager install.

Start over with a clean machine (no CUDA 8 install) and just install DIGITS. It will pull in CUDA 8 along with it.

You could also try just deleting the /usr/local/cuda/samples directory, and try running:

sudo apt-get install cuda-samples-8-0

(this is the “package manager” method to install just the sample)

This presumes you are doing this command immediately after installing DIGITS according to the method you linked.

If it has been sometime since you did that, you may need to precede that with the commands to set up the deb again. Follow the instructions in the linux install guide, using the appropriate deb file for Ubuntu 14.04

Hi txbob
Thanks for the reply.

I understood why the error occurred.
I will check CUDA linux instllation guide again and review the installation procedure.