Re: NullPointerException from native method
Posted by
bananafish on
Apr 12, 2023; 8:00pm
URL: https://forum.jogamp.org/NullPointerException-from-native-method-tp4042433p4042436.html
Thank you; I have now added the repo and updated my versions. The issue persists, below is the new trace:
java.lang.NullPointerException
at com.jogamp.opencl.llb.impl.CLImpl11.dispatch_clEnqueueNDRangeKernel0(Native Method)
at com.jogamp.opencl.llb.impl.CLImpl11.clEnqueueNDRangeKernel(CLImpl11.java:1354)
at com.jogamp.opencl.CLCommandQueue.putNDRangeKernel(CLCommandQueue.java:1628)
at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel(CLCommandQueue.java:1495)
at com.jogamp.opencl.CLCommandQueue.put1DRangeKernel(CLCommandQueue.java:1465)
It had to do with passing a 1.6MB READ_ONLY buffer as a constant arg, bigger than allowed by OCLGrind's 64KB. The Intel driver's limit was 3GB so it just slid by. Replacing constant with global const * fixed it. What still doesn't make sense is why this manifests as a NullPointerException. I do not see any code in JOCL's native source that would throw a NullPointerException for that function. Could the JVM be catching an uncaught C++ exception from the native call and converting it to a java exception? OCLGrind itself is written in C++. I haven't yet found anything about Temurin 11 doing automatic exception conversion.