Copy image acquired from OpenGL

Hi everybody,
is it possible to copy an image acquire from OpenGL with clCreateFromGLRenderbuffer() to another image create with clCreateImage2d()? I tried to do it after acquiring it but I get a CL_INVALID_VALUE. I can read it into a kernel but not copying it with the clCopyImage() function.
Did somebody already succeeded doing it? I’m using 195.39 beta version of the driver under linux.

I have the same problem and would be highly interested in finding a solution.

What I have noticed is that it does not work for the moment. Neither with CUDA, neither with CL. If you will check postprocessGL in CUDA examples you will see that they strangely define render buffers for color and depth but do not use them at all. In both - postprocessGL and oclPostprocessGL instead of reading render buffer directly they go through PBO, which, imho, is not an optimal way. The second strange thing is that in SIGGRAPH ASIA 2009 presentation [post=“0”]http://sa09.idav.ucdavis.edu/docs/SA09_GL_interop.pdf[/post] they show oclPostprocessGL like it is coded with clCreateFromGLRenderbuffer, which is not

Are you sure that the format of the renderbuffer is supported? (Tables 5.5, 5.6 in OpenCL specs). I think I had the same problem first time I tried to copy something from an OpenCL image created from an OpenGL texture. I was able to map the texture successfully but I wasn’t able to copy anything from its content but then I realized that the texture was defined with an unsupported format … but it is strange that you can read it in the kernel … do you get any error when you are unmapping the renderbuffer after it has been used in the kernel?

By “unmapping” you mean releasing the memobject? No I do not get any error whil releasing the object.
Actually everything works fine with the acquired memobject except the read and copy (I didn’t try to write in it) operations done outside of a kernel.
So I just worked directly on the FBO in my kernels. :)

Will you be so nice to post some piece of code with a simple kernel and a host setup using FBO.

Thank you in advance !

Yes, I meant releasing the memobject, sorry ( the process of acquiring and releasing of GL objects is called mapping/unmapping in CUDA ).

Anyway, it is strange. Maybe just another bug… let’s hope some new drivers will be released soon (it will probably happen at the same time the new Fermi GPUs are released)