Problems releasing an OpenCL Context with OpenGL Interop


I’m creating a demo application that creates an OpenCL Context with OpenGL Interop. All seems to be OK and whatever I want to execute runs properly. Once the application has done all work I want to release my OpenCL Context and later, if is needed, create a new one (also with OpenGL Interop).

Here is my problem. I release all (Context, CommandQueue, Program, Kernel and Mem Objects) and the functions return CL_SUCCES. But when later I want to create a new Context (over the same OpenGL Context) the clCreateContext returns CL_OUT_OF_HOST_MEMORY

I’m missing to release something or is needed to make additional OpenGL release calls?

I have tried to make the same proves to an OpenCL Context with no OpenGL Interop and I can create and release contexts with no problems.

I’m using OpenCL 1.0 with a GTX 470.

I can create and destroy OpenCL context, on the same OpenGL context.
To test this, I use freeglut and each time the windows is resized I destroy all my cl objects, and recreate them.

Perhaps you don’t destroy all your cl_objects, or gl_objects?
The only time I had out_of_resources was because I run multiple time an exe that leaked opengl and opencl objects.

linux kubuntu 10.04 64bits
geforce 9800gt

I’m sure that I’m detroying all the cl_objects but which gl_object should I destroy?

If you refer to those I use in the interaction I have the same error just only creating an OpenGL/CL context without additional OpenGL objects for interaction. I mean, If the context has attached an OpenGL Context I can’t release and then create a new one.



What us your OS, and drivers version?

I’m using Windows 7 and my driver version is 197.44. Also I use Java with jocl binding.

Always with the same example on vista vista it works.

I don’t know your hardware, but perhaps you don’t have the last drivers. On vista I use the 257.21.

I get the same issue.
Problem solved in AMD forum:

Edit: or, at least, a clue to this problem…