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 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
NVIDIA-Linux-x86_64-256.35
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.