OpenCL - on AMD hardware

This is a follow up to OpenCL on IntelHD on Debian. This time I'll show the installation necessary in order to use OpenCL on AMD hardware.

When I wrote up OpenCL on IntelHD on Debian, I read https://wiki.debian.org/ATIStream and got the impression that the non-free AMD drivers where necessary in order to get OpenCL working on AMD hardware in debian. But it turns out there is a fully FLOSS OpenCL stack, which is nice because the video drivers of the non-free stack did not work as well as the FLOSS video drivers for my card.

The parts of the OpenCL stack are:

There are several different OpenCL stacks, and the Intel one was installed in the previous post. What packages constitute the parts of the different FLOSS OpenCL stacks?

Component FLOSS non-free AMD non-free nvidia
ICD Loader ocl-icd-libopencl1 amd-libopencl1 nvidia-libopencl1
OpenCL library mesa-opencl-icd (general), beignet-opencl-icd (for intel hardware) amd-opencl-icd nvidia-opencl-icd
Header and libraries ocl-icd-opencl-dev amd-opencl-dev nvidia-opencl-dev

In the FLOSS stack, beignet-opencl-icd include hardware specific stuff, while mesa-opencl-icd instead depends on packages with hardware specific implementations: libclc-r600, libclc-amdgcn, libdrm-amdgpu1, libdrm-nouveau2, libdrm-radeon1.

So, to get a free OpenCL stack for AMD hardware, I issued:

sudo apt-get install ocl-icd-libopencl1 mesa-opencl-icd ocl-icd-opencl-dev

which triggered removal of: amd-libopencl1 amd-opencl-dev

and added the following packges to be installed:

libclang-common-3.9-dev libclc-amdgcn libclc-dev libclc-r600 libpoclu-dev libpoclu1 mesa-opencl-icd ocl-icd-libopencl1 ocl-icd-opencl-dev

Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 13.0.6
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD CAICOS (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 13.0.6
  Driver Version                                  13.0.6
  Device OpenCL C Version                         OpenCL C 1.1
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               2
  Max clock frequency                             625MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes
    char                                                16 / 16
    short                                                8 / 8
    int                                                  4 / 4
    long                                                 2 / 2
    half                                                 0 / 0        (n/a)
    float                                                4 / 4
    double                                               0 / 0        (n/a)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    32, Little-Endian
  Global memory size                              1073741824 (1024MiB)
  Error Correction support                        No
  Max memory allocation                           751619276 (716.8MiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max constant buffer size                        751619276 (716.8MiB)
  Max number of constant args                     13
  Max size of kernel argument                     1024
  Queue properties
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Available                                Yes
  Compiler Available                              Yes
  Device Extensions                               cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD CAICOS (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD CAICOS (DRM 2.48.0 / 4.9.0-3-amd64, LLVM 3.9.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: november 13, 2017