For graphical (Blender, DarkTable, GIMP, HandBrake) or mathematical (BitCoin, Ethereum, BOINC) calculations, OpenCL offers a way to use the GPU with its powerful processing cores. For more details read https://wiki.archlinux.org/index.php?title=GPGPU. Normal CPU’s nowadays have between 2 to 8 cores, the latest GPU’s can have thousands (AMD RX 480 has 2304 stream processors).
Sadly Nvidia developed with CUDA a closed, proprietary API which has been used by several applications, but this excluded Intel and AMD GPU’s. Thanks to AMD recently support has been added to translate at least CUDA to HIP in the LLVM compiler and by this to run it via the OpenCL ROCm open source stack on newer AMD GPU’s (https://www.phoronix.com/scan.php?page=news_item&px=LLVM-CUDA-To-AMD-HIP).
OpenCL Mesa for AMD
sudo pacman -Sy opencl-mesa clinfo
The mesa implementation is currently limited to OpenCL 1.2 (2.0 is in the pipeline, but Gallium 3D Clover still lacks OpenCL 2.0 support).
If you want to see information about the installed OpenCL drivers you can use the clinfo tool.
To see active OpenCL drivers, run:
ls /etc/OpenCL/vendors amdocl64.icd
ROCm (https://github.com/RadeonOpenCompute/ROCm) is the latest open source software stack of AMD for OpenCL 2.0 support with dGPU support in AMDKFD (min. Linux 4.20) , LLVM and Mesa. Raven Ridge APU’s are still prepared.
If you need to use the proprietary package of AMD:
- AMDGPU PRO (supports legacy products older than Vega 10) AUR: proprietary runtime for
- AMDGPU PRO (supports Vega 10 and later products) AUR: proprietary runtime for
The OpenCL AMD driver will be extracted from the AMDGPU-PRO driver. Once installed, don’t forget to remove the Mesa OpenCL driver! They don’t seem to work concurrently in every scenario even though you can install them side by side.