How To Install and Build OpenCV C++ with NVIDIA CUDA GPU in Visual Studio Code

How To Install and Build OpenCV C++ with NVIDIA CUDA GPU in Visual Studio Code

Nicolai Nielsen

3 года назад

41,122 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Oscar Fuentes
Oscar Fuentes - 31.08.2023 20:08

Help please. The first time I installed it without DNN support. So I tried to reinstall it by deleting my "build" folder and uninstalling Anaconda, to have everything clear. I tried to do the process again and now It doesn't work. Is there a proper way to uninstall completely the compiled OpenCV.

Ответить
Random41
Random41 - 09.07.2023 00:02

Tried bulding 4.8.0 twice, and both times I'm missing the "install" folder.
Any ideas?
I have ticked the opencv_world in cmake.
And the install folder was set.

Ответить
Alexi Desvignes Nouvel
Alexi Desvignes Nouvel - 25.05.2023 18:46

Hi, I got some troubles to install CUDA to use it for a opencv project on QT. I use minGW as compiler and it appears that it can not work if I don't use Visual Studio as compiler (I got the error Cmake OpenCV is not able to find/configure CUDA SDK (required by WITH_CUDA)). Do you guys have a solution for that or is it really impossible to use CUDA and cuDNN with minGW?

Ответить
unamattina
unamattina - 17.04.2023 20:22

we installed opencv on previous video. does this step (3.15) is necessary?

Ответить
Isaac Berrios
Isaac Berrios - 16.01.2023 05:42

Thanks! This video was very helpful, but I have a question about fast math. I looked it up and seemed to only find horror stories of imprecise float roundoff. Will fast math be enabled by default? Or will we have to set a compiler flag to enable it?

Ответить
Sidharth R.A
Sidharth R.A - 23.12.2022 19:52

Is the method same for a jetson xavier agx machine?

Ответить
Joep Van Diessen
Joep Van Diessen - 16.12.2022 18:33

I am running into trouble with the dnn files not being made, despite checking all the required flags. Does anyone know why? cmake says cuDNN: YES

Ответить
EDOARDO BONANNI
EDOARDO BONANNI - 15.11.2022 14:45

Does this build allow running .cu files in addition to .cpp?

Ответить
Dev ___
Dev ___ - 09.11.2022 00:23

With all respect sir i'm having a trouble at configuring in cmake it shows and error "Configuring incomplete,Error Occured!".....Help me sir what should i do or what should i look for!?

Ответить
陳冠維
陳冠維 - 20.06.2022 16:40

I have never get this close to GPU computing before. But there is always something that stops me from reaching it.
I was at the step of the Cmake command. there is no "install" folder in <my root dir>\opencv\build after the whole thing was built.

edit: I used a really bad way of getting it to work(I installed the already compiled version without cuda support and swap out the opencv_world460.lib and .dll files. other headers are left un-touched.). I was able to get the cuda device info printed. But other functions like VideoCapture::read(), inRange(), GaussianBlur() became unrecognized external symbols, So do other functions.

Ответить
Luke Robinson
Luke Robinson - 03.03.2022 11:27

I just did all of this only realize the application I wanted to run requires 4.5.1 not 4.5.2 🙃is there a short way to redo all of this...

Ответить
Soham Korgaonkar
Soham Korgaonkar - 07.01.2022 11:33

I am getting the following error in the build process any advices?
LNK1181: cannot open input file 'freetype.lib'

Ответить
KHQC
KHQC - 15.11.2021 12:45

I love you for doing this!

Ответить
Nurul Isti Budi
Nurul Isti Budi - 04.11.2021 04:15

hey thanks for the video, i have an geforce 940mx gpu hardware, it's said that it have cuda version 5.0 but i dont know and don't understand yet witch cudnn to choose for this version. thanks

Ответить
Dmitry R
Dmitry R - 06.10.2021 18:55

Please - need help!
i get an error:

Executing command: "C:\Program Files\CMake\bin\cmake.EXE" -build c:/Dev/OpenCV/VSCodeTest/build --config Debug --target ALL_BUILD -j 18 -
Build finished with exit code 0

OpenCV(4.5.3) Error: No CUDA support (The library is compiled without CUDA support) in throw_no_cuda, file C:\build\master_winpack-build-win64-vc15\opencv\modules\core\include\opencv2/core/private.cuda.hpp, line 106
OpenCV: terminate handler is called!

Opencv works fine, but adding cuda - i get this error.
N.B. I twice followed the video and reinstalled everything very carefully, but still get the same error.
Any advice?

Ответить
Pedro Royer Schultz
Pedro Royer Schultz - 23.09.2021 20:27

'cmake' is not recognized as an internal or external command

Ответить
Yaghiyah Brenner
Yaghiyah Brenner - 17.09.2021 18:04

wow you rock simple to the point.

Ответить
ii Fiinka
ii Fiinka - 08.09.2021 17:33

If I plan to launch program on gtx 980 and gtx 1060 vide cards, can I set both values 5.2;6.1 in CUDAR_ARCH_BIN ?
Thanks!

Ответить
Anh phan
Anh phan - 08.09.2021 15:02

thanks for this tutorial. i have a problem with the beginning. Even tried to install cuda toolkit 11.3, 11.2, 11.1 or 10.2, 10.1 but non of this worked, it kept warn "compute_50, sm_50 are deprecate" and i dont know how to fix this. Can you help me, many thanks.

Ответить
B100dyPhr34k
B100dyPhr34k - 31.08.2021 19:28

Why can't I do run>start debugging or run>start without debugging it only works with ctrl+f5?

Ответить
Pixie
Pixie - 24.08.2021 05:32

Some project tutorials too pls 🙌🏼 I always love your videos !

Ответить
Darrel Hua
Darrel Hua - 16.08.2021 00:28

Great video, thanks for this! I am having troubles running the program where a "No CUDA support" error appears. I assume the issue stems from my current opencv environmental paths. I watched your other CMake video and setup the environmental paths and such but for the new opencv downloads, would we need to use new environmental paths to target new lib and bin? If so, where are the corresponding lib and bin paths of the opencv-4.5.2 downloads?

Ответить
Joe David
Joe David - 04.08.2021 11:14

If we were to generalize the instructions for an opencv installation without Cuda, what parameters in the video must be ignored and would there be any additional parameters?

Ответить
ROFLFISH
ROFLFISH - 25.07.2021 05:38

I don't know man. I wanted to use GPU in openCV with Python. So I started to watch this tutorial. But is says I should do this here first, to have some of the steps. No, this tutorial tells me to read tutorial x on cudnn and so forth. Maybe I am to dumb. But I think tutorials should not work this way. Just make a video in which EVERY step is done. I guess you lose 80% of the audience in the process of hopping from one video to another or a written guide.

Ответить
hongyong zhang
hongyong zhang - 17.07.2021 08:49

I followed your tutorial compilation and this error occurred ,what should i do ? LINK : fatal error LNK1181: 无法打开输入文件“..\..\lib\Release\opencv_world452.lib”, For CUDA, check the "WITH NVCUVID" option, if i want to use cv::cudacodec::VideoReader

Ответить
Akash Prakash
Akash Prakash - 16.06.2021 10:04

I am getting "nppi64.dll is missing" during program execution

Ответить
Neil Sorkin
Neil Sorkin - 07.06.2021 21:44

Good tutorial but can you please figure out your mic. The clicking / volume drops are really driving me crazy.

Ответить
Kansai Robot
Kansai Robot - 06.06.2021 14:54

Unfortunately I do this only on sundays but I got an update, perhaps you can help me. I have completed the video, the test works but when I try to build the simplest load (not even show) image example, it fails. I have investigated and turns out the problem is:

1. This installation only install the Release version of openCV right?
2. For some reason when I use cv::imread function in my code and even though I use ctrl F5 as in your video (that is supposed to be without debugging) it seems that it uses imread in Debug mode
3. Could you check where the exe file in the last part of your video is built? In my case it is build in the "Debug" directory, which is weird since it should be in the Release folder (that does not exist)

Is there a way to build from visual studio code in Release mode?
Should I reinstall everything with Debug version as well?

Could you check that a simple load and display program works on your installation?

Ответить
Kansai Robot
Kansai Robot - 29.05.2021 19:17

In min 22.34 you said "we have already included our directories from opencv in visua sudio code". When? and How did you do that?

Ответить
Kansai Robot
Kansai Robot - 29.05.2021 16:56

I finished installing and trying the test. But it is failing to find opencv. I suppose that in CMakeLists.txt we need to specify the path in find_package(OpenCV)??
Still not being able to find OpenCV. Why does it work in your case?
I got CMake Error at CMakeLists.txt (find_package)
By not providing FindOpenCV.cmake in CMAKE_MODULE_PATH this project has askec CMake to find a package configuration file provided by OpenCV,

Ответить
David Aliaga
David Aliaga - 29.05.2021 13:29

How about WITH_TBB option? How can it be used?

Ответить
David Aliaga
David Aliaga - 29.05.2021 13:06

This method assumes that I have python installed in my PC, right? What if I have python not natively but with ananconda. RIght now the Cmake configuration is telling me that can not find python. What to do?

Ответить
David Aliaga
David Aliaga - 29.05.2021 11:23

the anaconda link is not there (although I have it already installed)

Ответить
Taj Baanook
Taj Baanook - 28.05.2021 10:34

Please do a detailed project on cancer cell modeling and simulation. Thanks

Ответить
Rudrashis Gorai
Rudrashis Gorai - 28.05.2021 01:36

Support ++

Ответить
Sabin Kr Shrestha
Sabin Kr Shrestha - 27.05.2021 14:58

MSBUILD : error MSB1009: Project file does not exist.
Switch: INSTALL.vcxproj
It throws this error while compiling in cmd, need help.

Ответить