-
-
Notifications
You must be signed in to change notification settings - Fork 55.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could NOT find CUDNN (missing: CUDNN_LIBRARY CUDNN_INCLUDE_DIR) #16380
Comments
@brian208579 i guess it just because you didn`t install cudnn) |
Thanks for your response But I already have it installed and put it in c: / Can manually specify the path for cmake to find cudnn ? |
@brian208579 |
Sorry , it doesn't work ... |
@brian208579 you didn't get me. |
@BadMachine |
you can mail me teamviewer and I will try to help , otherwise I can’t help if I don’t see what is happening |
@BadMachine |
Problem has been solved !!! |
I got the same issue. |
@haquocviet First of all make sure u are using release version OpenCV. Then make sure that cudnn folders with files merged with cuda folders: copy 3 folders from cudnn to cuda folder. |
@haquocviet I said cudnn folders, not cudnn folder as is. If u don’t understand “merge” meaning: |
Thanks for your explanation. |
@haquocviet ok, gimme treamviewer -_- |
Thanks.
|
@haquocviet how did you go about setting this? I downloaded cudnn and put the files in the proper directories. I even ensured the paths are in the environment variables. However, I still get an error saying cudnn was not detected. I tried following the instructions on here: https://jamesbowley.co.uk/accelerate-opencv-4-2-0-build-with-cuda-and-python-bindings/ |
First, you need to generate CMakeCache.txt file via either cmake cmdline or gui. Then you replace the vars in the file with your real paths of DNN. Finally you do "configure" again to complete the job. |
Just to confirm when you type the following into cmd
you get the below path?
|
Thanks for the reply. I should have mentioned that I am using CUDA 10.1. Below is what I used for the command line:set "openCvSource=C:\opencv_build\opencv" "C:\Program Files\CMake\bin\cmake.exe" -B"%openCvBuild%/" -H"%openCvSource%/" -G"%generator%" -DCMAKE_BUILD_TYPE=%buildType% -DOPENCV_EXTRA_MODULES_PATH="%openCVExtraModules%/" ^
|
Can you post the output to the below please
or if you built release
What size is your shared library?
Do you have either
or
if so do some of the tests pass? |
Avoid posting screenshots with text information - it is ridiculous.
Check contents of CMakeVars.txt for CUDA / CUDNN stuff too. If you make experiments with dependencies, then you should clean CMake cache before each run. (May not work) Partial cache cleanup is possible:
|
The output implies you have managed to finish the build of OpenCV with CUDA support, my guess would by as alalek has suggested, you probably ran cmake initialy before you had placed cudnn64_7.dll on your path (or you placed it on your system path without a restart or your user path without opening a new command prompt or similar). Regarding the error you mentioned in another thread
I can only think that you are not picking up the correct .dll at runtime as the results of running
show that you can successfully build and run an application against
compiled with CUDA support. |
Thanks for the help and guidance. I apologize for the screenshots on the text information -- I will copy and paste text for this kind of information. Regarding not having restarted or opened a new command prompt, I had actually done both and it seems that cudnn still does not show up. As for debugging the GpuMat error, I looked at my configuration for Visual Studio and it is the following: VC++ DirectoriesInclude Directories: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include;C:\opencv_build\opencv\build\install\include;$(IncludePath) Library Directories: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\lib\x64;C:\opencv_build\opencv\build\lib\Debug;$(LibraryPath) C/C++Additional Include Directories: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include Linker:Additional library directories: C:\opencv_build\opencv\build\lib\Debug; Additional Dependencies:opencv_world420d.lib;%(AdditionalDependencies) My code is pretty simple: using namespace cv; int main() I get the following error: My guess is I am referencing the wrong files in the configuration? My point of confusion is that I see multiple files of the same name on the C:\opencv_build directory and am not 100% sure which ones are the "correct" ones. As I reference guide, I used this link: https://medium.com/@subwaymatch/adding-opencv-4-2-0-to-visual-studio-2019-project-in-windows-using-pre-built-binaries-93a851ed6141 However, instead of using the prebuilt binaries I used the ones I built. |
Did you as alalek suggested clean the cache or even better delete or use a fresh build directory?
I assume you are seeing this error when running your program? If so check the location reported by
is only
If you are using visual studio you should be able to see this location in the modules window when debugging your program. Additionally if you have built with Visual Studio, you have a multiple working projects you can study (opencv_test_cudaarithm etc.) when the solution is open to get build options which work. |
Hello, So I took a look at some of the Visual Studio solution files and it seems that whenever I try to build and compile them, it seems to be building everything from source again to run an executable. Perhaps my understanding is wrong, but one of my goals was to build OpenCV with CUDA and then use the .dll and .lib files to create my own Visual Studio C++ project. I did not see any of the Visual Studio solution examples doing that. As I mentioned, when I tried to include the .dll and .lib files and then tried to run my code in Debug mode, I got an error saying that OpenCV was not built with CUDA. Is my understanding and approach incorrect? Thanks for all the help thus far. |
You can select this project only and then build to avoid building the whole solution.
to your build directory to force the correct .dll to be used. |
So I notice I do not have any .lib or .dll files in the directory: C:\opencv_build\opencv\build\bin I have a "Debug" and "Release" directory in there though. In the "Debug" directory I have .pdb, .ilk, and .exe files. No .dll or .lib files however. Am I in the wrong directory, or did something go wrong in my build process? I do have a "bin" and "lib" folder in: C:\opencv_build\opencv\build\install\x64\vc16 In that directory, the "bin" folder contains: opencv_img_hash420d.dll, opencv_videoio_ffmpeg420_64.dll, and opencv_world420d.dll. The "lib" folder contains: opencv_img_hash420d.lib, opencv_world420d.lib |
If Anyone Doing this on Windows try deleting cache from build folder in cmake or change build folder...! |
Anyone being able to help me with this? @BadMachine or @haquocviet I've been trying 10 hours to install this, and i am still failing. I am really desperate. Please, help me. Thanks! |
@Adriann2k |
i managed to fix it by downgrading python from 3.7 to 3.6 |
thanks anyways :) |
I still haven't solved this problem,i copy the include\lib to the target dir:usr/local/cuda/include and lib,but it didn't work |
Actually you can also solve by cmake add this |
This is what I did to solve it as well. In my case:
|
@BadMachine can you please help me? edit:
I can't figure it out... every time I include
Do you know how I fix this? edit2: looks like its actually the exact same thing as OP's pic |
I got this working for me by doing the following:
Checked to see which version of cudnn it installed, for me it's 7.6.3
hope this helps! |
@nhorton04 |
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D OPENCV_ENABLE_NONFREE=ON -D WITH_CUDA=ON -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D CUDA_ARCH_BIN=6.1 -D WITH_CUBLAS=1 -D OPENCV_EXTRA_MODULES_PATH= This is work for me.. Thank you all |
I am using windows with cuda10.1 and cudnn7.6.5. |
Hi, I was facing a similar issue and none of the above fixes worked for me. I was using OpenCV 4.2.0 with CUDA 10.2 and CUDNN 8.2. P.S : clear all the cmake cache before trying again |
I had this problem too. I am using windows 10 with cuda10.1, cudnn8.0.5.39 My solution :
|
Appreciate your comment. Finally solve this error |
OS: win10 ( 64bits )
Cuda : 10.2
Cudnn : 7.6.5
Opencv: github latest
When I use cmake-gui I get this information :
Could NOT find CUDNN (missing: CUDNN_LIBRARY CUDNN_INCLUDE_DIR) (Required is at least version "7.5")
and
cuDNN : NO
But I have installed it in the c: / path
please give me some suggestions , thx ...
The text was updated successfully, but these errors were encountered: