Build and Install OpenCV With CUDA (GPU) Support on Windows 10

preview_player
Показать описание
Get a speedup for OpenCV with CUDA GPU acceleration. Learn how to build OpenCV 4.4.0 with CUDA on Windows 10 from the source. Installing this way allows OpenCV to be used in any programming language. We will focus on Python 3.8 for this tutorial. You can test for C++ and comment below if it worked for the benefit of future viewers.

EDIT: I am using Anaconda with Python 3.8 for this tutorial so I do not need to add any paths to my system variables.

---------------------------------------------
► Time Stamps:
Introduction: (0:00)
Prerequisites: (0:15)
Install CUDA and cuDNN: (2:53)
Make OpenCV using CMake: (4:41)
Build OpenCV using Visual Studio: (6:42)
ERROR - One or More Projects Were Not Loaded Correctly: (7:02)
Install OpenCV on Windows 10: (7:51)
How to verify if OpenCV detects GPU: (8:48)
How to check if OpenCV is using GPU: (9:10)

Want to discuss more?
---------------------------------------------
#TheCodingBug
#cuda
#opencv
---------------------------------------------
► My Other Tutorials:
---------------------------------------------
---------------------------------------------
DISCLAIMER: Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you!
Рекомендации по теме
Комментарии
Автор




YOLOv4 with Darknet on Windows:

YOLOv3 YOLOv4 with OpenCV:

YOLOv4 Darknet:


YOLOv4 Custom Detector:


YOLOv4 TensorFlow and TFLite:

TheCodingBug
Автор

Mate, it was the most helpful video I have ever watched on Youtube. Thank you very much, respect.

avnibalkc
Автор

Out of all the tutorials I've found for this stuff, this one was by far the best. Thanks a lot.

mewhenthemewhenstheme
Автор

Thank You so much sir.I don't have words to express my gratitude.I badly needed to get OpenCV running with CUDA for my college project, and I was running out of time.I've spent many, many hours of the past week trying to get this work.I do not have much experience in such stuff and I couldn't find a detailed step by step video on this topic.Thank you so much once again.You made my day!

gaminginp
Автор

Notes:
1. Uninstall VS Python
2. Install latest Anaconda3(python 3.8.5)
3. Uninstall included Numpy, install numpy==1.19.3
4. Install appropiate Nvidia CUDA, get developer cuDNN files and merge them with CUDA


Thanks for the video it helped me 10x!

danniel
Автор

A big shoutout for you. You made very precise and simple video explaining all the step with clarity. I would definitely share your channel to my peers.
Thanks a lot!!

keyurborad
Автор

Thanks you very much. For those struggling with the "ModuleNotFoundError: No module named 'cv2'
". In the step where you set up the CMake configuration add this entry "BUILD_opencv_python3" type boolean and check it.

dedenapraia
Автор

Very helpful, informative and straightforward video. Thank you!

Patorik
Автор

finally i can install it, thank you very much, but the problem i have is not updating numpy before cmake

ductin
Автор

How come when i check result is 0. how to set to 1?

cklee
Автор

Dear all...It works! After 2 days, i can build OpenCV with CUDA support Excellent work. Thanks for the all the efforts.
I am trying to build Darknet / Yolo4 on Windows 10. Any suggestion, how to proceed from here. If not mistaken, i can use the Anaconda base environment for the Darknet /Yolo4 as well. Cheers!

esg
Автор

This took me about half a day to get right but I have to say your tutorial has been the best one I've found on this topic. There were a couple of issues that initially caused my setup not to work in anaconda:

2. After installing everything I tried to "import cv2 " in my base anaconda env and got this error:
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.
Couldn't find a good solution on the web but fortunately all I needed to do was open a new MiniConda shell env and then the import worked!

Now I just needed to get this working in a separate environment. Unfortunately it seems that you can only compile for one python version. So if you have multiple conda environments with the same python version then no problem. But I had one conda env with python 3.8 and another with 3.7. Unfortunately I ended up having to build opencv separately for both environments. Wasn't pretty but at least now I have opencv with gpu working! Thanks a lot!

SimeonGreene
Автор

Worked without any errors. However, there were bunch of warnings during build process of Visual Studio. But still it's working fine. Thanks!

funwithpk
Автор

Hey mate thanks a ton! It would definitely be worth ensuring people are aware of the requirement to download and add the zlib.dll to the environment path to ensure correct running of cuDNN otherwise it will throw cuda related errors when compiling. Its an easy fix but something noone mentions in their installation tutorials and leads to unneccessary issues. Thanks for the tutorial, keep up the good work!

gareth
Автор

coool thanks for this vid! you make my day!!!!

JoonhwanLee
Автор

Thank you. I made sure I have tested it before giving the like and subscribe LOL

DevilErnest
Автор

I'm very sorry. I followed guide. Everything was ok, finally, I built everything in VS as it was in the video, however, after that I tried to import cv2 and it tells that there is no such module

daniilmaltsev
Автор

Please, add a similar video for LInux OS (Ubuntu 20.04 preferably). Thank you in advance, very good work so far! Thumbs up!

thesoulz
Автор

Same problem with someone. Used clean anaconda(3.8.5) but failed, tried python3.8.5 instead and copy the stuff as someone suggested.

rambled
Автор

On second configure
Configuring incomplete, errors occurred!
See also
See also

minhdinh