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

Option to disable OpenCL access to the gpu #9852

Closed
msarett opened this issue Oct 13, 2017 · 1 comment
Closed

Option to disable OpenCL access to the gpu #9852

msarett opened this issue Oct 13, 2017 · 1 comment
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org

Comments

@msarett
Copy link

msarett commented Oct 13, 2017

I'm working on an OpenCV application that needs to be explicit/careful with its use of gpu resources. In general, OpenCV is pretty reliable about this (using gpu:: to access the gpu).

Recently I noticed a problem with gpu resource contention in my application and was surprised to discover that OpenCV was using the gpu even though I was using the general non-gpu API. It turns out that I had OpenCL enabled and OpenCL was accessing the gpu.

In my application (and I would guess in others as well), it is definitely undesirable for OpenCV to use gpu resources unless it is explicitly directed to do so. I've disabled OpenCL for now as a quick fix.

Is this working as intended, or do you think it is reasonable for OpenCV to prevent OpenCL from using the gpu in these situations? Does it make sense to have an option to prevent OpenCL from using the gpu?

@alalek
Copy link
Member

alalek commented Oct 13, 2017

These environment variables turn off OpenCL in OpenCV (prevents default OpenCL initialization):

OPENCV_OPENCL_RUNTIME=null
or
OPENCV_OPENCL_DEVICE=disabled

Usage questions should go to Users OpenCV Q/A forum: http://answers.opencv.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org
Projects
None yet
Development

No branches or pull requests

2 participants