DLLs for parallel execution

When running OpenCV code I occassionally get the message:

[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\parallel\registry_parallel.impl.hpp (96) cv::parallel::ParallelBa
ckendRegistry::ParallelBackendRegistry core(parallel): Enabled backends(3, sorted by priority): ONETBB(1000); TBB(990);
OPENMP(980)
[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::l
ibraryLoad load C:\dev\openFrameworks\addons\ofxRulr\Application\bin\opencv_core_parallel_onetbb452_64d.dll => FAILED
[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::l
ibraryLoad load opencv_core_parallel_onetbb452_64d.dll => FAILED
[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::l
ibraryLoad load C:\dev\openFrameworks\addons\ofxRulr\Application\bin\opencv_core_parallel_tbb452_64d.dll => FAILED
[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::l
ibraryLoad load opencv_core_parallel_tbb452_64d.dll => FAILED
[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::l
ibraryLoad load C:\dev\openFrameworks\addons\ofxRulr\Application\bin\opencv_core_parallel_openmp452_64d.dll => FAILED
[ INFO:0] global C:\dev\opencv\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::plugin::impl::DynamicLib::l
ibraryLoad load opencv_core_parallel_openmp452_64d.dll => FAILED

I tried building OpenCV with TBB, but it did not produce any of these DLL’s. What is the method to produce these DLL’s?

1 Like

Don’t worry, your OpenCV probably has built-in parallel backend too, you can check it in the cmake configuration output or by printing output of getBuildInformation() function.
Dynamic backends are optional.

These messages are visible because you are using debug build which has logging level set to INFO or DEBUG, you can omit these messages by setting environment variable OPENCV_LOG_LEVEL=e or 2 (OpenCV: cv::utils::logging Namespace Reference).

1 Like

Thank you for the reply

I’ll investigate if I do have it built in.

And if I really did want to build one of those DLL’s - how would I go about it?

If it’s generally advised not to build these DLL’s (it’s not obviously documented how to), then I presume that this debug signal should be removed (e.g. the code should check for an internal implementation before it checks for external ones)

@mshabunin maybe you can explain a bit more about the dynamic plugin system ?

1 Like

There is some info with build instructions and environment variables in the documentation and the original PR. Though documentation mostly cover user-provided backends usage, these are different from dynamic backends (yeah, it gets complicated :slight_smile:).

In most cases you’ll want to have built-in parallel backend only, dynamic parallel backends are meant to be used if you want to create a single binary distribution of OpenCV with ability to choose backend dynamically on per-application basis (e.g. enable TBB backend in application which uses TBB too and use MS Concurrency for others). Also it helps to make some 3rdparty dependencies optional, so that you will have ability to use this distribution with minimal dependencies and add functionality or improve performance just by installing extra package.

Please note that built-in backend works as before, it can be TBB or OpenMP, just as in older versions. Furthermore there is a cmake option PARALLEL_ENABLE_PLUGINS which can be turned OFF to disable dynamic backends completely.

Idea is to first check for external implementations in plugins and only then fallback to built-in backend, so the order can not be changed. I understand this can be too verbose and perhaps logging level for these messages could be changed, but on the other hand this is an essence of debug build - provide as much information as possible for troubleshooting (for ex. try to launch basic GStreamer pipeline with GST_DEBUG=5 and you’ll see The Verbose log :smiley:).

1 Like