Reply – HelloJOCL Problems on MacOSX
Your Name
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(
        at java.nio.DirectByteBuffer.<init>(
        at java.nio.ByteBuffer.allocateDirect(
        at com.jogamp.common.nio.Buffers.newDirectByteBuffer(
        at com.jogamp.common.nio.Buffers.newDirectFloatBuffer(
        at com.jogamp.opencl.CLContext.createFloatBuffer(
        at HelloJOCL.main(

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(
        at com.jogamp.opencl.CLCommandQueue.putNDRangeKernel(
        at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel(
        at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel(
        at HelloJOCL.main(

Any suggestions how I can overcome this problem?