Sudo apt-get install build-essential ocl-icd-opencl-dev opencl-headers Sudo apt-get remove linux-image-$(uname -r) Ħ) # Check that kernel 3.19.0-79-generic is loadedħ) # Install build-essential and Open CL 1.2 headers For simplicity, here are the steps in the form of a bash script: I assume (and have tested the procedure below on) a Ubuntu 14.04 LTS server clean installation. For old cards, downgrading to Ubuntu 14.04 is necessary, the kernel of which must be further downgraded to 3.19 (details below). Running Open CL on old cards is a little bit trickier than on newer cards. Beware that dual-booted Ubuntu 16.04 and 14.04 can sometimes break each other, even if you have separate boot and root partitions! WARNING to relatively inexperienced people like myself: The operations below could trash the system. G++ MatrixTranspose.cpp -L/opt/amdgpu-pro/lib/x86_64-linux-gnu/ -lOpenCL An appropriate "Hello world" program is the MatrixTranspose example kindly provided by dipak, in a different thread. Compile your program by the GNU compiler.Install the Open CL headers from the Ubuntu repository by.Install acoording to the instructions on the site. Download the amdgpu-pro driver from .Here is how it can be done, starting from an up-to-date vanilla Ubuntu 16.04 LTS installation: It is actually quite easy, at least for newer GPUs. GCN-1.2 ("newer", ~2014): R9 285, R9 380, R9 380X.Ī quick glance at the web gives the impression that it is difficult to run Open CL on AMD GPUs, but this isn't true. Although Open CL is supported by the proprietary driver amdgpu-pro, this driver only supports newer cards, here meaning GPUs implementing the GCN-1.2 architecture or newer. Unfortunately, amdgpu does not support Open CL. If I understand right, prior to Ubuntu 16.04, the Linux kernel supported AMD graphics cards, but then the card support was transferred to the external amdgpu open-source driver. Credits for finding these simple but less than obvious procedures go to wizards dipak and Luke Iwanski.Īlthough Open CL has been supported for quite a while by AMD GPUs, a problem appeared with the introduction of Ubuntu 16.04. Corrections and improvements are gratefully accepted. I'm not an expert, so errors and mistakes in this post are highly likely. I'm writing this because I believe there is general interest in this subject.
0 Comments
Leave a Reply. |