Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using OpenCL causes application to hang at startup

Hi,

When building an application on Windows using OpenCV, the application hangs on startup with the error:

DXGI ERROR: CreateDXGIFactory cannot be called from DllMain. [ Miscellaneous Error #76 ]

I have a core dll that contains some commonly used OpenCV functions, although none are statically initialized at startup. With OpenCL enabled, this issue occurs, however, when I set the environmental variable OPENCV_OPENCL_DEVICE = nill, it does not and the application runs fine.

This all occurs before the main entry point for the program.

I'm guessing that OpenCL uses some kind of static initialization in OpenCV?

This has been tested on: Windows 10, i7, with either GTX 1080Ti or GTX 1060.