CL_INVALID_GL_OBJECT

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CL_INVALID_GL_OBJECT

kaesemeister
Hi,

I startet experimenting with OpenCL. First tests are done. Now I am trying to check out Interoperability with OpenGL. I want to manipulate an OpenGL Buffer directly.. Therefore I tried this example: https://github.com/mbien/jocl-demos/tree/master/src/com/jogamp/opencl/demos/joglinterop

Unfortunately I get errors whenever they try to create a CL Buffer from a GL Buffer:
clBuffer = clContext.createFromGLBuffer(glObjects[VERTICES], BUFFER_SIZE, CLGLBuffer.Mem.WRITE_ONLY);

glObjects[VERTICES] contains a valid opengl bufferId which was initialized as follows:
gl.glGenBuffers(glObjects.length, glObjects, 0);
gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, glObjects[VERTICES]);
gl.glBufferData(GL2.GL_ARRAY_BUFFER, BUFFER_SIZE, null, GL2.GL_DYNAMIC_DRAW);
gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);

Does anyone know what could be the problem? Is this maybe a hardware limitation?
There is a compatibility check in the code which passes:
... d.isGLMemorySharingSupported() ... 

I am using this SDK: http://developer.amd.com/sdks/AMDAPPSDK/downloads/Pages/default.aspx and the newest jogamp version (tried other versions already)

I've done some more tests to find out what's the problem: The AMD SDK delivers some c examples. I compiled them and get the same error, whenever opengl interoperability is used :(
Error: clCreateFromGLBuffer failed. (outputImageBuffer) Error code : CL_INVALID_GL_OBJECT
example: $(AMDAPPSDKSAMPLESROOT)/opt/AMDAPP/samples/opencl/cl/app/SimpleGL
Reply | Threaded
Open this post in threaded view
|

Re: CL_INVALID_GL_OBJECT

notzed
FWIW I seem to get the same result.

I thought at first it might be something to do with JOCL which is why i sent you over here, but I traced through the code and see nothing obviously wrong.  I also noticed some of my old code which used to work - or at least not fail at that point - was doing the same thing.

I'm using catalyst 11.9 drivers on linux, which appear to be buggy as hell but with my card I have no choice (it seems, i can't get of older packages for fedora anyway, and the 11.8 drivers wouldn't install on the ms-side of the dual-boot).  Perhaps you can try a previous version though?

There's no mention of it on the AMD forums, but a lot of people seem to be avoiding the 11.9 drivers too.
Reply | Threaded
Open this post in threaded view
|

Re: CL_INVALID_GL_OBJECT

kaesemeister
ah, thanks for that hint..

I'm currenty using the driver which ubuntu installs automatically. The catalyst control center says:
Driver Packaging Version: 8.84.6-110324a-116088C-ATI

seems to be not the newest Version. But I will try some other versions. Do you know which version worked for you?
Reply | Threaded
Open this post in threaded view
|

Re: CL_INVALID_GL_OBJECT

notzed
I previously had nvidia hardware, and i can't remember the version i had my other box before i 'upgraded it' and stopped using it regularly as a workstation (that has an amd card, and i did some opencl on it, although i can't recall if i got to the opengl interop by then).

The only version i could get to work on fedora were from rpmfusion - the amd module builder is too broken and I didn't have the patience to trawl through rpm scripting errors and C++ build-errors-that-just-look-like-warnings-to-me to get it to work.  But maybe you'll have better luck on ubuntu.

Incidentally they just released 11.10.

Seems to be two numbering schemes, 8.89.2 == 11.9, 8.86.x = 11.6, so 8.84 is probably a bit old.

Still, maybe it points to some other problem if other driver versions are affected.
Reply | Threaded
Open this post in threaded view
|

Re: CL_INVALID_GL_OBJECT

Nick
The bug is still in Catalyst 11.10 however this solution worked for me:

http://www.khronos.org/message_boards/viewtopic.php?t=4460&p=13041