OpenCL Starter Issues

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

Previous topic - Next topic

mighty_archemedes

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 https://github.com/jeffheaton/opencl-hello-world . 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?

ââ,¬â€Mick

abcdef

Hi

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.

https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/test/java/org/lwjgl/demo/opencl/CLDemo.java

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

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


Line 91 change

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


Line 126/127 change

buffer_region.origin(0);buffer_region.size(64);
to
buffer_region.getOrigin(0);buffer_region.getSize(64);


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 (https://software.intel.com/en-us/articles/opencl-drivers#latest_linux_driver). 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/libIntelOpenCL.so".

spasi

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?

abcdef

build54, from around Oct 31st.