为什么我已经安装了 cuda toolkit 和 cudnn ,但是 opencv 却找不到 cudnn 呢?
我需要实现『在 ubuntu 上安装支持 cuda 的 opencv,用于 python 调用 opencv+nvidia GPU』
所以,我按照下面的教程安装了 cuda toolkit
cuda toolkit Download
按照下面的教程安装了 cudnn
NVIDIA Deep Learning cuDNN Documentation
按照下面的教程安装了 opencv
Installing OpenCV 4 with CUDA in Ubuntu 22.04
然后编译 opencv 的时候,报错找不到 cudnn
可以找到 cuda,但是找不到 cudnn
但是我这里是有 cudnn 的:
─➤ ls -alh /usr/local/cuda/lib64/libcudnn*lrwxrwxrwx 1 root root 23 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_adv_infer.so -> libcudnn_adv_infer.so.8
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_adv_infer.so.8 -> libcudnn_adv_infer.so.8.8.0
-rwxr-xr-x 1 root root 120M Mar 9 12:28 /usr/local/cuda/lib64/libcudnn_adv_infer.so.8.8.0
-rw-r--r-- 1 root root 123M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_adv_infer_static.a
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_adv_infer_static_v8.a -> libcudnn_adv_infer_static.a
lrwxrwxrwx 1 root root 23 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_adv_train.so -> libcudnn_adv_train.so.8
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_adv_train.so.8 -> libcudnn_adv_train.so.8.8.0
-rwxr-xr-x 1 root root 114M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_adv_train.so.8.8.0
-rw-r--r-- 1 root root 116M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_adv_train_static.a
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_adv_train_static_v8.a -> libcudnn_adv_train_static.a
lrwxrwxrwx 1 root root 23 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_cnn_infer.so -> libcudnn_cnn_infer.so.8
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_cnn_infer.so.8 -> libcudnn_cnn_infer.so.8.8.0
-rwxr-xr-x 1 root root 613M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_cnn_infer.so.8.8.0
-rw-r--r-- 1 root root 797M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_cnn_infer_static.a
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_cnn_infer_static_v8.a -> libcudnn_cnn_infer_static.a
lrwxrwxrwx 1 root root 23 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_cnn_train.so -> libcudnn_cnn_train.so.8
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_cnn_train.so.8 -> libcudnn_cnn_train.so.8.8.0
-rwxr-xr-x 1 root root 100M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_cnn_train.so.8.8.0
-rw-r--r-- 1 root root 150M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_cnn_train_static.a
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_cnn_train_static_v8.a -> libcudnn_cnn_train_static.a
lrwxrwxrwx 1 root root 23 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_ops_infer.so -> libcudnn_ops_infer.so.8
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_ops_infer.so.8 -> libcudnn_ops_infer.so.8.8.0
-rwxr-xr-x 1 root root 87M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_ops_infer.so.8.8.0
-rw-r--r-- 1 root root 90M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_ops_infer_static.a
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_ops_infer_static_v8.a -> libcudnn_ops_infer_static.a
lrwxrwxrwx 1 root root 23 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_ops_train.so -> libcudnn_ops_train.so.8
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_ops_train.so.8 -> libcudnn_ops_train.so.8.8.0
-rwxr-xr-x 1 root root 68M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_ops_train.so.8.8.0
-rw-r--r-- 1 root root 68M Mar 9 12:29 /usr/local/cuda/lib64/libcudnn_ops_train_static.a
lrwxrwxrwx 1 root root 27 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn_ops_train_static_v8.a -> libcudnn_ops_train_static.a
lrwxrwxrwx 1 root root 13 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn.so -> libcudnn.so.8
lrwxrwxrwx 1 root root 17 Mar 9 12:20 /usr/local/cuda/lib64/libcudnn.so.8 -> libcudnn.so.8.8.0
-rwxr-xr-x 1 root root 147K Mar 9 12:29 /usr/local/cuda/lib64/libcudnn.so.8.8.0
为什么呢?
贴一下附件信息
─➤ nvcc --versionnvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb__7_19:32:13_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0
以上是 为什么我已经安装了 cuda toolkit 和 cudnn ,但是 opencv 却找不到 cudnn 呢? 的全部内容, 来源链接: utcz.com/p/938784.html