Login  Register

Re: Starting with JOCL

Posted by Giovanni Idili on Feb 12, 2011; 6:03pm
URL: https://forum.jogamp.org/Starting-with-JOCL-tp2481173p2481442.html

Hi Michael, 

Thanks a lot for your help, 

That got me past that line but then I started getting an error on this operation:

put1DRangeKernel(kernel, 0, globalWorkSize, localWorkSize)


Error message:


com.jogamp.opencl.CLException$CLInvalidWorkGroupSizeException: can not enqueue 1DRange CLKernel [id: 4756395056 name: VectorAdd]

 with gwo: null gws: {11520} lws: {256} 

cond.: null events: null [error: CL_INVALID_WORK_GROUP_SIZE]

at com.jogamp.opencl.CLException.newException(CLException.java:78)

Not too sure what this error means, but it looks like this was the cause --> CL_INVALID_WORK_GROUP_SIZE 


So from the same post you pointed out I used the following line to create the cmd queue:


CLCommandQueue queue = context.getDevices()[0].createCommandQueue(); 


This does the trick, but to be honest I don't really understand why this works! :)


What does that line mean, am I using CPU, GPUS or both?


Thanks for your time man, 


Giovanni


On Sat, Feb 12, 2011 at 5:40 PM, Michael Bien [via jogamp] <[hidden email]> wrote:
Hi,

i got almost the same mail a few days ago :)
http://forum.jogamp.org/HelloJOCL-Problems-on-MacOSX-tp2456996p2456996.html

please reduce the buffer length or increase the direct memory size as mentioned in my answer. I will reduce the hardcoded value in the demo... which should make it compatible with more machines.

best regards,
and sorry for the inconveniences,

michael

On 02/12/2011 06:26 PM, John_Idol [via jogamp] wrote:
HI All,

I am getting started with JOCL, trying to run the HolleJOCL demo.

Here's my problem:

When creating buffers I get an error on buffer C, the only only created as WRITE_ONLY

CLBuffer<FloatBuffer> clBufferA = context.createFloatBuffer(globalWorkSize, READ_ONLY);
CLBuffer<FloatBuffer> clBufferB = context.createFloatBuffer(globalWorkSize, READ_ONLY);
CLBuffer<FloatBuffer> clBufferC = context.createFloatBuffer(globalWorkSize, WRITE_ONLY);

Error message:

Exception in thread "main" java.lang.OutOfMemoryError: Direct buffer memory
        at java.nio.Bits.reserveMemory(Bits.java:633)
        at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:98)
        at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
        at com.jogamp.common.nio.Buffers.newDirectByteBuffer(Buffers.java:67)
        at com.jogamp.common.nio.Buffers.newDirectFloatBuffer(Buffers.java:109)
        at com.jogamp.opencl.CLContext.createFloatBuffer(CLContext.java:316)
        at HelloJOCL.main(HelloJOCL.java:35)

Any idea what this is and how can I get past it?

Thanks!


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Starting-with-JOCL-tp2481173p2481173.html
To start a new topic under jogamp, email [hidden email]
here.


-- 
- - - -
http://michael-bien.com



If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Starting-with-JOCL-tp2481173p2481259.html
To unsubscribe from Starting with JOCL, click here.