BUG: glDrawPixels using output PBO data error introduced in CUDA 1.1 driver

Hi,

i ran into a problem when using glDrawPixels for displaying the output data from a kernel. When binding the output PBO as unpack buffer and using glDrawPixels the program freezes after 4 to 10 rendered frames and the cudaGLMapBufferObject() functions return an internal driver error.

To reproduce the problem you can modify the postprocessGL example program. Just insert the following code into the processImage() function and comment out the use of the displayImage() function.

   // download texture from PBO

    //glBindBuffer( GL_PIXEL_UNPACK_BUFFER_ARB, pbo_dest);

    //glBindTexture( GL_TEXTURE_2D, tex_screen);

    //glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, 

    //   image_width, image_height, 

    //   GL_BGRA, GL_UNSIGNED_BYTE, NULL);

   //CUT_CHECK_ERROR_GL();

   // blit convolved texture onto the screen

    glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo_dest);

   glMatrixMode(GL_PROJECTION);

    glPushMatrix();

    {

        glLoadIdentity();

        glOrtho(0, image_width, 0, image_height, -1, 1);

       glMatrixMode(GL_MODELVIEW);

        glPushMatrix();

        {

            glLoadIdentity();

           glDrawBuffer(GL_BACK);

            glRasterPos2i(0,0);

            glDrawPixels(image_width, image_height, GL_BGRA, GL_UNSIGNED_BYTE, 0);

        }

        glMatrixMode(GL_MODELVIEW);

        glPopMatrix();

    }

    glMatrixMode(GL_PROJECTION);

    glPopMatrix();

    glMatrixMode(GL_MODELVIEW);

   glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);

I tested this with the 32bit as well as the 64bit version of CUDA under WindowsXP x64 using the 169.09 and 169.17 driver.

I think this is a driver issue.

Regards

-chris