Xilinx Container Runtime

Typically, for users who want to leverage Xilinx devices in a Docker container, Docker allows ‘–device’ flag to add host a device to the container. Here is an example to add one Xilinx device with user function node and management function node in to a container.

sudo docker run -it --device=/dev/dri/renderD128:/dev/dri/renderD128 --device=/dev/xclmgmt256:/dev/xclmgmt256 testimage:v1 /bin/bash

Most container orchestrators, including Docker, use runC as the low-level container runtime to start a container. Xilinx container runtime is an extension of runC, with modification to add Xilinx devices before running containers. With Xilinx container runtime, it is easy to leverage a Xilinx device with allowed environment variable specified.

Here is an example to add device to a container with Xilinx device number specified. The proper device paths will be mounted into the container automatically.

sudo docker run -it --runtime=xilinx -e XILINX_VISIBLE_DEVICES=0 testimage:v1 /bin/bash

Since it is a runC compliant runtime, Xilinx container runtime can be integrated with various contianer orchestrators, including docker and podman. Also, it can be used in Kubernetes and AWS ECS cluster, with installation on each node.

Here is a diagram showing the way in which Xilinx container runtime works.

_images/XCRT-Arch.png