Results 1 to 2 of 2

Thread: Verbose output from OpenCL context

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    3

    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:
    Code :
    "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.

  2. #2
    Junior Member
    Join Date
    Sep 2011
    Posts
    3

    Re: Verbose output from OpenCL context

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

    OpenGL textures are created like this:

    Code :
        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.

    Code :
      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):

    Code :
    // 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.

Similar Threads

  1. openCl Multiple context ! is it possible ?
    By Belkacem in forum OpenCL
    Replies: 1
    Last Post: 02-02-2012, 05:11 PM
  2. Replies: 2
    Last Post: 04-26-2010, 08:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •