Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random crashes when OpenCV is trying to use OpenCL #102

Open
phlash opened this issue Aug 21, 2021 · 2 comments
Open

Random crashes when OpenCV is trying to use OpenCL #102

phlash opened this issue Aug 21, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation wontfix This will not be worked on
Milestone

Comments

@phlash
Copy link
Collaborator

phlash commented Aug 21, 2021

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 😠

@phlash phlash added documentation Improvements or additions to documentation wontfix This will not be worked on labels Aug 21, 2021
@floe
Copy link
Owner

floe commented Aug 25, 2021

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

@floe floe added this to the v0.3 milestone Aug 29, 2021
@phlash
Copy link
Collaborator Author

phlash commented Aug 24, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants