Reply – HelloJOCL Problems on MacOSX
Your Name
Subject
Message
or Cancel
In Reply To
HelloJOCL Problems on MacOSX
— by ralphrmartin ralphrmartin
Tried the HelloJOCL example on MacOS X 10.6.6. on a MacBook Pro laptop.

On running I got:
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:30)

so I then changed line 20 to make elementCount smaller:
       int elementCount = 1444777;

But now I get a new error:
Exception in thread "main" com.jogamp.opencl.CLException$CLInvalidWorkGroupSizeException: can not enqueue 1DRange CLKernel [id: 4296105472 name: VectorAdd]
 with gwo: null gws: {1444864} lws: {256}
cond.: null events: null [error: CL_INVALID_WORK_GROUP_SIZE]
        at com.jogamp.opencl.CLException.newException(CLException.java:78)
        at com.jogamp.opencl.CLCommandQueue.putNDRangeKernel(CLCommandQueue.java:1547)
        at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel(CLCommandQueue.java:1455)
        at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel(CLCommandQueue.java:1425)
        at HelloJOCL.main(HelloJOCL.java:47)

Any suggestions how I can overcome this problem?