cuda_device_functions.h:32:31: fatal error: cuda/include/cuda.h: 没有那个文件或目录

一 Light Head RCNN编译问题

根据https://github.com/zengarden/light_head_rcnn进行编译的过程中,在lib下运行bash make.sh,会报两个相似的错误,一个是psalign_pooling,一个是psroi_pooling。错误如下:

/home/tf/anaconda3/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_device_functions.h:32:31: fatal error: cuda/include/cuda.h: 没有那个文件或目录

/home/tf/anaconda3/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_device_functions.h:32:31: fatal error: cuda/include/cuda.h: 没有那个文件或目录

打开编译文件:/home/tf/light_head_rcnn/lib/lib_kernel/lib_psalign_pooling/make.sh
内容如下:这里写图片描述
运行第一行括号里面的内容,可以输出include的路径:输出路径如下:
/home/tf/anaconda3/lib/python3.6/site-packages/tensorflow/include
它报的错误在cuda_device_functions.h里面32行#include “cuda/include/cuda.h”,上一行的路径里面没有cuda.h。cuda.h是在/usr/local/cuda-9.0/include/cuda.h这儿的。问题在这儿。

解决

由于我是两个用户下的cuda版本不一样,usr/local/cuda链接的是cuda8,cuda9是在bashrc里面添加变量来实现的。
1:首先将第三行变为/usr/local/cuda-9.0。编译之后和原来一样
2:在nvcc里面添加路径
这里写图片描述
添加之后,编译,报的错误会不一样,查看编译信息,发现有的调用cuda8的,有调用cuda9的。
3:将usr/local/cuda链接到cuda9,再进行编译,编译成功

sudo ln -s cuda-9.0 cuda9#建立软链接命令
sudo mv cuda cuda8#重命名命令

等编译完成后,再换回原来的,保证不会影响另一个用户

1:train的时候报:No module named ‘setproctitle’
pip install setproctitle

CMake Warning: Ignoring extra path from command line: "../openMVS" -- Detected version of GNU GCC: 94 (904) Compiling with C++17 CMake Error at /home/xujx/.local/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:751 (message): Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed. Compiler: /usr/bin/nvcc Build flags: Id flags: --keep;--keep-dir;tmp -v The output was: 255 #$ _SPACE_= #$ _CUDART_=cudart #$ _HERE_=/usr/lib/nvidia-cuda-toolkit/bin #$ _THERE_=/usr/lib/nvidia-cuda-toolkit/bin #$ _TARGET_SIZE_= #$ _TARGET_DIR_= #$ _TARGET_SIZE_=64 #$ NVVMIR_LIBRARY_DIR=/usr/lib/nvidia-cuda-toolkit/libdevice #$ PATH=/usr/lib/nvidia-cuda-toolkit/bin:/usr/local/cuda-11.8/bin:/home/xujx/anaconda3/bin:/home/xujx/anaconda3/condabin:/home/xujx/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin #$ LIBRARIES= -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/x86_64-linux-gnu #$ rm tmp/a_dlink.reg.c #$ gcc -D__CUDA_ARCH__=300 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__ -D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=1 -D__CUDACC_VER_BUILD__=243 -include "cuda_runtime.h" -m64 "CMakeCUDACompilerId.cu" > "tmp/CMakeCUDACompilerId.cpp1.ii" #$ cicc --c++14 --gnu_version=90400 --allow_managed -arch compute_30 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "CMakeCUDACompilerId.fatbin.c" -tused -nvvmir-library "/usr/lib/nvidia-cuda-toolkit/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "tmp/CMakeCUDACompilerId.module_id" --orig_src_file_name "CMakeCUDACompilerId.cu" --gen_c_file_name "tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name "tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name "tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o "tmp/CMakeCUDACompilerId.ptx" #$ ptxas -arch=sm_30 -m64 "tmp/CMakeCUDACompilerId.ptx" -o "tmp/CMakeCUDACompilerId.sm_30.cubin" ptxas fatal : Value 'sm_30' is not defined for option 'gpu-name' # --error 0xff -- Call Stack (most recent call first): /home/xujx/.local/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD) /home/xujx/.local/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test) /home/xujx/.local/lib/python3.8/site-packages/cmake/data/share/cmake-3.26/Modules/CMakeDetermineCUDACompiler.cmake:307 (CMAKE_DETERMINE_COMPILER_ID) CMakeLists.txt:109 (ENABLE_LANGUAGE)是什么问题
07-08
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值