Search code examples
cudaopensuse

Compilation of cuda samples 'opensuse 13.1'


I have an installed cuda toolkit 6.5 on my opensuse 13.1, and have a problem with compiling cuda sample.

The output after make command is:

~# make

make[1]: Entering directory `/home/user/NVIDIA_CUDA-6.5_Samples/0_Simple/simpleStreams
/usr/local/cuda-6.5/bin/nvcc -ccbin g++ -I../../common/inc  -m64     -gencode arch=compute_11,code=sm_11 -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_50,code=compute_50 -o simpleStreams.o -c simpleStreams.cu
nvcc warning : The 'compute_11', 'compute_12', 'compute_13', 'sm_11', 'sm_12', and 'sm_13' architectures are deprecated, and may be removed in a future release.
g++: No such file or directory
make[1]: *** [simpleStreams.o] Error 1
make[1]: Leaving directory `/home/user/NVIDIA_CUDA-6.5_Samples/0_Simple/simpleStreams
make: *** [0_Simple/simpleStreams/Makefile.ph_build] Error 2

Versions of my nvcc and gcc are:

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2014 NVIDIA Corporation Built on Thu_Jul_17_21:41:27_CDT_2014 Cuda compilation tools, release 6.5, V6.5.12

gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux)

Can some one help me to solve this problem?


Solution

  • The nvcc doesn't like compute_1X flags where X is 1,2,3. Simply remove this: -gencode arch=compute_11,code=sm_11 code from the Makefile and you should compile correctly. Although this is just a warning is recommendable to fix all warnings to avoid trouble. Depending on nvcc configuration it may fail also when a warning occurs.

    The problem probably arises due to the fact it does not find g++ compiler. It may happen that you haven't installed gcc compiler for c++ which is the most probable cause. Or it may happen that you have installed it manually and is not on the PATH which is the less probable cause.

    To install gcc compiler for c++ follow this link. If it doesn't work the problem is not computer related.