Regarding openCV (cuda support) build & installation dependencies

I installed opencv for windows with cuda using the following cmd :

vcpkg install opencv[cuda,cudnn,dnn,dnn-cuda,ipp,opengl,world]

I am curious whether it is necessary to add additional dll’s when opencv installation already generated opencv_world dll ?

My test app can’t run without adding all the generated dll’s . Is this normal?

yes, this is normal.

one dll does not “consume”/contain other dlls. it refers to them. they have to be there.

“there” means findable, so they’re either in the same directory, or the current working directory, or they’re in some directory declared in the PATH environment variable

1 Like

The bin folder is pretty large: 1 GB for opencv_world and 0.5 GB for the remaining dll’s. I was just trying to use the opencv dnn with Cuda support.

I am not sure how to use vcpkg but when calling CMake directly you can just disable all the extra CUDA modules

-DBUILD_opencv_cudaarithm=OFF -DBUILD_opencv_cudabgsegm=OFF -DBUILD_opencv_cudafeatures2d=OFF -DBUILD_opencv_cudafilters=OFF -DBUILD_opencv_cudaimgproc=OFF -DBUILD_opencv_cudalegacy=OFF -DBUILD_opencv_cudaobjdetect=OFF -DBUILD_opencv_cudaoptflow=OFF -DBUILD_opencv_cudastereo=OFF -DBUILD_opencv_cudawarping=OFF -DBUILD_opencv_cudacodec=OFF

and only build for the compute capability of your device.
e.g. If you had an RTX 3070 it would be

-DCUDA_ARCH_BIN=8.6

This will reduce the size of the world module significantly.

1 Like