How to Enable CPU Platform for OpenCL Applications

amd-processoropencl

I am currently running Ubuntu 16.04 on a machine with an AMD A8-5600K APU and a Radeon R9 270X. The amdgpu driver does not yet support my card and therefore I cannot use OpenCL on my GPU. However, I see no reason why OpenCL applications can't use my CPU.

I've installed every package I can think of – ocl-icd-libopencl1 Install ocl-icd-libopencl1, ocl-icd-opencl-dev Install ocl-icd-opencl-dev, etc.

I've written a simple application that enumerates available OpenCL platforms and it fails on the clGetPlatformIDs() call. What am I missing?


Edit: I installed the AMD APP SDK as recommended in SE6's answer but no platforms were showing up yet. Running strace revealed that the OpenCL ICD loader couldn't find libamdocl64.so.


Further edit: success! I was able to get it working using the following command:

sudo ln -s '/opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so' \
    /usr/lib/x86_64-linux-gnu/libamdocl64.so

(Replace /opt with the path you installed the AMD APP SDK to.)

Best Answer

Install the AMD APP SDK from the AMD website you should then see your CPU available as an OpenCL device.

Related Question