Hello Guest

OpenCL Starter Issues

  • 3 Replies
  • 6766 Views
OpenCL Starter Issues
« on: January 26, 2016, 19:06:00 »
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
« Last Edit: January 26, 2016, 19:08:14 by mighty_archemedes »

*

Offline abcdef

  • ****
  • 336
Re: OpenCL Starter Issues
« Reply #1 on: January 27, 2016, 08:51:33 »
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
Code: [Select]
import static org.lwjgl.system.Pointer.*;
Line 91 change

Code: [Select]
long context = clCreateContext(ctxProps, device.address(), new CLContextCallback() { to
Code: [Select]
long context = clCreateContext(ctxProps, device.address(), new CLCreateContextCallback() {
Line 126/127 change

Code: [Select]
buffer_region.origin(0);buffer_region.size(64); to
Code: [Select]
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".

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: OpenCL Starter Issues
« Reply #2 on: January 27, 2016, 18:17:05 »
I had to make some code changes though

Why? Which LWJGL version did you run this on?

*

Offline abcdef

  • ****
  • 336
Re: OpenCL Starter Issues
« Reply #3 on: January 28, 2016, 18:48:06 »
build54, from around Oct 31st.