(附坑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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM