.. Copyright (C) 2022, Xilinx Inc - All rights reserved Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. .. meta:: :keywords: Compute Unit, Kernel, Container, Xiinx Container Runtime :description: Xilinx-container-runtime is an extension of runc, with modification to add xilinx devices before running containers. :xlnxdocumentclass: Document :xlnxdocumenttype: Tutorials ************************ 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. .. code-block:: bash 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. .. code-block:: bash 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. .. image:: ./images/XCRT-Arch.png :width: 50% .. toctree:: :caption: Quick Start :maxdepth: 1 prerequisites.rst install.rst rel.rst .. toctree:: :caption: User Guide :maxdepth: 1 cli.rst docker.rst podman.rst singularity.rst .. toctree:: :caption: Notice :maxdepth: 1 notice.rst