AMD Container Toolkit offers tools to streamline the use of AMD GPUs with containers. The toolkit includes the following packages:
amd-container-runtime— The AMD Container Runtimeamd-ctk— The AMD Container Toolkit CLI
- Docker runtime integration — Inject AMD GPUs into containers via the
amd-container-runtimeOCI runtime - CDI support — Generate and manage Container Device Interface specs for runtime-agnostic GPU access
- GPU selection — Target GPUs by index, range, or UUID using
AMD_VISIBLE_DEVICES - Docker Swarm & Compose — Orchestrate GPU workloads across nodes with UUID-based scheduling
- GPU Tracker — Lightweight opt-in tracking of container-to-GPU assignments with shared/exclusive access modes
For comprehensive documentation including installation, configuration, CDI, Swarm, troubleshooting, and migration guides, see the official documentation.
- Ubuntu 22.04 or 24.04, or RHEL/CentOS 9
- Docker version 25 or later
- All
amd-ctk runtime configurecommands should be run as root/sudo
Note: Docker Desktop on Linux is not supported for GPU workloads; see troubleshooting for details.
Install the toolkit on Ubuntu (for RHEL/CentOS and full details, see the Quick Start Guide):
-
Install prerequisites and add the repository:
sudo apt update && sudo apt install -y wget gnupg2 wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amd-container-toolkit/apt/ $(. /etc/os-release && echo $VERSION_CODENAME) main" | sudo tee /etc/apt/sources.list.d/amd-container-toolkit.list
-
Install the container toolkit:
sudo apt update && sudo apt install amd-container-toolkit -
Configure Runtime and run a GPU container:
Option A — AMD container runtime:
sudo amd-ctk runtime configure sudo systemctl restart docker
Verify by running a container with all AMD GPUs:
docker run --rm --runtime=amd -e AMD_VISIBLE_DEVICES=all rocm/rocm-terminal rocm-smi
Option B — CDI (runtime-agnostic, no runtime configure needed):
sudo amd-ctk cdi generate --output=/etc/cdi/amd.json sudo amd-ctk cdi validate --path=/etc/cdi/amd.json
Verify by running a container with all AMD GPUs:
docker run --rm --device amd.com/gpu=all rocm/rocm-terminal rocm-smi
Note: CDI is supported by many container runtimes including Docker, Podman, and containerd.
Select specific GPUs by index, range, or UUID:
docker run --rm --runtime=amd -e AMD_VISIBLE_DEVICES=0,1,2 rocm/rocm-terminal rocm-smi
docker run --rm --runtime=amd -e AMD_VISIBLE_DEVICES=0-3,5,8 rocm/rocm-terminal rocm-smi
docker run --rm --runtime=amd -e AMD_VISIBLE_DEVICES=0xEF2C1799A1F3E2ED rocm/rocm-terminal rocm-smiList available GPUs and their UUIDs for use with AMD_VISIBLE_DEVICES:
amd-ctk gpu listThis will display output similar to:
Found 2 AMD GPU devices
---------------------------------------------------------------------------
GPU Id UUID DRM Devices
---------------------------------------------------------------------------
0 0xEF2C1799A1F3E2ED /dev/dri/renderD128
1 0x1234567890ABCDEF /dev/dri/renderD129
Set the AMD runtime as Docker's default (avoids needing --runtime=amd):
sudo amd-ctk runtime configure --runtime=docker --set-as-defaultFor more on specific topics, see the detailed documentation:
- Running Workloads — CDI,
--gpusflag, explicit device paths, GPU partitioning - CDI Guide — Generating, validating, and managing CDI specs
- Docker Compose — Multi-service GPU access
- Docker Swarm — UUID-based GPU scheduling across nodes
- GPU Tracker — Shared/exclusive GPU access tracking
To build a Debian package:
make && make pkg-debTo build an RPM package:
make build-dev-container-rpm && make pkg-rpmPackages are generated in the bin folder.
See the Release Notes for version history, compatibility matrix, and upgrade notes.
This project is licensed under the Apache 2.0 License — see the LICENSE file for details.