Login  Register

CL_DEVICE_NOT_AVAILABLE when creating CLContext with 64-bit Java on GTX 970

Posted by SuspiciousDroid on Mar 30, 2016; 6:54pm
URL: https://forum.jogamp.org/CL-DEVICE-NOT-AVAILABLE-when-creating-CLContext-with-64-bit-Java-on-GTX-970-tp4036560.html

Heyo everyone!

I'm having trouble running JOCL with 64-bit versions of Java on an nVidia GPU.
When I run the program with a 32-bit version (I tested jre1.6.0_45-32bit) everything works flawlessly, but when I switch to a 64-bit version (tested some versions of Java 7 and 8) I get an exception.

Basically, the program fails at the very first line where JOCL is involved: clContext = CLContext.create(CLDevice.Type.GPU);
1st line of the stack trace: Exception in thread "main" com.jogamp.opencl.CLException$CLDeviceNotAvailableException: can not create CL context [error: CL_DEVICE_NOT_AVAILABLE]

When I run the program on the CPU instead of the GPU, everything works perfectly with both 32-bit and 64-bit Java.

Relevant system specs:
- Intel i7-2600k
- nVidia GTX 970
- Windows 10 64-bit
- Using JOCL 2.3.2

At first I thought this was a driver problem, so I updated both the general nVidia driver to v364.72 (which includes its OpenCL drivers) and the Intel OpenCL driver to v15.1. Unfortunately, this didn't fix the problem.

Then I got my brother who has a very similar computer (Win10-64bit, GTX 970, Java 8 64-bit) to run the program and he ran into the exact same problem, so it's not just my computer either.

I even went so far as to re-code everything with both the JOCL from jocl.org and with JavaCL.
The results were similar, but not identical: Both worked with 32-bit Java and failed with 64-bit Java, but the error message was different. Both frameworks returned CL_OUT_OF_RESOURCES instead of CL_DEVICE_NOT_AVAILABLE.
I assume this is because these frameworks both call clCreateContext directly, while JOCL calls clCreateContextFromType.

At this point, I don't know what is causing this issue and what I should troubleshoot next.
I'm considering nuking all my nVidia drivers because there might be old left-over junk and then reinstalling the drivers. I'm not sure this would help, though, as brother's computer, which has been set up just recently, encounters the same problem.

Any idea what might be causing this issue or what I should be trying next?