schwittlick / ofxDarknet

darknet neural network addon for openFrameworks
MIT License
496 stars 89 forks source link

Can't cmake Darknet #41

Closed ratmother closed 5 years ago

ratmother commented 5 years ago

So I noticed that Darknet was being really slow and not using the GPU at all (I am new to this btw), I couldn't find an option within the provided openframeworks code to turn on GPU usage. If I'm being really silly and theres a way to do this without compiling my own darknet (which I'm finding impossible to do), let me know? ofxDarknet runs absolutely fine, just terribly slow. Could someone tell me what I need to do to make ofxDarknet utilize the GPU? And if they know why cmake does not work?

I'm using Windows 10, Visual Studio 2017 64bit, Cuda 8.0/cudnn installed/opencv installed. I tried compiling Darknet with the provided cmake with AlexeyAB and no luck either.

With "cmake ." command in Git Bash

$ cmake . -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134. -- The C compiler identification is MSVC 19.16.27026.1 -- The CXX compiler identification is MSVC 19.16.27026.1 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/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/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- CUDA Version: -- CUDA Libararies: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/lib/Win32/cudart_static.lib -- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_32,code=sm_32;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52 -- CUDA FOUND! CMake Error at CMakeLists.txt:89 (target_link_libraries): Cannot specify link libraries for target "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/lib/Win32/cudart_static.lib" which is not built by this project.

-- Configuring incomplete, errors occurred! See also "E:/Misc_Projects/DarkNet/ofxDarknet-master/libs/darknet/cMake/CMakeFiles/CMakeOutput.log".


In cmake-gui I get the following...

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134. CUDA Version: CUDA Libararies: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64/cudart_static.lib CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_32,code=sm_32;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52 CUDA FOUND! CMake Error at CMakeLists.txt:89 (target_link_libraries): Cannot specify link libraries for target "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64/cudart_static.lib" which is not built by this project.

Configuring incomplete, errors occurred! See also "E:/Misc_Projects/DarkNet/Build/CMakeFiles/CMakeOutput.log". See also "E:/Misc_Projects/DarkNet/Build/CMakeFiles/CMakeError.log".

HellipS commented 2 years ago

same error, if u find the solution, can u tell me please ? :(