[当文档暗示时在cuDNN上进行验证时:
- 编译mnistCUDNN示例。
$make clean && make
我遇到如下错误:
XXX@XXX ~/cudnn_samples_v7-master/mnistCUDNN $ make clean && make
rm -rf *o
rm -rf mnistCUDNN
/usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include -IFreeImage/include -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_53,code=compute_53 -o fp16_dev.o -c fp16_dev.cu
g++ -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp
In file included from fp16_emu.cpp:50:
fp16_emu.h:55:10: fatal error: driver_types.h: No such file or directory
#include <driver_types.h>
^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:200: fp16_emu.o] Error 1
我尝试过:
sudo find / -name driver_types.h
我发现driver_types.h实际上在
/ usr / local / cuda / targets / x86_64-linux / include /
而不是
/ usr / local / cuda / include。
所以我替换了
CUDNN_INCLUDE_PATH ?= $(CUDA_PATH)/include
with
CUDNN_INCLUDE_PATH ?= $(CUDA_PATH)/targets/x86_64-linux/include
在cudnn_samples_v7 / mnistCUDNN / Makefile
问题已解决。我希望这会对某人有所帮助。
平台和版本:
[driver_types.h
实际上在/usr/local/cuda/targets/x86_64-linux/include
中
替换
CUDNN_INCLUDE_PATH ?= $(CUDA_PATH)/include
with
CUDNN_INCLUDE_PATH ?= $(CUDA_PATH)/targets/x86_64-linux/include
在cudnn_samples_v7/mnistCUDNN/Makefile
中