项目作者: KAIST-NCL

项目描述 :
Accelerator-Docker : provides common interface for automatic passthrough of heterogeneous hardware accelerators in docker
高级语言: C++
项目地址: git://github.com/KAIST-NCL/Accelerator-Docker.git
创建时间: 2018-08-22T06:41:15Z
项目社区:https://github.com/KAIST-NCL/Accelerator-Docker

开源协议:Other

下载


Accelerator-Docker

Accelerator-Docker supports running container with accessibility to a target hardware accelerator (e.g., fpga or gpu).
It can manage status of all accelerators in a server.
Accelerator-Docker supports automatic pass-through of PCIe-connected accelerators (FPGA or GPU) in container. Original docker requires setting for mounting device driver, libraries to access specific hardware in the container. In the Accelerator-Docker, however, it automatically runs a container following the pre-determined settings with simple option. Moreover, it provides common interface to manage heterogeneous accelerators. More details are described below.


drawing

Getting Started

Dependencies

  • Docker
  • Go >= 1.6
  • Protocol Buffers (C++) & Protoc

For dependencies, refer to Docker, Go, Protocol Buffers

Installation

Install dependencies for build

  1. $ sudo apt-get update && \
  2. sudo apt-get install -y build-essential git pkg-config libseccomp-dev libcap-dev libpci-dev libapparmor-dev libselinux1-dev

Now, clone this repository and make it.

  1. $ git clone https://github.com/KAIST-NCL/Accelerator-Docker.git
  2. $ cd Accelerator-Docker
  3. $ make
  4. $ sudo make install
  5. $ sudo systemctl restart docker #Restart docker daemon to notify that new runtime is added

Tested Environment

  • Ubuntu 16.04
  • Docker 18.06.1-ce
  • Go 1.11
  • Protocol Buffers 3.6.1

How to run Accelerator-Docker

First, you need to provide device list you want to access from docker container as protocol buffer text form.
/etc/accelerator-docker/device.pbtxt

  1. accelerators:[{
  2. type: "xilinx.fpga/kcu1500",
  3. devices:[{
  4. name: "KCU-1500",
  5. device_file:[
  6. "/dev/xcldev1",
  7. "/dev/xdmadev1"
  8. ],
  9. library:[
  10. "/PATH/TO/LIB/libxilinxopencl.so"
  11. ],
  12. file:[{
  13. src: "/PATH/IN/HOST/libxclgemdrv.so",
  14. dst: "/PATH/IN/CONTAINER/libxclgemdrv.so",
  15. }],
  16. env:[{
  17. key: "XILINX_SDX",
  18. val: "/SDX"
  19. }]
  20. }]
  21. }]
  • Files specified in ‘library’ section are mounted to ‘/usr/lib’ of container, while the files specified in ‘file’ section are mounted to specific path.
  1. $ docker run --runtime acc-runtime -e ACC_VISIBLE_DEVICES=KCU-1500

Using ACC-Manager

Accelerator-Docker not only provides runtime hook for docker but also provides manager registered in device file.
Accelerator-Manager provides status for all devices and which container uses the hardware.

  1. $ acc-manager list

Authors

KAIST NCL

License

This project is released under the BSD-3-Clause, see LICENSE for more information.