Exception in thread "AWT-EventQueue-0" org.jocl.CLException: CL_INVALID_CONTEXT

There’s a bug in some of the samples that gives the following error:
Exception in thread “AWT-EventQueue-0” org.jocl.CLException: CL_INVALID_CONTEXT

It’s due to context being redeclared bringing the global context out of scope:

    // Try to create the OpenCL context on a GPU device
    cl_context context = clCreateContextFromType(

Just remove cl_context and it will work. Other methods need to be able to use the global context, which the above defines.

Thank you for this information. I see that this refers to the samples involving JOGL. These samples had been modified to meet the requirements of the latest OpenCL implementations, but obviously had not been tested properly afterwards (they are using JOGL1, and I have updated to JOGL2 in the meantime).

The samples will be updated as soon as possible.