Issue with the OpenCL Shared Libraries (Quadro M5000)

So I just successfully installed the driver for the Quadro M5000, and everything works. Here is the driver I installed: http://www.nvidia.com/download/driverResults.aspx/111596/en-us. The machine is running CentOS 6. However when I try to run some OpenCL code I wrote I get the following error:

[zack@sockeye ~]$ OpenCLmovestack 
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/zack/my_prowess_home/sys/linux64/lib/libcom_nanoseis_ssa.so: /usr/lib64/libOpenCL.so.1: version `OPENCL_2.0' not found (required by /home/zack/my_prowess_home/sys/linux64/lib/libcom_nanoseis_ssa.so)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at com.nanoseis.ssa.ParallelMoveoutAndStackApplier.<clinit>(ParallelMoveoutAndStackApplier.java:15)
Could not find the main class: com.nanoseis.ssa.ParallelMoveoutAndStackApplier.  Program will exit.

What I figured was that the old OpenCL .so(s) for the old card were left behind after instillation and it was picking those up instead of the new .so(s) (I did uninstall the older driver before installing the new driver). It looked like that might be the case:

[root@sockeye zack]# ls -l /usr/lib64 | grep -i opencl
lrwxrwxrwx   1 root         root       26 Dec  8 15:23 libnvidia-opencl.so.1 -> libnvidia-opencl.so.375.20
-rwxr-xr-x   1 root         root  8646792 Dec  8 15:23 libnvidia-opencl.so.375.20
lrwxrwxrwx   1 root         root       14 Dec  8 15:23 libOpenCL.so -> libOpenCL.so.1
lrwxrwxrwx   1 root         root       16 Dec  8 15:23 libOpenCL.so.1 -> libOpenCL.so.1.0
lrwxrwxrwx   1 root         root       37 Dec  8 15:48 libOpenCL.so.1.0 -> libOpenCL.so.1.0.0
-rwxr-xr-x   1 root         root    26328 Dec  8 15:23 libOpenCL.so.1.0.0

However when I attempt a simple fix by changing the link using “ln -s -f /usr/lib64/libnvidia-opencl.so.375.20 /usr/lib64/libOpenCL.so.1.0” and then try running my program I instead get this:

[zack@sockeye ~]$ OpenCLmovestack 8000 2000 8000 2
runOpenCLOnly() startIndexOut=800 endIndexOut=7200
samplesPerTrace: 8000 nTracesIn: 2000 nTracesOut: 8000
java: relocation error: /home/zack/my_prowess_home/sys/linux64/lib/libcom_nanoseis_ssa.so: symbol clGetPlatformIDs, version OPENCL_1.0 not defined in file libOpenCL.so.1 with link time reference

Here is looks like my program at least starts to run (because the first two lines are from my program) however it then crashes saying version OPENCL_1.0 is not defined. Huh?

Also if I do “cat /etc/OpenCL/vendors/nvidia.icd” I get “libnvidia-opencl.so.1”, so at least that’s pointing to the right one?

So I saved the old opencl .so from the old graphics card, I tried replacing the new .so in favor of it to see what happens. This is what I get:

[zack@sockeye ~]$ OpenCLmovestack  8000 2000 8000 2
runOpenCLOnly() startIndexOut=800 endIndexOut=7200
samplesPerTrace: 8000 nTracesIn: 2000 nTracesOut: 8000
java: relocation error: /home/zack/my_prowess_home/sys/linux64/lib/libcom_nanoseis_ssa.so: symbol clCreateCommandQueueWithProperties, version OPENCL_2.0 not defined in file libOpenCL.so.1 with link time reference

Also some additional information that I forgot: when I first installed the driver I could actually run and complete the OpenCL code! It however ran slower than I excepted. So this is getting stranger, because I expected what I did above to work except be slow like before… what .so could I have been using then?

Lastly; when I use readelf -WV I do see OPENCL_1.0 defined in the so that comes with the driver, and not OPENCL_1.0 nor OPENCL_2.0 defined otherwise in the other two .so(s) (the nvidia one and the old .so).

So two things:

  1. Why does it seem want to use libOpenCL.so.1.0.0 over the libnvidia-opencl.so.375.20 despite what the .icd contains? I am correct in thinking that it should be using libnvidia-opencl.so.375.20, right?

  2. What’s the issue with the second with the OPENCL_1.0 error? Why is it even trying to find version 1.0? I would hope my program is using OpenCL 2.0. Currently I compile the code on a different machine then I run the code on, but that shouldn’t matter?

Let me ask a simpler question: why is my code wanting OPENCL_2.0? What do I need to do to tell my code that I am okay with running OPENCL_1.0?

Edit: Nevermind, obviously what I need to do is compile the code with OpenCL 1.0 header files… where can I find such header files? I will report back if I find them.