Install OpenCL (AMD SDK) on Linux without ROOT privilege

I am trying to install OpenCL (AMD) on linux, but I am stuck in the last step (install ICD)

It seems that ICD HAS should be installed in / etc / OpenCL / vendor, but I don't have root access to the computer.

Is there a way to make OpenCL work without installing ICD? (or maybe add a search path for ICD files through the environment variable?)

It just seems like it's inconvenient for people like us when the ICD file path is hard-coded.

+4
source share
3 answers

Put the ICD files in / some / path / icd and then export the path as follows:

export OPENCL_VENDOR_PATH=/some/path/icd 

It worked at least in previous versions. I would be surprised if they changed it.

+4
source

Here's a sketch of how to perform a β€œcustom” or β€œlocal” installation of the AMD OpenCL SDK without administrator privileges. Step 9 also provides a method for using the AMD OpenCL platform along with the selected platforms installed on the system.

The installation directory /local/install/path and the current version of the SDK just need to be changed to match.

  • Download the 64-bit AMD OpenCL SDK.

  • $ 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: create symbolic links for the desired system 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

+2
source

Just an update on this when I suddenly found that I had the same problem (again). I had to disable the Mesa icd buggy, which seems to crash when executed without root authority. Disappointment, since this is more of a problem with API processing errors when listing each platform, more than an error with permissions or clinfo. Be sure to disable each icd platform to isolate the problem. Hope this helps someone later.

+1
source

Source: https://habr.com/ru/post/1414056/


All Articles