OpenCV + CUDA installation on Windows

asked 2019-07-01 23:46:17 -0600

Srinivasan M gravatar image

updated 2019-07-02 06:42:22 -0600

We have trouble installing opencv with cuda in Windows environment. Need help

Windows : 7 Cmake : 3.14.5 Cuda Toolkit Version: 10.1 or 9.2 Visual Studio: 2017 community or 2015 community OpenCv: 3.4.5, 4.0.0

We had tried multiple combination of opencv installation for CUDA, with different CUDA toolkits, different Visual studio versions, diff openCV Versions, but all the time, we get the error of "procedure entry point not found in the opencv_world...lib" error. We have followed many forums and tried to replicate but no luck.

With CUDA is enabled in all the compilations, A simple program to show device count (getCudaEnabledDeviceCount()) always returns 0, meaning CUDA is not built in opencv. It is really frustating. we have tried with and without opencv_world but no success for the past one week.

We hope this forum can point out our mistake and help us to resolve the issue. EDIT: Error jpg attached for quick reference C:\fakepath\CUDA Compilation error.jpg

edit retag flag offensive close merge delete


long post, but all useless, unless you can show us , what you really did.

berak gravatar imageberak ( 2019-07-01 23:50:43 -0600 )edit

are you trying with prebuilt libs (e.g. from SourceForge) ? trying to use opencv_world.lib sounds very much like that -- it won't work.

you have to rebuild the opencv libs with a recent CUDA sdk installed. the prebuilt libs have no support for CUDA at all

for opencv4.x, you'll also need the opencv_contrib modules (anything cuda was moved there).

berak gravatar imageberak ( 2019-07-01 23:52:52 -0600 )edit

Thanks for your quick response. We are not using prebuilt libraries, we are trying to build using Visual studio 2015 community edition with cuda SDK 9.2. Let me know how can we show what we really did.. I am unable to upload CMakeVars.txt. Can you pls explain why opencv_world.lib might not work?

To be more precise, our openCV with CUDA installation (WITH_CUDA = ON) and CUDA_TOOL_KIT_DIR set to the right path say C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2, builds fine in VS2015 or VS2017 without any failures. When we create a new project in Visual Studio and try to include any of the simple cuda calls, it is throwing procedure entry point not found error.. Simple opencv functions like Imread works fine when cuda calls are commented. Are we missing something in our setup?

Srinivasan M gravatar imageSrinivasan M ( 2019-07-02 05:51:39 -0600 )edit