我想用GPU支持编译暗网。为此,我在 Makefile 中更改了以下设置:
GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
AVX=0
OPENMP=0
LIBSO=0
ZED_CAMERA=0
我安装了Cuda 10.0(也尝试了10.1-没有成功)和nvidia驱动程序。这是nvidia -smi的输出:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.87.01 Driver Version: 418.87.01 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 208... On | 00000000:01:00.0 Off | N/A |
| 30% 26C P8 11W / 250W | 438MiB / 10989MiB | 4% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1223 G /usr/lib/xorg/Xorg 307MiB |
| 0 1501 G /usr/bin/gnome-shell 129MiB |
+-----------------------------------------------------------------------------+
和nvcc -V:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
我可以运行示例,如有关如何从nvidia安装cuda和cuDNN的文档中所述,但是当我编译darknet时,会出现此错误:
/network_kernels.o obj/avgpool_layer_kernels.o -o darknet -lm -pthread `pkg-config --libs opencv` -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -L/usr/local/cudnn/lib64 -lcudnn -lstdc++
/usr/bin/ld: -lcuda kann nicht gefunden werden
collect2: error: ld returned 1 exit status
Makefile:143: recipe for target 'darknet' failed
make: *** [darknet] Error 1
因此,找不到-lcuda
。我现在真的很绝望,感谢每一个答案。