4

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.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
user1413904
  • 41
  • 1
  • 2
  • 1
    Installing a low-level driver such as OpenCL, which requires tight integration with the OS, is normally going to demand administrator privileges. Intel's OpenCL SDK for Linux also requires administrator access for installation. – vocaro May 25 '12 at 19:55

3 Answers3

4

Put the ICD-files in /some/path/icd and then export the path like so:

export OPENCL_VENDOR_PATH=/some/path/icd

It used to work in previous versions at least. I would be surprised if they changed it.

Quantumboredom
  • 1,426
  • 11
  • 19
  • 1
    Worked for me. Also, to give visibility to other system-installed platform like NVIDIA or Intel, you can put a symbolic link to each of their .icd files in `/some/path/icd`. – NoahR Jan 07 '14 at 01:08
2

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.

  1. Download the AMD OpenCL SDK 64 bit.

  2. $ tar -xvzf AMD-APP-SDK-v2.8-RC-lnx64.tgz

  3. $ tar -xvzf icd-registration.tgz

  4. $ cd AMD-APP-SDK-v2.8-RC-lnx64

  5. $ mkdir /local/install/path

  6. $ cp -r lib /local/install/path

  7. $ cp -r include /local/install/path

  8. $ cp -r ../etc /local/install/path

  9. Optional: make symbolic links for desired system installed platforms: $ ln -s /etc/OpenCL/vendors/nvidia.icd /local/install/path/etc/vendors/nvidia.icd

  10. $ export OPENCL_VENDOR_PATH=/local/install/path/etc/vendors

  11. $ export LD_LIBRARY_PATH=/local/install/path/lib/x86_64:$LD_LIBRARY_PATH

  12. $ cc -I/local/install/path/include -L/local/install/path/lib/x86_64 -lOpenCL demo.c

  13. $ ./a.out

NoahR
  • 1,417
  • 3
  • 18
  • 33
1

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.

BoeroBoy
  • 1,094
  • 11
  • 17