backscrub
backscrub copied to clipboard
Random crashes when OpenCV is trying to use OpenCL
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:
Oh, good to know, should we put this in a Troubleshooting section in the README maybe?
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?