backscrub icon indicating copy to clipboard operation
backscrub copied to clipboard

Random crashes when OpenCV is trying to use OpenCL

Open phlash opened this issue 3 years ago • 2 comments

I've recently discovered that as of v3.x OpenCV will silently attempt to use OpenCL (and thus the GPU) if it finds the required libraries on the system (https://opencv.org/opencl/). Unfortunately operating multiple threads in OpenCV (eg: 2 x video capture streams + processing, in particular cv::cvtColor() calls) appears to randomly cause errors or segmentation faults in the OpenCL backend

Workaround: set the following environment variable to disable this silent use of OpenCL

% OPENCV_OPENCL_RUNTIME=disabled backscrub ...

NB: this wasted a good hour of my time today, as I thought the problem was in my code :angry:

phlash avatar Aug 21 '21 21:08 phlash

Oh, good to know, should we put this in a Troubleshooting section in the README maybe?

floe avatar Aug 25 '21 10:08 floe

Retesting needed on this after a year I think. We could force the environment variable setting in the app if it's still an issue?

phlash avatar Aug 24 '22 10:08 phlash