CUDA 9.0 samples fail to compile in Ubuntu 16.04

hello,

I’ve installed CUDA 9.0 (on a GTX 750Ti with driver 384.81) in Ubuntu 16.04 and I’ trying to run cuda-samples

‘deviceQuery’ compiles and runs Ok, however many of the other sample programs fail to complile, giving errors in <common_functions.h>

for example while compiling ‘vectorAdd’ the output is the following:

can anyone help ?


mperl@zeus-EP31-DS3L:~/cuda-samples/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAdd$ make
“/usr/local/cuda”/bin/nvcc -ccbin g++ -I…/…/common/inc -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_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -o vectorAdd.o -c vectorAdd.cu
/usr/local/cuda/bin/…//include/crt/common_functions.h(73): error: explicit type is missing (“int” assumed)
/usr/local/cuda/bin/…//include/crt/common_functions.h(73): error: attribute “host” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(73): error: attribute “cudart_builtin” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(73): error: expected a “;”
/usr/local/cuda/bin/…//include/crt/common_functions.h(77): warning: parsing restarts here after previous syntax error
/usr/local/cuda/bin/…//include/crt/common_functions.h(129): error: explicit type is missing (“int” assumed)
/usr/local/cuda/bin/…//include/crt/common_functions.h(131): error: attribute “host” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(131): error: attribute “cudart_builtin” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(131): error: expected a “;”
/usr/local/cuda/bin/…//include/crt/common_functions.h(135): error: explicit type is missing (“int” assumed)
/usr/local/cuda/bin/…//include/crt/common_functions.h(137): error: attribute “host” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(137): error: attribute “cudart_builtin” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(137): error: expected a “;”
/usr/local/cuda/bin/…//include/crt/common_functions.h(140): error: explicit type is missing (“int” assumed)
/usr/local/cuda/bin/…//include/crt/common_functions.h(140): error: attribute “host” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(140): error: attribute “cudart_builtin” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(140): error: expected a “;”

/usr/local/cuda/bin/…//include/crt/common_functions.h(140): warning: parsing restarts here after previous syntax error
/usr/local/cuda/bin/…//include/crt/common_functions.h(141): error: explicit type is missing (“int” assumed)
/usr/local/cuda/bin/…//include/crt/common_functions.h(141): error: attribute “host” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(141): error: attribute “cudart_builtin” does not apply here
/usr/local/cuda/bin/…//include/crt/common_functions.h(141): error: expected a “;”
/usr/local/cuda/bin/…//include/crt/common_functions.h(141): warning: parsing restarts here after previous syntax error
20 errors detected in the compilation of “/tmp/tmpxft_00001af5_00000000-12_vectorAdd.compute_70.cpp1.ii”.
Makefile:273: recipe for target ‘vectorAdd.o’ failed
make: *** [vectorAdd.o] Error 1
mperl@zeus-EP31-DS3L:~/cuda-samples/NVIDIA_CUDA-9.0_Samples/0_Simple/vectorAdd$

many thanks in advance

M.P.

hi,man.

i have some quretions when CUDA is intalled,please give some ducmontes or support to intall CUDA,ok?

To CUDA is mine fist time…thank you!

For the installation I followed the instructions from the following URL:
https://kislayabhi.github.io/Installing_CUDA_with_Ubuntu/

M.P.

The recommended instructions to follow are here:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

thankyou