Skip to main content

Docker AMD Linux

This is a generic guide to adding AMD GPU support to a FileFlows docker container running on a Linux machine, using the AMD Container Toolkit.

The AMD Container Toolkit adds an amd runtime to docker, similar to the NVIDIA runtime. This passes the GPU through to the container, so there is no need to pass in /dev/dri manually.

note

The AMD Container Toolkit is officially documented for AMD Instinct GPUs. It passes the standard /dev/kfd and /dev/dri devices through to the container, so it can also work with Radeon GPUs, but this is not officially supported by AMD.

Step 1. Drivers​

Install the AMDGPU driver on the host. Follow AMD's ROCm install quick start for your distribution.

For example, on Ubuntu 22.04

wget https://repo.radeon.com/amdgpu-install/6.3.4/ubuntu/jammy/amdgpu-install_6.3.60304-1_all.deb
sudo apt install ./amdgpu-install_6.3.60304-1_all.deb
sudo apt update
amdgpu-install --usecase=dkms
sudo modprobe amdgpu

Once installed, reboot.

Docker 25.0 or later is required. Docker Desktop on Linux is not supported.

Step 2. AMD Container Toolkit​

Add your user to the render and video groups

sudo usermod -a -G render,video $LOGNAME

Add the AMD Container Toolkit repository (Ubuntu)

sudo apt update
sudo apt install wget gpg
sudo mkdir --parents --mode=0755 /etc/apt/keyrings
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
sudo apt update

Install the toolkit

sudo apt install amd-container-toolkit

For RHEL and other distributions see the AMD Container Toolkit quick start guide.

Step 3. Configure the Docker Runtime​

Register the amd runtime with docker and restart docker

sudo amd-ctk runtime configure
sudo systemctl restart docker

Test the runtime. The toolkit includes amd-smi, which should list your GPU(s)

sudo docker run --rm --runtime=amd -e AMD_VISIBLE_DEVICES=all rocm/dev-ubuntu-24.04 amd-smi monitor

Step 4. FileFlows​

Next its time to get FileFlows working. This requires the "amd" runtime for docker from step 3.

sudo docker run -d \
--name FileFlows \
-p 19200:5000 \
-v /mnt/docker/fileflows/data:/app/Data \
-v /mnt/docker/fileflows/logging:/app/Logs \
-v /mnt/docker/fileflows/temp:/temp \
-v /mnt/media:/media \
-e AMD_VISIBLE_DEVICES=all \
--runtime amd \
--restart unless-stopped \
revenz/fileflows

Or with docker compose

services:
fileflows:
image: revenz/fileflows
container_name: fileflows
runtime: amd
environment:
- AMD_VISIBLE_DEVICES=all
ports:
- 19200:5000
volumes:
- /mnt/docker/fileflows/data:/app/Data
- /mnt/docker/fileflows/logging:/app/Logs
- /mnt/docker/fileflows/temp:/temp
- /mnt/media:/media
restart: unless-stopped

To use a specific GPU, set AMD_VISIBLE_DEVICES to the GPU index, for example AMD_VISIBLE_DEVICES=0.

Step 5. Encoders​

VAAPI works out of the box, the FileFlows image already includes the Mesa VAAPI drivers. You can confirm the GPU is visible with

sudo docker exec FileFlows vainfo

AMF (h264_amf, hevc_amf, av1_amf) requires AMD's proprietary AMF runtime inside the container. The container toolkit only passes the GPU through, it does not install these libraries. Install the AMDVLK & AMF Driver DockerMod from the FileFlows repository to add them.