Building Darknet but getting this errors - darknet

-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6
-- CUDACXX: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6/bin/nvcc
CMake Error at CMakeLists.txt:153 (message):
CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do
not want CUDA.
I have Cuda 11.6 and cudnn 8.3

Use CUDA version 11.1. Worked for me.

Related

I was using CMAKE to install darknet on window but an error message popped up asking for vcpkg and cuda not found

Here is the error messsage:
Darknet_VERSION: 0.2.5.4
vcpkg not found, toolchain not defined, using integrated libs on win32
CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0
CUDACXX:
CMake Error at CMakeLists.txt:156 (message):
CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do
not want CUDA.
Configuring incomplete, errors occurred!
See also "C:/Users/User/Desktop/darknet-master/darknet-master/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User/Desktop/darknet-master/darknet-master/CMakeFiles/CMakeError.log".
Darknet_VERSION: 0.2.5.4
vcpkg not found, toolchain not defined, using integrated libs on win32
CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0
CUDACXX:
CMake Error at CMakeLists.txt:156 (message):
CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do
not want CUDA.
Configuring incomplete, errors occurred!
See also "C:/Users/User/Desktop/darknet-master/darknet-master/CMakeFiles/CMakeOutput.log".
See also "C:/Users/User/Desktop/darknet-master/darknet-master/CMakeFiles/CMakeError.log".

CMake doesn't recognize NVTX after CUDA network install on Win10

Have a look at this GitHub actions run result on a machine running Windows 10:
nvcc_11.7 visual_studio_integration_11.7 curand_dev_11.7 nvrtc_dev_11.7 nvtx_11.7 cudart_11.7 visual_studio_integration_11.7 nsight_nvtx_11.7
Downloading CUDA Network Installer for 11.7.0 from: https://developer.download.nvidia.com/compute/cuda/11.7.0/network_installers/cuda_11.7.0_windows_network.exe
Downloading Complete
Installing CUDA 11.7.0. Subpackages nvcc_11.7 visual_studio_integration_11.7 curand_dev_11.7 nvrtc_dev_11.7 nvtx_11.7 cudart_11.7 visual_studio_integration_11.7 nsight_nvtx_11.7
CUDA_PATH C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7
CUDA_PATH_VX_Y CUDA_PATH_V11_7
Adding CUDA to CUDA_PATH, CUDA_PATH_X_Y and PATH
1m 2s
Run cmake -B build -G "Visual Studio 16 2019" -A x64 -DBUILD_EXAMPLES=ON
-- The CUDA compiler identification is NVIDIA 11.7.64
-- The CXX compiler identification is MSVC 19.29.30145.0
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Unable to find cublas_v2.h in either "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include" or "C:/Program Files/NVIDIA GPU Computing Toolkit/math_libs/include"
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/include (found suitable version "11.7.64", minimum required is "9.0")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 5.3;6.0;6.1;7.0;7.5;8.0;8.6;8.6+PTX
-- Configuring done
CMake Error at CMakeLists.txt:58 (target_link_libraries):
The link interface of target "nvtx" contains:
-- Generating done
CUDA::nvToolsExt
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
CMake Generate step failed. Build files cannot be regenerated correctly.
Error: Process completed with exit code 1.
It seems the installer is installing everything it needs, including NVTX - but somehow, CMake is not then able to locate the installed NVTX library.
Why would this happen? What can I do about it?
This is an open bug against CMake:
Bug 22893: FindCUDAToolkit: Fails to locate nvToolsExt, no error nor warning
Please let Kitware know it's important to you, because they don't seem very keen on fixing it for some reason.

CMake couldn't find MatLab libraries, even though MatLab is detected

I have been trying to build BlockFactory and I keep getting following error when trying to build it.
PS F:\simconnect-monitor\blockfactory> cmake -S . -B build
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19044.
-- The CXX compiler identification is MSVC 19.16.27045.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Matlab (missing: Matlab_MEX_LIBRARY Matlab_MX_LIBRARY ENG_LIBRARY) (found version "9.10")
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Matlab (missing: Matlab_MEX_LIBRARY Matlab_MX_LIBRARY MX_LIBRARY) (found version "9.10")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
cmake/FindMatlab.cmake:1873 (find_package_handle_standard_args)
deps/mxpp/CMakeLists.txt:45 (find_package)
As you can see, MatLab was detected but the correct library cannot be found. I have tried with CMake 3.18.14 and 3.22.3 with no difference. I am really loss right now honestly. I have posted an issue in the BlockFactory GitHub but so far, it is still unresolved.
So, I found the solution. I am using VS2017. By default for VS2017, cmake makes 32-bit project. You have to pass cmake -A x64 to force it to a 64-bit project. In addition to that, though, I have to force finfmatlab.cmake to only look for 64-bit library by basically setting _matlab_64build to always be true. Make sure you have 64-bit MatLab if you do this.
Edit: Alternatively, you can install VS2019 instead since it defaulted to 64-bit project.

vl_compilenn ('enableGpu', true) on matlabr2016b, visualstudio2015 MatConvNet compile GPU

I have the follow configuration:
Windows 10 64bit
Matlab r2016b, NVidia GeForce 920MX, compute capability 5.0, toolkit version 7.5
Visual Studio 2015 for community
MatConvNet beta 23
Cuda 8.0 (ga1 02/2017)
cuDNN 6.0 (04/2017)
When I compile with vl_compilenn (only cpu) the compile is correct.
But when I compile with:
vl_compilenn ('enableGpu', true)
or more specific with:
vl_compilenn('enableGpu', true, 'cudaMethod', 'nvcc', 'cudaRoot', 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0', 'enableCudnn', true, 'cudnnRoot', 'C:\..\..\..\..\..\MatConvNet\cuda')
I have the follow issue:
vl_compilenn: CUDA: MEX config file: 'C:\Program
Files\MATLAB\R2016b\toolbox\distcomp\gpu\extern\src\mex\win64\mex_CUDA_win64.xml'
C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/../VC/bin/../../VC/INCLUDE\crtdefs.h(10): fatal error C1083: Non Þ possibile aprire il file inclusione: 'corecrt.h': No such file
or directory data.cu Error using vl_compilenn>nvcc_compile (line 540)
Command "C:\Program Files\NVIDIA GPU Computing
Toolkit\CUDA\v8.0\bin\nvcc" -c
"C:.........\MatConvNet\matconvnet-1.0-beta23\matlab\src\bits\data.cu"
-DNDEBUG -DENABLE_GPU -DENABLE_CUDNN -I"C:..........\MatConvNet\cuda\include" -DENABLE_DOUBLE -D__SSSE3__ -gencode=arch=compute_50,code=\"sm_50,compute_50\" -I"C:\Program Files\MATLAB\R2016b\extern\include" -I"C:\Program Files\MATLAB\R2016b\toolbox\distcomp\gpu\extern\include"
-gencode=arch=compute_50,code=\"sm_50,compute_50\" -O3
-Xcompiler /MD --compiler-bindir "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC..\VC\bin" -o
"C:..........\MatConvNet\matconvnet-1.0-beta23\matlab\mex.build\bits\data.obj"
failed.
Error in vl_compilenn (line 485) nvcc_compile(opts, srcs{i}, objfile,
flags.nvcc) ;
Also, i have copied the cudnn64_6.dll into the specific directory matlab/mex
If you have an idea, i would be gratefull, since I have made several attempt with another version of matconvnet (example b24), but the issue is similar.
Thank you very much.
I have solved used the follows libraries and software:
Matlab r2017a
Visual studio 2015
MatConvNet beta 24
Cuda 8.0.66
Regards
Probably there is no bin folder so Create 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC..\VC\bin' folder. It will stay empty but compiling will finished.

Why I cannot make GPUvariable ? (Unable to allocate memory using cudaMalloc)

I am trying to use GPUmat(MATLAB) under ubuntu.
For my system, GPUstart works well without any error message like follows :
Starting GPU
- GPUmat version: 0.280
- Required CUDA version: 4.2
There is 1 device supporting CUDA
CUDA Driver Version: 4.20
CUDA Runtime Version: 3.0
Device 0: "GeForce GT 520"
CUDA Capability Major revision number: 2
CUDA Capability Minor revision number: 1
Total amount of global memory: 1073283072 bytes
- CUDA compute capability 2.1
...done
- Loading module EXAMPLES_CODEOPT
- Loading module EXAMPLES_NUMERICS
-> numerics21.cubin
- Loading module NUMERICS
-> numerics21.cubin
- Loading module RAND
But when I try to create variable like ' a = GPUdouble(rand(2)); '
the following error message appears
Error using mxNumericArrayToGPUtypePtr
Unable to allocate memory using cudaMalloc
Error in GPUdouble (line 52)
p.slot = mxNumericArrayToGPUtypePtr(p,
double(A));
I can't guess any of reason why this is hapenning. Can you give me some advice to solve this? I really appreciate for your help.
p.s) At the first time, GPUstart does not work due to the library problems. So I moved all the libraries of CUDA 4.2 to matlab library folders according to GPUmat developer's advice.
Thank you !
You have an incompatible version of the CUDA runtime installed. GPUStart tells you "Required CUDA version: 4.2" but you have the CUDA 3.0 toolkit installed.
You will need to update your CUDA toolkit to a supported version.