(附坑1)目标检测:YOLOv4测试——Cmake无法检测Cuda (ZDE is not enabled, since it requires CUDA)
1. 问题描述:
1)在配置C版YOLOv4时,按照安装顺序要求分别安装了如下软件:
* win10系统,4代i7工控机,并插入Tesla t4显卡;
* 安装兼容Tesla t4显卡的显卡驱动426.50;
* 安装 visual studio community 2019;
* 安装cuda v10.1
* 安装cudnn v7.5 for cuda v10.1
* 安装cmake 3.17
* 安装opencv3.4.12_v14_v15(其中,v14指向vs2015, v15指向2019)
2)配置修改:
* OpenCV_DIR 加入系统路径
* makefile.txt修改参数,强制使用cuda和cudnn
3)具体问题:
* ZDK is not enabled, since it required cuda
2. 查询资料:
1)网络建议解决方法:(大家都可以尝试一下,这是我查到的所有的方法的汇总,都挺有道理的)
* 建议可行方法一: 将cmake, cuda, cudnn, vs2019, opencv放在同一磁盘下;(已经尝试,失败。)
* 建议可行方法二:安装顺序严格控制,先装vs2019,然后安装cuda.因为有cuda基于vs的集成开发包问题;(已经尝试,失败。)
* 建议可行方法三:将vs2019降级到vs2017; (未尝试,但是感觉没啥用)
* 建议可行方法四:cmake中的ZDE版本和CUDA版本不兼容问题。将cmake版本降低。(正在尝试将cmake版本降到3.10和3.13和3.15.7和3.17.2分别尝试。)
* cmake 3.10.3无法安装,因为打开后,它只能生成vs2017以前版本的项目。
* cmake 3.13.5 出现同3.10相同情况
* cmake 3.15.7-win64-x64, 编译成功,但ZDE找不到CUDA同3.17相同情况
3. 具体解决方法:
下面步骤一定要一步一步来,不能并行或省时间。
1) 卸载vs2019 community
2) 下载vs2017 community
3) 卸载cuda v10.1
4) 安装cuda v10.1,选择自定义
5)重新git clone 源码darknet
6) 卸载Cmake3.17.2
7) 安装Cmake3.15.7
8) 编辑5)下载的源码中的makefile文件,就是另CUDA=1,CUDNN=1..那一步
9)打开Cmake3.15.7, 导入路径,内部操作与之前相同,x64
10) configure编译,结果如下:
4. 最终结果:(成功找到)
The C compiler identification is MSVC 19.16.27045.0
The CXX compiler identification is MSVC 19.16.27045.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Looking for a CUDA compiler
Looking for a CUDA compiler - C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe
The CUDA compiler identification is NVIDIA 10.1.105
Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe
Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/bin/nvcc.exe -- works
Detecting CUDA compiler ABI info
Detecting CUDA compiler ABI info - done
Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1 (found version "10.1")
Autodetected CUDA architecture(s): 7.5
Building with CUDA flags: -gencode;arch=compute_75,code=sm_75
Your setup supports half precision (it requires CC >= 7.0)
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Found PThreads_windows: C:/darknet/3rdparty/pthreads/lib/pthreadVC2.lib
PThreads_windows_DLL_DIR: C:/darknet/3rdparty/pthreads/include/../bin
OpenCV ARCH: x64
OpenCV RUNTIME: vc15
OpenCV STATIC: OFF
Found OpenCV: C:/opencv/build (found version "3.4.12")
Found OpenCV 3.4.12 in C:/opencv/build/x64/vc15/lib
You might need to add C:\opencv\build\x64\vc15\bin to your PATH to be able to run your applications.
Found Stb: C:/darknet/3rdparty/stb/include
Found OpenMP_C: -openmp (found version "2.0")
Found OpenMP_CXX: -openmp (found version "2.0")
Found OpenMP: TRUE (found version "2.0")
-> darknet is fine for now, but uselib_track has been disabled!
-> Please rebuild OpenCV from sources with CUDA support to enable it
Found CUDNN: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/include (found version "?")
CMAKE_CUDA_FLAGS: -gencode arch=compute_75,code=sm_75 -Wno-deprecated-declarations -Xcompiler="/wd4013,/wd4018,/wd4028,/wd4047,/wd4068,/wd4090,/wd4101,/wd4113,/wd4133,/wd4190,/wd4244,/wd4267,/wd4305,/wd4477,/wd4996,/wd4819,/fp:fast,/DGPU,/DCUDNN,/DOPENCV" -D_WINDOWS -Xcompiler="/W3 /GR /EHsc"
ZED SDK not found
Configuring done
Generating done
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix