Build and Install OpenCV With CUDA GPU Support on Windows 10 | OpenCV 4.5.1 | 2021

preview_player
Показать описание
Build OpenCV 4.5.1 with CUDA GPU acceleration on Windows 10. In this tutorial, we will build OpenCV from source with CUDA support in Anaconda base environment as well as in a virtual environment. Building OpenCV with CUDA from source allows OpenCV to be used in any programming language. We will focus on Python 3.8 for this tutorial.
---------------------------------------------
► Time Stamps:
Introduction: (0:00)
Prerequisites: (0:55)
Install CUDA and cuDNN: (1:23)
Make OpenCV using CMake: (2:42)
Install OpenCV on Windows 10: (6:49)
Install OpenCV in Virtual Environment: (8:00)
How to check if OpenCV is using GPU: (9:25)
---------------------------------------------
► Links:
---------------------------------------------
► Commands:
---------------------------------------------
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!
Рекомендации по теме
Комментарии
Автор

► *My Other Tutorials:*
YOLOv4 On Android Using TFLite

Custom YOLOv4 Object Detection with TensorFlow and TFLite

Darknet YOLOv4 Custom Object Detection: Part 2 (Training YOLOv4 Darknet)

Darknet YOLOv4 Custom Object Detection: Part 1 (Preparing Custom Dataset)

YOLOv4 Object Detection with TensorFlow, TFLite and TensorRT

Darknet YOLOv4 Object Detection for Windows 10 on Images, Videos, and Webcams

Real Time Object Detection on Webcam and Videos Using OpenCV With YOLOv3 and YOLOv4 | Windows Linux

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

Install TensorFlow GPU and PyTorch with CUDA on Windows 10 Anaconda | CUDA 10.1 cuDNN 7.6

Real-time Multiple Object Tracking with YOLOv4 TensorFlow and Deep Sort | Linux, Windows

TheCodingBug
Автор

THANK YOU SO MUCH DUDE!!! You really made my day. Now I can use my gpu for testing some scripts with yolo in almost real time. You are the best. Thank you for making a second chance videos for us the non-lucky ones lol. You really deserve your likes

andrespereira
Автор

This tutorial saves time and (more important) nerves! :) Big thanks for the effort! It took 50 mins on regular 7200rpm HDD

marjansladek
Автор

the installation worked in the base environment perfectly, but when I tried it in the virtual environment when I entered "import cv2" I get the following message: "ImportError: OpenCV loader: missing configuration file: ['config-3.8.py', 'config-3.py']. Check OpenCV installation." -- how do I fix this?

nadirsayitright
Автор

i had an error when i tried to configured in cmake. The eroor is "error in configuration process, project file may be invalid" what should ı do?
i installed visual studio a while ago. So i dont knowif I had press the c++ part. is it because of that? I looked up and ı installed visual studio 2019 in my D server. İs it a problem? because cmake is in my C: server.

aysebeyzaunal
Автор

@TheCodingBug had to use cuda 11.2 due to rtx 3070 showing some warnings with DLL when installing.
Eventually got to the point where I import cv2 in gpu environment still says no module named cv2 followed all steps with clean plate and apart from warning in cmake about wrong version of python that asked me to add something to path file there were no other problems. Any idea how to solve it?
PS. import cv2 in python does work without gpu ve

sebastianm
Автор

Thanks for the great tutorial. Is there any performance change between with and without GPU?

ilkinhuseynzade
Автор

Still showing unavailable for python3 in CMake. Please help me to solve it.

sandeshhegde
Автор

Thank you Thank you Thank you. this is the clearest video so far. You solved my no module error after countless frustrating hours.

louisfain
Автор

After clean installation...
I am facing this error:
ImportError: DLL load failed while importing cv2: The specified module could not be found.

muhammadzaid
Автор

Thanks, but i'm stuck here:
"C:\Program Files\CMake\bin\cmake.exe" --build "C:\OpenCV_Build\build" --target INSTALL --config Release
Unexpected token 'build' in expression or statement.
please help!

banghuynh
Автор

Thank you. Only guide that really works. Every other guide didn’t, holy moly! Thanks! Saved my life

micheleyin
Автор

Hi, I have a question.

If I used python 3.9.7 as the interpreter to build the OpenCV, can I use another version of python (e.g., 3.7.13) for the virtual env?

I tried but get this error: ImportError: OpenCV loader: missing configuration file: ['config-3.7.py', 'config-3.py']. Check OpenCV installation.

Is there any way to build the OpenCV for multiple python versions or do I need to re-build every time for a different version of python?

OngJY-rvjh
Автор

Hi, you are my last hope, I am using OpenCV 4.4.0 with numpy 1.20.0, trying to bind tensorflow version 2.4.0 and it gives me an error (NotImplementedError: Cannot convert a symbolic Tensor to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported), but it also works fine on numpy version 1.19.2, but from this version CV2 crashes with an error (RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd). Please tell me what could be the problem?
python 3.8.5

notreg
Автор

Everything was executed well. But when I ran the test script file I got more speed when using the CPU.


Here is the output.

CUDA --- 1.0304639339447021 seconds ---
CPU --- 0.9209995269775391 seconds ---

My PC Specs are CPU - AMD Ryzen 9 5900x and GPU - 3080 Vision.

towardsgeneralintelligence
Автор

In my case, all going smoothly but the cmkae cmd stop at this "opencv_test_core SSE4_2.vcxproj -> SSE4_2.dir\Release\ope ncv_test_core_SSE4_2.lib" and no other explanation, just stop at that. In a video the command prompt say "installing" when done but mine different. Anyonw how to solve it? Thank you

kairunhanjun
Автор

I had a problem installing opencv due to the location I chose to install opencv from. I chose to leave it at downloads which was a mistake. To avoid similar problem, follow the video and install it from C drive.

mickeytish
Автор

Hi, my CMake is using the normal python on my system and not the Anaconda's python.exe. Is there a way to configure cmake to use anaconda python?

mallvin
Автор

Hi, I need help... Its really emergency

CMake Error at (message):
Error generating

_gpu_mat.cu.obj

I'm getting this error when I run this command: "C:\Program Files\CMake\bin\cmake.exe" --build "C:\OpenCV_Build\build" --target INSTALL --config Release

raytakes
Автор

Hi, I get this error although I try to do exactly as you do:

CMake Error at modules/dnn/CMakeLists.txt:39 (message):
DNN: CUDA backend requires cuDNN. Please resolve dependency or disable
OPENCV_DNN_CUDA=OFF
Call Stack (most recent call first):
(include)
(include_one_module)

erfanroghani