Verbose output from OpenCL context

Hi,

I ran into a problem which I can’t seem to fix without further information on what I am doing wrong.

I’m developing a feature in OpenGL/OpenCL were textures are being used on both sides. There is something going wrong when aquiring/using the textures in OpenCL. As a result my event queue is going invalid and after that more bad things happen.

In order to find the problem I added a callback function to clCreateContext() which outputs this:


"CL_OUT_OF_RESOURCES error waiting for idle on GeForce GTX 470 (Device 0)."

I read that CL_OUT_OF_RESOURCES is used by nvidia as a general error for all kinds of missuses.

Is there any possibility to increase the verbose level of those outputs. I need more information on what went wrong.

Here is what I do in the code. Maybe someone is able to see an obvious mistake.

OpenGL textures are created like this:


    glGenTextures(2, velocityTextures);	
    glBindTexture(GL_TEXTURE_RECTANGLE, velocityTextures[t]);		
    glTexParameterf(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameterf(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameterf(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);	
    glTexParameterf(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);	
    glTexParameteri(GL_TEXTURE_RECTANGLE, GL_GENERATE_MIPMAP, GL_FALSE); // no automatic mipmap		

    glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA8 , TILE_TEXTURE_SIZE, TILE_TEXTURE_SIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);	
   

I also tried to use a mipmap version of the texture but that didn’t help.
Next I retrieve the shared pointer for OpenCL.


  cl_mem sharedMemory = clCreateFromGLTexture2D (m_Context, CL_MEM_WRITE_ONLY, GL_TEXTURE_RECTANGLE, 0, velocityTextures[0], &error);

In each frame I perform the following steps (no kernel yet):


// not sure if I have to do this on nvidia boards
glFinish();

error = clEnqueueAcquireGLObjects(m_Queue, 1, &sharedMemory, 0, NULL, NULL);

// error callback happens inbetween these to functions
// -> but there are no kernels applied here

error = clEnqueueReleaseGLObjects(m_Queue, 1, &sharedMemory, 0, NULL, NULL);

error = clFinish(m_Queue);

After that the texture handle is being used by OpenGL.