I am trying to install OpenCL(AMD) on linux, but I am stuck on the last step(install ICD)
It seems like ICD HAS to be installed at /etc/OpenCL/vendor, but I don’t have root access to the computer.
Is there any way to make OpenCL work without installing ICD? (or maybe through an environment variable to add search path for ICD files?)
It just seems really inconvenient for people like us when ICD file path is hardcoded.
Here is a sketch of how to do a "user" or "local" install of the AMD OpenCL SDK without administrator privileges. Step 9 also provides a method to use the AMD OpenCL platform along with selected platforms installed system-wide.
The installation directory
/local/install/path
and current SDK version just need to be modified to suit.Download the AMD OpenCL SDK 64 bit.
$ tar -xvzf AMD-APP-SDK-v2.8-RC-lnx64.tgz
$ tar -xvzf icd-registration.tgz
$ cd AMD-APP-SDK-v2.8-RC-lnx64
$ mkdir /local/install/path
$ cp -r lib /local/install/path
$ cp -r include /local/install/path
$ cp -r ../etc /local/install/path
Optional: make symbolic links for desired system installed platforms:
$ ln -s /etc/OpenCL/vendors/nvidia.icd /local/install/path/etc/vendors/nvidia.icd
$ export OPENCL_VENDOR_PATH=/local/install/path/etc/vendors
$ export LD_LIBRARY_PATH=/local/install/path/lib/x86_64:$LD_LIBRARY_PATH
$ cc -I/local/install/path/include -L/local/install/path/lib/x86_64 -lOpenCL demo.c
$ ./a.out
Just an update on this as I suddenly found myself having the same issue (again). I had to disable the buggy Mesa icd which apparently is crashing under non-root runs. Frustrating as it's more a problem with the API handling errors while listing each platform more than an error with permissions or clinfo. Make sure to disable each platform icd to isolate which one is having issues. Hope this helps someone later.
Put the ICD-files in /some/path/icd and then export the path like so:
It used to work in previous versions at least. I would be surprised if they changed it.