7

I am currently using the cmake-gui to compile yolo darknet at https://github.com/AlexeyAB/darknet.git. However, it will not enable cuda and I am having a few other odd issues. These include when I run darknet.exe from the Release folder after building it using VS2017, it states that it cannot find pthreadVC2.dll or opencv_world410.dll.

To fix the other issues, I copied the exe and those files and put them all in the root folder of the project. This seems to work but I am not sure why it wouldn't work otherwise.

For cuda, I am not sure what to try. I have these system variables and path: System Variables System Variable Path

Here is my cmake-gui: cmake1 cmake2

It can be seen that CMAKE_CUDA_COMPILER is NOTFOUND. Which I am thinking is the problem, but I am not sure why it cannot be found. If I run nvcc -V in the command prompt, it returns:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018
Cuda compilation tools, release 10.0, V10.0.130

Also here is the output for cmake configuration:

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
OpenCV ARCH: x64
OpenCV RUNTIME: vc15
OpenCV STATIC: OFF
Found OpenCV 4.1.0 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.
ZED SDK not enabled, since it requires CUDA
Configuring done

If you have any tips for any of these problems, please let me know. Just an FYI, currently darknet does work and if I test it on dog.jpg, it successfully detects the classes. However, this is of course without Cuda or cudnn and I would like to use these eventually. Thank you! If you need anything else from me please let me know!

Jacob Bunzel
  • 165
  • 1
  • 4
  • 15
  • Why don't you check `ENABLE_CUDA` above `ENABLE_OPENCV` ? – gameon67 Apr 25 '19 at 00:28
  • 1
    It does not actually enable it. When I generate it unchecks it. If you take a look at the git hub, and look at the windows compiling section where there is an image of what cmake should include, and I am missing a group of Cuda values. Not sure how to get these included. – Jacob Bunzel Apr 25 '19 at 15:04
  • I have the same error of : "cannot find pthreadVC2.dll". You said it works now for you, how did you overcome the said error? Thanks :) – Andre May 05 '19 at 18:56
  • Move the file into the same directory that you executing darknet from. It will be able to see it then. I've given up trying to make with Cuda on windows since I can't find a solution to that, let me know if you get yours to work @Andre – Jacob Bunzel May 05 '19 at 22:35
  • Sure thing. I just ran the tests on 1fps on CPU sadly. GPU really is necessary. – Andre May 11 '19 at 07:13

3 Answers3

3

Unlike above said, i didn't reinstall CUDA, i just copy 4 files from

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions

to

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations

Magiczne
  • 1,586
  • 2
  • 15
  • 23
Wade Wang
  • 536
  • 6
  • 11
2

The answer was given by @Andropogon: CUDA has to be reinstalled after Visual Studio.

This is what we found when I dug into it a bit with my colleague:

  1. Similar to OP, all compilation steps seemed to run without error and generate an executable.
  2. Taking a closer look at cmake, under CMAKE/CMAKE_CUDA_COMPILER it said NOT FOUND, despite nvcc.exe being on the Path. (nvcc --version runs fine in Powershell.) We manually entered the location of nvcc.exe to this option, and now configure comes up with a more helpful error message: No CUDA toolset found. with reference to line numbers in various cmake files. Among those lines was this message, which seems to confirm that Visual Studio (VS) is part of the problem,
    if(NOT CMAKE_VS_PLATFORM_TOOLSET_CUDA)
            message(FATAL_ERROR "No CUDA toolset found.")

So after reinstalling CUDA the compilation looked more like I would expect - but I still get an executable which doesn't appear to do anything (no output on the command line, no prediction.jpg generated). Anyway, hopefully that can shed a bit of light on the CUDA/VS/cmake issue.

craq
  • 1,441
  • 2
  • 20
  • 39
1

I had the same problem, I tried many ways to make GPU available for transe, and finally cmake started to see CUDA when I reinstalled VS2019 (from disk D to disk C) and reinstalled CUDA in version v.10.1. After this, cmake began to find CUDA, and after compiling the project in VS2019, everything start to work correctly. Important thing to install Visual Studio firstly and later CUDA.

Panicum
  • 794
  • 1
  • 9
  • 32