OpenCL Starter Issues

Started by mighty_archemedes, January 26, 2016, 19:06:00

Previous topic - Next topic


Hi guys. I'm getting started with LWJGL's implementation of OpenCL; specifically on Ubuntu Maté with a GTX 950 installed.

I decided to start with the introductory code from Jeff Heaton, at . Whenever I poll CLPlatform with .getPlatforms(), it returns null. Not even an empty List, just null. I still can't figure out why and I've been unable to backtrace the code or find appropriate documentation as of yet. It seems like that just shouldn't happen.

Before I file a bug report, I thought I would check my bases. I've tried this on LWJGL 2.9.1 and LWJGL 3b; no visible change in function. I'm using the NVIDIA proprietary driver with updates; but switching back to Nouveau had no effect. I do have nvidia-opencl-icd-352-updates installed as a package; I am not certain whether it requires anything else.

Has anyone familiar with it ever encountered, and hopefully solved, this problem before?




I have linux too so I thought I would try things out. To make things easier to debug I tried to run a lwjgl test file.

Which is from the demo library in the main github repository. I had to make some code changes though

import static org.lwjgl.system.Pointer.*;

Line 91 change

long context = clCreateContext(ctxProps, device.address(), new CLContextCallback() {
long context = clCreateContext(ctxProps, device.address(), new CLCreateContextCallback() {

Line 126/127 change


When I ran this I got a vendor not found issue too. But this turned out to be a driver install error. To fix I installed from ( I have an nvidia card too and I suspect its going to be the same issue.

The installation should install a file to /etc/OpenCL/vendors (the file will be an icd file). This will contain a link to the .so. If this is incorrect then it won't work. Check this if you have installed the nvidia drivers correctly to see that it has the full path. My file contains the text (minus quotes) "/opt/intel/opencl/".


Quote from: abcdef on January 27, 2016, 08:51:33I had to make some code changes though

Why? Which LWJGL version did you run this on?


build54, from around Oct 31st.