BCCD accelerator support

From BCCD 3.0

Jump to: navigation, search

Contents

Introduction

BCCD has supported nVidia's CUDA framework for a number of years. CUDA has a relatively low bar to get started, but can only run on nVidia's GPU accelerators. The ecosystem of accelerators has expanded, with AMD and Intel developing their own GPU platforms, and Intel developing an x86-based coprocessor.

On the software side, the software frameworks for supporting these accelerators has expanded to include cross-platform frameworks:

BCCD must expand to include at least one cross-platform framework for developing GPU applications, and that framework must support the LittleFe v4d ASROCK boards with their Intel GPU (Gen7 Intel Graphics DX 11).

OpenCL

OpenCL is a procedural framework for developing accelerator applications. The accelerator hardware might be on a CPU, GPU, or even a FPGA. As a procedural framework, it is similar to CUDA, but the framework itself does much less to help the programmer configure and manage the accelerator. For instance, a simple vector addition application is nearly 150 lines, of which only four are actually dedicated to the accelerator kernel.

On the architecture side, OpenCL is composed of a number of components:

Advantages of OpenCL

Challenges with OpenCL

Install OpenCL on BCCD

This stuff is in v3.4.0-gpgpu-skylar

  1. apt-get install ocl-icd-opencl-dev
  2. Drop OpenCL_Info_solution.zip into ~bccd
    1. In Makefile, change -framework opencl to -lOpenCL
    2. In opencl-info.c, change include line OpenCL to CL

OpenCL links

OpenMP

OpenMP is a pragma-based framework for shared-memory parallelism. It is supported by many compilers (gcc, Intel, PGI, etc.) and allows easy building of both serial and parallel applications. The exact implementation of the parallelism is determined by a combination of compiler and run-time directives.

Beginning with OpenMP 4, OpenMP added a new directive target that could be used to send specific code blocks to an accelerator rather than a CPU. Unfortunately, OpenMP 4 is not supported with gcc until 4.9.1, and target will not be present until v5.

Advantages of OpenMP

Challenges with OpenMP

OpenACC

Like OpenMP, OpenACC is a pragma-based parallelism framework. Unlike OpenMP, it is not a broad industry consortium supporting it, but a small group of hardware and software companies (nVidia, Cray, and PGI). Despite that, hardware support includes other vendors, in particular Intel.

Advantages of OpenACC

Challenges with OpenACC

Links for OpenACC

Install OpenACC on BCCD v3.4.0-gpgpu-skylar

  1. Setup Debian experimental in /etc/apt/sources.list (experimental is not a full distribution yet, and some dependent packages are in unstable):
    deb http://ftp.debian.org/debian unstable main non-free contrib
    deb http://ftp.debian.org/debian experimental main non-free contrib
    
  2. Install gcc-5: apt-get update && apt-get -yt experimental gcc-5

Questions for Intel

At this point it is unclear how to make any of the above technologies work with BCCD, mostly due to limited documentation for the underlying architecture for each and limited documentation for enabling the compiler features needed to build applications using them. Since Intel provides the hardware for our on-board accelerators on LittleFe v4d, it makes sense to approach them with these questions:

  1. Which framework does Intel see the most certain future for, so we can guide our buildout participants to a technology that will be useful for the longest time?
  2. What user- and kernel-space software must we include on BCCD to support it?
  3. Which compiler should we use, and how should it be configured?

Beignet custom build

  1. Download and boot BCCD v3.4.0-skylar-5078
  2. Download tarballs:
  3. Set sources.list to include unstable: deb [arch=i386,amd64] http://debian.osuosl.org/debian unstable main non-free contrib
  4. Install packages: apt-get update && apt-get -t unstable -y ocl-icd-{opencl-,}dev libxcb-xfixes0-dev libpciaccess-dev
  5. Build libdrm: ./configure --prefix=${BCCD_SW}/libdrm/2.4.59/${ARCHPATH} && nice make -j5 && make install

LLVM/CLANG attempt

  1. Install LLVM/CLANG packages: apt-get -t unstable -y install llvm{,-3.7} libclang-3.7-dev
  2. PKG_CONFIG_PATH=${BCCD_SW}/libdrm/2.4.59/${ARCHPATH}/lib/pkgconfig cmake -DLLVM_INSTALL_DIR=/usr/bin/ -DDRM_INTEL_PREFIX=${BCCD_SW}/libdrm/2.4.59/${ARCHPATH} -DCLANG_LIB=/usr/lib/llvm-3.7/lib ../Beignet-1.0.3-Source/
  3. Got error described here

GCC attempt

  1. PKG_CONFIG_PATH=${BCCD_SW}/libdrm/2.4.59/${ARCHPATH}/lib/pkgconfig cmake -DCOMPILER=GCC -DBUILD_STANDALONE_GBE_COMPILER=true ../Beignet-1.0.3-Source/
  2. Still tries to find LLVM, not clear why:
CMake Error at CMake/FindLLVM.cmake:23 (message):
  Could NOT find LLVM executable, please add
  -DLLVM_INSTALL_DIR=/path/to/llvm-config/ in cmake command
Call Stack (most recent call first):
  CMakeLists.txt:104 (Find_Package)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox