linux下CUDA编译报错:fatal error: cudnn_version.h: No such file or directory

参考:https://github.com/pjreddie/darknet/issues/2356
我linux18.04,cuda11.0+cudnn8.05,make命令darknet的时候报错
原因是新版的cudnn比旧版的多了几个文件:
一般旧版cudnn安装的时候是通过以下命令:

sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 

但新版的cudnn需要用:

sudo cp cuda/include/cudnn*.h /usr/local/cuda/include  
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64  
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 

注意第一句多了一个*

你可能感兴趣的:(cuda,cudnn,python,cmake,深度学习)