A possible cause of a CL_OUT_OF_RESOURCES error is that the card is being used to run a display (Ref). I have found, however, that I continue to get this error after disconnecting the display and it persists until I restart. Is there a command that will make the OpenCL resources available again?
2 Answers
CL_OUT_OF_RESOURCES is a common error to nVIDIA driver. And can be caused by:
- Real out of resources (rare)
- Reading an array that was used by a kernel that read/writed out of bounds. (typical)
- Any other strange error that does not have an appropriate error code.
You are provably facing the second one, so, I would check the kernels.
EDIT: As you said that it happens until restart. Maybe you can check if you are deleting properly all the OpenCL objects. Events are very tricky and easy to leak some OpenCL memory.

- 8,235
- 1
- 26
- 36
-
I'm not sure if that is possible though. The sequence is more like 1) Connect monitor, 2) Disconnect monitor, 3) Attempt to allocate memory. So at the time the error occurs, none of my code has even had a chance to leak memory. – EternalTyro Aug 27 '13 at 14:30
-
What function of OpenCL tells you the CL_OUT_OF_RESOURCES? – DarkZeros Aug 27 '13 at 16:13
How much memory are you trying to allocate, and how much does the card have on board? A video card driving a display has a certain amount of memory set aside for some operations. The driver may simply be reserving this memory and not caring if the display is gone till it is restarted.
On that note, it is possible to restart the video driver in Windows using devcon. On Linux, you could try an
lsmod | grep nvidia
and once you know the module name, perhaps an
rmmod
or
modprobe -r
I don't know if this will work on OSX.