Hi everybody!
I recently set up JOCL on my project to compute more efficient (hopefully :) ) texture data. I was doing that with OpenGL but by having a look at OpenCL, it seemed that computation should be faster. I was working with a TextureRenderer Object in OpenGL and I tried to send it to an openCL kernel. So I tried to use the method cl.createFromGLTexture2d which sounded appropriate... But whenever I tried to launch my program it failed on the call of this function and throw an CLInvalidMemObjectException ! Here's my code: private void generateTexture () { [...] /* code which update the texture*/ textureRenderer.getTexture().bind(); gl.glFlush(); fullTex = cl.createFromGLTexture2d(textureRenderer.getTexture().getTarget(), TextureRenderer.getTexture().getTextureObject(), 0, Mem.READ_WRITE); } And what the stack trace: Caused by: com.jogamp.opencl.CLException$CLInvalidMemObjectException: error while asking for info value [error: CL_INVALID_MEM_OBJECT] at com.jogamp.opencl.CLException.checkForError(CLException.java:67) at com.jogamp.opencl.CLInfoAccessor.getLong(CLInfoAccessor.java:67) at com.jogamp.opencl.gl.CLGLTexture2d.createFromGLTexture2d(CLGLTexture2d.java:70) at com.jogamp.opencl.gl.CLGLContext.createFromGLTexture2d(CLGLContext.java:255) at com.jogamp.opencl.gl.CLGLContext.createFromGLTexture2d(CLGLContext.java:243) at sytar.processing.BitMap.generateTexture(BitMap.java:286) [...] Does anyone has an idea to solve this problem? I've been working on that for quite a while now and i can't figure out what's wrong... Thanks to any helper ;) |
Hi Alex,
please send me a small test reproducing this issue and i take a look. best regards, michael On 03/17/2011 06:22 PM, AlexRNL [via jogamp] wrote: > Hi everybody! > > I recently set up JOCL on my project to compute more efficient (hopefully :) > ) texture data. I was doing that with OpenGL but by having a look at OpenCL, > it seemed that computation should be faster. > > I was working with a TextureRenderer Object in OpenGL and I tried to send it > to an openCL kernel. So I tried to use the method cl.createFromGLTexture2d > which sounded appropriate... But whenever I tried to launch my program it > failed on the call of this function and throw an CLInvalidMemObjectException > ! > > Here's my code: > > private void generateTexture () { > [...] /* code which update the texture*/ > textureRenderer.getTexture().bind(); > gl.glFlush(); > fullTex = > cl.createFromGLTexture2d(textureRenderer.getTexture().getTarget(), > TextureRenderer.getTexture().getTextureObject(), 0, Mem.READ_WRITE); > } > > > And what the stack trace: > > Caused by: com.jogamp.opencl.CLException$CLInvalidMemObjectException: error > while asking for info value [error: CL_INVALID_MEM_OBJECT] > at com.jogamp.opencl.CLException.checkForError(CLException.java:67) > at com.jogamp.opencl.CLInfoAccessor.getLong(CLInfoAccessor.java:67) > at > com.jogamp.opencl.gl.CLGLTexture2d.createFromGLTexture2d(CLGLTexture2d.java:70) > at > com.jogamp.opencl.gl.CLGLContext.createFromGLTexture2d(CLGLContext.java:255) > at > com.jogamp.opencl.gl.CLGLContext.createFromGLTexture2d(CLGLContext.java:243) > at sytar.processing.BitMap.generateTexture(BitMap.java:286) > [...] > > > Does anyone has an idea to solve this problem? I've been working on that for > quite a while now and i can't figure out what's wrong... > > Thanks to any helper ;) > > _______________________________________________ > If you reply to this email, your message will be added to the discussion below: > http://forum.jogamp.org/cl-createFromGLTexture2d-is-not-working-tp2694449p2694449.html > To start a new topic under jogamp, email [hidden email] > To unsubscribe from jogamp, visit http://michael-bien.com/ |
Hi Michael, Thanks for your help! I'm sending you a "light" version of my project which reproduce the "bug" (if it is actually one and not a mistake of mine). Hope you can find what's wrong Thanks again, Alex. Main.java Renderer.java BitMap.java processTexture.cl |
Any news on my problem?
I'm guessing you're probably busy but I was wondering if you had any new information on my problem... If you're too busy to look into it, that's OK! I totally understand ^^ Did you manage to reproduce the bug? Is it an obvious (or less obivous) mistake I made? Is there a problem with JOCL implementation? Thanks again for your time, Alex. |
Hi Alex,
yes its reproducible for me also. But i will have to investigate why this happens since the spec is not that verbose in this area. For example i don't find anything which states that clImageInfo operations won't work when the CL image is mapped to a GL texture but thats what is happening here. sure, will be fixed or solved via workaround before release regards, michael On 03/22/2011 11:05 AM, AlexRNL [via jogamp] wrote: > > Any news on my problem? > > I'm guessing you're probably busy but I was wondering if you had any new > information on my problem... If you're too busy to look into it, that's OK! > I totally understand ^^ > > Did you manage to reproduce the bug? > Is it an obvious (or less obivous) mistake I made? > Is there a problem with JOCL implementation? > > Thanks again for your time, > Alex. > > _______________________________________________ > If you reply to this email, your message will be added to the discussion below: > http://forum.jogamp.org/cl-createFromGLTexture2d-is-not-working-tp2694449p2714234.html > To start a new topic under jogamp, email [hidden email] > To unsubscribe from jogamp, visit |
Hi Michael,
Thanks for the feedback! Do you have any idea when the function createFromGLTexture2d will be (correctly) implemented in JOCL? I kind of need to import a texture to parallelize computation on it. Do you have any leads on how to carry it out in an OpenCL context? For now, all my computation are taking place in the JVM, but I feel it could be much more efficient with OpenCL!
|
Free forum by Nabble | Edit this page |