包括“driver_types.h”

包括“driver_types.h”

编辑:我刚刚从 tar 文件安装,但从 deb 文件安装仍然不起作用。

我希望我所在的论坛不错。我正在尝试在我的计算机上安装 Keras,但为此,我需要安装 tensorflow --> CUDNN、cuda、toolkit。

我遵循nvidia 文档,我执行了步骤 2.1.1。安装 NVIDIA 图形驱动程序,以及步骤 2.1.2。安装适用于 Linux 的 CUDA 工具包。在我看来,一切都很好,但我可能会误导自己。

然后在步骤 2.3.2.从 Debian 文件安装时,我按照要求做了,得到了这个:

r@R:~/Téléchargements$ sudo dpkg -i libcudnn7_7.6.5.32-1+cuda10.2_amd64.deb
[sudo] password of r : 
(Reading the database... 208719 already installed files and directories.)
Preparation for unpacking libcudnn7_7.6.5.32-1+cuda10.2_amd64.deb ...
Unpacking of libcudnn7 (7.6.5.32-1+cuda10.2) of (7.6.5.32-1+cuda10.2) ...
Configuration of libcudnn7 (7.6.5.32-1+cuda10.2) ...
Processing of deferred actions (« triggers ») for libc-bin (2.27-3ubuntu1) ...

这对我来说似乎很奇怪。CUDNN 似乎未安装。然后我尝试检查 2.4。验证 Linux 上的 cuDNN 安装:

r@R:~$ cp -r /usr/src/cudnn_samples_v7/ $HOME
r@R:~$ cd  $HOME/cudnn_samples_v7/mnistCUDNN
r@R:~/cudnn_samples_v7/mnistCUDNN$ make clean && make
rm -rf *o
rm -rf mnistCUDNN
Linking agains cublasLt = true
CUDA VERSION: 10020
TARGET ARCH: x86_64
HOST_ARCH: x86_64
TARGET OS: linux
SMS: 30 35 50 53 60 61 62 70 72 75
/usr/bin/ld : cannot find -lcudnn
collect2: error: ld returned 1 exit status
>>> WARNING - FreeImage is not set up correctly. Please ensure FreeImage is set up correctly. <<<
[@] /usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include -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_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o fp16_dev.o -c fp16_dev.cu
[@] g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp
[@] g++ -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -o mnistCUDNN.o -c mnistCUDNN.cpp
[@] /usr/local/cuda/bin/nvcc -ccbin g++ -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_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o mnistCUDNN fp16_dev.o fp16_emu.o mnistCUDNN.o -I/usr/local/cuda/include -I/usr/local/cuda/include -IFreeImage/include -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib64 -lcublasLt -LFreeImage/lib/linux/x86_64 -LFreeImage/lib/linux -lcudart -lcublas -lcudnn -lfreeimage -lstdc++ -lm
r@R:~/cudnn_samples_v7/mnistCUDNN$ ./mnistCUDNN
bash: ./mnistCUDNN: No such file or folder

因此,我认为安装失败。

我尝试在网上查找原因。在 /usr/local/cuda-10.2/lib64 中,我找不到 libcudnn.so 和 liblcudnn.so

我有两条用于 cuda 的路径,第一条似乎是空的......

r@R:~/Téléchargements$  whereis cuda
cuda: /usr/lib/cuda /usr/local/cuda
r@R:~/Téléchargements$ ldconfig -p | grep cudnn
libcudnn.so.7 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudnn.so.7
r@R:~/Téléchargements$ sudo cp -P include/cudnn.h /usr/include
[sudo] password of r : 
cp: impossible to assess 'include/cudnn.h': No such file or folder
r@R:~/Téléchargements$ cat $(whereis cudnn.h) | grep CUDNN_MAJOR -A 2
cat: 'cudnn:': No such file or folder
r@R:~/Téléchargements$ cat $(whereis cuda)/include/cudnn.h | grep CUDNN_MAJOR -A 2
cat: 'cuda:': No such file or folder
cat: /usr/lib/cuda: is a folder
cat: /usr/local/cuda/include/cudnn.h: No such file or folder

我不知道哪里出了问题,但是当我进行升级时:

r@R:~$ sudo apt-get upgrade
Reading package lists... Done
Building the dependency tree       
Reading status information... Done
You can do « apt --fix-broken install » to correct these problems.
The following packages contain unsatisfied dependencies :
 libcudnn7-doc : depends: libcudnn7-dev but it is not installable or
                          libcudnn7-dev-but it is not installable
 nvidia-cuda-toolkit : Depends: nvidia-cuda-dev (= 9.1.85-3ubuntu1) but it is not installed
E:unsatisfied dependencies. Try « apt --fix-broken install » without package
   (or indicate a solution).

我不知道问题出在 libcudnn7-dev 还是 CUDNN。你能帮我吗?

附言:我在没有使用英文的 ubuntu 18.04.3 的情况下工作,这就是为什么我可能翻译错误。

编辑:使用 tar 文件后我得到:

r@R:~$ cat $(whereis cuda)/include/cudnn.h | grep CUDNN_MAJOR -A 2
cat: 'cuda:': No file or folder of this type
cat: /usr/lib/cuda: is a folder
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 5
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

包括“driver_types.h”

所以我认为现在没问题了。

相关内容