Darknet CUDA/CUDANN环境的快速安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Darknet CUDA/CUDANN环境的快速安装相关的知识,希望对你有一定的参考价值。


在具备GPU显卡且主持CUDA的纯净的UBUNTU18.04系统上,按照如下指导文档安装 Nvidia 显卡驱动。


之后,下载darknet

git clone https://github.com/AlexeyAB/darknet.git

进入darknet/scripts,执行命令:

sudo ./scripts/setup.sh --InstallCUDA

Darknet

最后输出pwsh的错误 貌似没有太大影响。

在.bashrc文件中添加如下设置环境变量:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.5/lib64
export PATH=$PATH:/usr/local/cuda-11.5/bin:/usr/local/cuda/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-11.5

安装opencv, python opencv:

sudo apt install libopencv-dev

之后安装​​Anaconda3-2020.11-Linux-x86_64.sh​​参考下面博客


安装完毕anaconda后,升级PIP工具,不升级会在安装PYTHON OPENCV的时候失败。

pip3 install --upgrade pip

之后执行

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple scikit-build
pip3 install opencv-python

Darknet

编译darknet,打开GPU,CUDA,OPENCV支持。

Darknet

下载YOLOV3权重

wget -c https://pjreddie.com/media/files/yolov3.weights

验证单张图片,执行./image_yolov3.sh

Darknet

验证摄像头采集

修改darknet_video.py实现,将默认的YOLOV4模型修改为YOLOV3模型。

Darknet

最后,执行python3 darknet_video.py

或者不修改原始测试文件,直接执行

python darknet_video.py --config_file=./cfg/yolov3.cfg --weights=yolov3.weights

Darknet

Darknet

由于使能了GPU,检测帧率有明显提升。输入命令watch -n 1 nvidia-smi命令监视显卡一举一动:

Darknet

使用显卡的有三个程序,由于我们将nouveau加入了黑名单,所以XORG使用了NVIDIA的显卡驱动做渲染。同时我开了一个python作实时的码流检测。同时开启了CUDA-Z查看显卡信息。

补充:

中科大和ALIYUN的下载源,替换后不是一般的快,但是这样作也有一个缺点,就是用apt命令安装某些软件包的时候,会发生系统认为当前的版本为非LTS支持版本而无法处理依赖,导致安装进行不下去的情况,则个时候需要恢复原来的source.list文件中的内容,才能恢复。

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

总结:

从验证结果看,darknet环境安装--InstallCUDA并不会自动安装N卡驱动,为确保万无一失,N卡驱动需要单独安装,并且先于CUDA环境的安装。

GPU显卡驱动分为两类,一类叫做UMD(user mode driver)和KMD(kernel mode driver).

nvidia.ko属于KMD,KMD是真正跟GPU打交道的Driver, 而opengl,libcuda.so, libcudart.so则属于UMD

Darknet

Darknet

无论是 nvidia.ko,还是 libcuda.so,还是 libcudart.so,都是被剥离了符号表的,大多数函数名是加密替换了的,nvidia的生态还是比较封闭的。

nvidia-smi principle:

strace -e trace=open,openat,read,write nvidia-smi
czl@czl-RedmiBook-14:~$ strace -e trace=open,openat,read,write nvidia-smi
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/glibc-hwcaps/x86-64-v3/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/glibc-hwcaps/x86-64-v2/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/tls/haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/tls/haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/haswell/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/haswell/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\\177ELF\\2\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 832) = 832
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\\177ELF\\2\\1\\1\\3\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 832) = 832
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\\177ELF\\2\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 832) = 832
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\\177ELF\\2\\1\\1\\3\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\0P\\237\\2\\0\\0\\0\\0\\0"..., 832) = 832
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\\177ELF\\2\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 832) = 832
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libnvidia-ml.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\\177ELF\\2\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\00000\\1\\0\\0\\0\\0\\0"..., 832) = 832
openat(AT_FDCWD, "/proc/modules", O_RDONLY) = 3
read(3, "binfmt_misc 24576 1 - Live 0x000"..., 1024) = 1024
read(3, "00000000000\\nalgif_hash 16384 1 -"..., 1024) = 1024
read(3, "e 0x0000000000000000\\nghash_clmul"..., 1024) = 1024
openat(AT_FDCWD, "/proc/driver/nvidia/params", O_RDONLY) = 3
read(3, "ResmanDebugLevel: 4294967295\\nRmL"..., 1024) = 878
openat(AT_FDCWD, "/dev/nvidiactl", O_RDWR) = 3
openat(AT_FDCWD, "/sys/devices/system/memory/block_size_bytes", O_RDONLY) = 4
read(4, "8000000\\n", 99) = 8
openat(AT_FDCWD, "/proc/devices", O_RDONLY) = 4
read(4, "Character devices:\\n 1 mem\\n 4 /"..., 1024) = 779
openat(AT_FDCWD, "/proc/driver/nvidia/capabilities/mig/config", O_RDONLY) = 4
read(4, "DeviceFileMinor: 1\\nDeviceFileMod"..., 1024) = 59
openat(AT_FDCWD, "/proc/driver/nvidia/capabilities/mig/config", O_RDONLY) = 4
read(4, "DeviceFileMinor: 1\\nDeviceFileMod"..., 1024) = 59
read(4, "", 1024) = 0
openat(AT_FDCWD, "/proc/devices", O_RDONLY) = 4
read(4, "Character devices:\\n 1 mem\\n 4 /"..., 1024) = 779
openat(AT_FDCWD, "/proc/driver/nvidia/capabilities/mig/monitor", O_RDONLY) = 4
read(4, "DeviceFileMinor: 2\\nDeviceFileMod"..., 1024) = 59
openat(AT_FDCWD, "/proc/driver/nvidia/capabilities/mig/monitor", O_RDONLY) = 4
read(4, "DeviceFileMinor: 2\\nDeviceFileMod"..., 1024) = 59
read(4, "", 1024) = 0
openat(AT_FDCWD, "/dev/nvidia-caps/nvidia-cap2", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/proc/driver/nvidia/params", O_RDONLY) = 4
read(4, "ResmanDebugLevel: 4294967295\\nRmL"..., 1024) = 878
openat(AT_FDCWD, "/dev/nvidia0", O_RDWR|O_CLOEXEC) = 4
openat(AT_FDCWD, "/proc/driver/nvidia/params", O_RDONLY) = 6
read(6, "ResmanDebugLevel: 4294967295\\nRmL"..., 1024) = 878
openat(AT_FDCWD, "/dev/nvidia0", O_RDWR|O_CLOEXEC) = 6
openat(AT_FDCWD, "/proc/driver/nvidia/params", O_RDONLY) = 7
read(7, "ResmanDebugLevel: 4294967295\\nRmL"..., 1024) = 878
openat(AT_FDCWD, "/dev/nvidia0", O_RDWR|O_CLOEXEC) = 7
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 8
read(8, "TZif2\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 4096) = 561
read(8, "TZif2\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 4096) = 342
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/x86_64/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/haswell/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/x86_64/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "tls/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/x86_64/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "haswell/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "x86_64/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/cuda-11.7/lib64/libcuda.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 8
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libcuda.so.1", O_RDONLY|O_CLOEXEC) = 8
read(8, "\\177ELF\\2\\1\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\3\\0>\\0\\1\\0\\0\\0\\320M\\r\\0\\0\\0\\0\\0"..., 832) = 832
write(1, "Mon Oct 24 22:20:30 2022 \\n", 32Mon Oct 24 22:20:30 2022
) = 32
write(1, "+-------------------------------"..., 80+-----------------------------------------------------------------------------+
) = 80
write(1, "| NVIDIA-SMI 515.65.01 Driver"..., 80| NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7 |
) = 80
write(1, "|-------------------------------"..., 80|-------------------------------+----------------------+----------------------+
) = 80
write(1, "| GPU Name Persistence-M"..., 80| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
) = 80
write(1, "| Fan Temp Perf Pwr:Usage/Cap"..., 80| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
) = 80
write(1, "| "..., 80| | | MIG M. |
) = 80
write(1, "|==============================="..., 80|===============================+======================+======================|
) = 80
write(8, "\\200\\0\\08\\220H\\273\\253\\0\\0\\0\\0\\0\\0\\0\\2\\0\\0\\210\\276\\0\\0\\0\\1\\0\\0\\0\\2\\0\\0\\0\\0"..., 60) = 60
read(8, "\\200\\0\\0 \\220H\\273\\253\\0\\0\\0\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0"..., 9000) = 36
write(1, "| 0 NVIDIA GeForce ... Off "..., 240| 0 NVIDIA GeForce ... Off | 00000000:02:00.0 Off | N/A |
| N/A 40C P8 N/A / N/A | 4MiB / 2048MiB | 0% Default |
| | | N/A |
) = 240
write(1, "+-------------------------------"..., 80+-------------------------------+----------------------+----------------------+
) = 80
write(1, " "..., 480
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
) = 480
openat(AT_FDCWD, "/proc/2249/cmdline", O_RDONLY) = 8
read(8, "/usr/lib/xorg/Xorg\\0vt2\\0-displayf"..., 4096) = 144
read(8, "", 3072) = 0
write(1, "| 0 N/A N/A 2249 "..., 80| 0 N/A N/A 2249 G /usr/lib/xorg/Xorg 4MiB |
) = 80
write(1, "+-------------------------------"..., 80+-----------------------------------------------------------------------------+
) = 80
+++ exited with 0 +++
czl@czl-RedmiBook-14:~$

according the trace of nvida-smi, we can find the device node of the progra need open is:

Darknet


结束!

以上是关于Darknet CUDA/CUDANN环境的快速安装的主要内容,如果未能解决你的问题,请参考以下文章

[软件工具][原创]yolov7快速训练助手使用教程傻瓜式训练不需要写代码配置参数

darknet训练yolov7-tiny(AlexeyAB版本)

(转)Darknet模型与Tensorflow模型相互转换

Zabbix环境快速搭建信安世纪(SecDriver)

yoloV3一步步训练自己的数据

无须搭建环境,只需十分钟使用Google Colab平台,基于YOLOv4和Darknet来实现的物体检测