当前位置:   article > 正文

TensorRT使用过程中的问题记录1_cuda_install_dir variable is not specified, using

cuda_install_dir variable is not specified, using /usr/local/cuda by default

Fatal Error: cuda_runtime.h: No such file or directory解决办法

1. 在make编译时,出现以下错误。

…/Makefile.config:10: CUDA_INSTALL_DIR variable is not specified, using /usr/local/cuda by default, use CUDA_INSTALL_DIR=<cuda_directory> to change.
…/Makefile.config:15: CUDNN_INSTALL_DIR variable is not specified, using /usr/local/cuda by default, use CUDNN_INSTALL_DIR=<cudnn_directory> to change.
…/Makefile.config:28: TRT_LIB_DIR is not specified, searching …/…/lib, …/…/lib, …/lib by default, use TRT_LIB_DIR=<trt_lib_directory> to change.
if [ ! -d …/…/bin/chobj/…/common ]; then mkdir -p …/…/bin/dchobj/…/common; fi; :
Compiling: sampleMNIST.cpp
In file included from …/common/buffers.h:20:0,
from sampleMNIST.cpp:26:
…/common/common.h:38:30: fatal error: cuda_runtime_api.h: No such file or directory
compilation terminated.
make: *** […/Makefile.config:324: …/…/bin/dchobj/sampleMNIST.o] Error 1
是cuda版本的问题。因为环境中有多个cuda版本或者cuda的没有添加cuda的环境。

2. 解决方法。

make CUDA_INSTALL_DIR=/usr/local/cuda-veision(指定cuda来编译)
eg:make CUDA_INSTALL_DIR=/usr/local/cuda-10.0/10.2等。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/57597
推荐阅读
相关标签
  

闽ICP备14008679号