ROCm/ROCm-docker
Dockerfiles for the various software layers defined in the ROCm software platform
What it solves
Docker containers don't include the Linux kernel; they share the host's kernel. The ROCm compute stack needs a special kernel driver (ROCK-Kernel-Driver) to be installed on the host machine. ROCm-docker provides a way to package all the other ROCm software layers into Docker images, so you can run ROCm applications in containers without manually assembling all the components each time.
How it works
This repository contains a setup script (setup.sh) that generates Dockerfiles from template files. The script lets you choose whether to install ROCm from pre-built packages (from repo.radeon.com) or build from source, and it also lets you pick the Ubuntu base image version, set debug flags, and more. After the script runs, each sub-directory contains a Dockerfile that can be used to build an image for a specific ROCm layer. The project also uses Docker Compose to coordinate multiple containers and remember device flags (like GPU access). There is a ready-to-use image called rocm/rocm-terminal hosted on Docker Hub for quick starts.
Who it's for
This is for developers and users who want to run ROCm (AMD's GPU compute stack) inside Docker containers, either for development, testing, or deployment. It presumes some familiarity with Docker and Linux commands. The setup guide and asciicast demos help newcomers get started.
Highlights
- Provides a setup script that generates customizable Dockerfiles (from templates) with options for Ubuntu version, source builds, debug flags, etc.
- Supports two installation paths: pulling binaries from the ROCm apt/rpm repository (smaller images, faster builds) or compiling from source (more flexibility, but slower).
- Uses Docker Compose to manage multi-container setups and remember GPU device flags.
- Offers a pre-built rocm/rocm-terminal image on Docker Hub for a quick start.
- Includes a convenient non-root user 'rocm-user' with passwordless sudo in the terminal container, with instructions to tighten security if needed.
- FAQ addresses common issues like missing apt metadata, Docker permission errors, copying files into/out of containers, and preserving work by committing containers back to images.
Related
- Project
- Project
- Project
- Project