TensorRT3.0.4编译问题解决

xxxx@ubuntu:~/TensorRT-3.0.4/samples$ make
make[1]: Entering directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/sampleMNIST'
../Makefile.config:6: CUDA_INSTALL_DIR variable is not specified, using /usr/local/cuda- by default, use CUDA_INSTALL_DIR=<cuda_directory> to change.
../Makefile.config:9: CUDNN_INSTALL_DIR variable is not specified, using  by default, use CUDNN_INSTALL_DIR=<cudnn_directory> to change.
if [ ! -d ../../bin/dchobj ]; then mkdir -p ../../bin/dchobj; fi
g++ -MM -MF ../../bin/dchobj/sampleMNIST.d -MP -MT ../../bin/dchobj/sampleMNIST.o -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT sampleMNIST.cpp
Compiling: sampleMNIST.cpp
g++ -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT -g -c -o ../../bin/dchobj/sampleMNIST.o sampleMNIST.cpp
sampleMNIST.cpp:9:30: fatal error: cuda_runtime_api.h: No such file or directory
compilation terminated.
../Makefile.config:176: recipe for target '../../bin/dchobj/sampleMNIST.o' failed
make[1]: *** [../../bin/dchobj/sampleMNIST.o] Error 1
make[1]: Leaving directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/sampleMNIST'
make[1]: Entering directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/sampleMNISTAPI'
../Makefile.config:6: CUDA_INSTALL_DIR variable is not specified, using /usr/local/cuda- by default, use CUDA_INSTALL_DIR=<cuda_directory> to change.
../Makefile.config:9: CUDNN_INSTALL_DIR variable is not specified, using  by default, use CUDNN_INSTALL_DIR=<cudnn_directory> to change.
if [ ! -d ../../bin/dchobj ]; then mkdir -p ../../bin/dchobj; fi
g++ -MM -MF ../../bin/dchobj/sampleMNISTAPI.d -MP -MT ../../bin/dchobj/sampleMNISTAPI.o -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT sampleMNISTAPI.cpp
sampleMNISTAPI.cpp:3:30: fatal error: cuda_runtime_api.h: No such file or directory
compilation terminated.
../Makefile.config:176: recipe for target '../../bin/dchobj/sampleMNISTAPI.o' failed
make[1]: *** [../../bin/dchobj/sampleMNISTAPI.o] Error 1
make[1]: Leaving directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/sampleMNISTAPI'
make[1]: Entering directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/sampleGoogleNet'
../Makefile.config:6: CUDA_INSTALL_DIR variable is not specified, using /usr/local/cuda- by default, use CUDA_INSTALL_DIR=<cuda_directory> to change.
../Makefile.config:9: CUDNN_INSTALL_DIR variable is not specified, using  by default, use CUDNN_INSTALL_DIR=<cudnn_directory> to change.
if [ ! -d ../../bin/dchobj ]; then mkdir -p ../../bin/dchobj; fi
g++ -MM -MF ../../bin/dchobj/sampleGoogleNet.d -MP -MT ../../bin/dchobj/sampleGoogleNet.o -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT sampleGoogleNet.cpp
Compiling: sampleGoogleNet.cpp
g++ -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT -g -c -o ../../bin/dchobj/sampleGoogleNet.o sampleGoogleNet.cpp
sampleGoogleNet.cpp:10:30: fatal error: cuda_runtime_api.h: No such file or directory
compilation terminated.
../Makefile.config:176: recipe for target '../../bin/dchobj/sampleGoogleNet.o' failed
make[1]: *** [../../bin/dchobj/sampleGoogleNet.o] Error 1
make[1]: Leaving directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/sampleGoogleNet'
make[1]: Entering directory '/home/zhangwei/TensorRT-3.0.4/targets/x86_64-linux-gnu/samples/giexec'
../Makefile.config:6: CUDA_INSTALL_DIR variable is not specified, using /usr/local/cuda- by default, use CUDA_INSTALL_DIR=<cuda_directory> to change.
../Makefile.config:9: CUDNN_INSTALL_DIR variable is not specified, using  by default, use CUDNN_INSTALL_DIR=<cudnn_directory> to change.
if [ ! -d ../../bin/dchobj ]; then mkdir -p ../../bin/dchobj; fi
g++ -MM -MF ../../bin/dchobj/giexec.d -MP -MT ../../bin/dchobj/giexec.o -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT giexec.cpp
Compiling: giexec.cpp
g++ -Wall -std=c++11 -I"/usr/local/cuda-/include" -I"/usr/local/include" -I"../include" -I"../common" -I"/usr/local/cuda-/include" -I"../../include"  -D_REENTRANT -g -c -o ../../bin/dchobj/giexec.o giexec.cpp
giexec.cpp:9:30: fatal error: cuda_runtime_api.h: No such file or directory



当编译出现上述问题时,主要是无法找到cuda的依赖包,解决办法如下:

sudo make clean

sudo make CUDA_INSTALL_DIR=/usr/local/cuda

  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值