作者:勇于明天2015 | 来源:互联网 | 2023-05-17 20:24
[root@ca206 cuda]# nvcc -o add5 add5.cu
add5.cu:4:20: error: cutil.h: No such file or directory
[root@ca206 cuda]# find / -name cutil.h
/home/gpu-tutorials/code/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/inc/cutil.h
/home/gpu-tutorials/code/NVIDIA_GPU_Computing_SDK/C/common/inc/cutil.h
[root@ca206 cuda]# nvcc -o add5 add5.cu -I/home/gpu-tutorials/code/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/inc/cutil.h
cc1plus: error: /home/gpu-tutorials/code/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/inc/cutil.h: not a directory 因为-I后需是一个目录
正确编译方法:
1、nvcc -o add5 add5.cu -I/home/gpu-tutorials/code/NVIDIA_GPU_Computing_SDK/CUDALibraries/common/inc
或2、nvcc -o add5 add5.cu -I/home/gpu-tutorials/code/NVIDIA_GPU_Computing_SDK/C/common/inc