---
title: How to Install Docker with ROCm GPU Support on Ubuntu 24.04
url: https://docs.vultr.com/how-to-install-docker-with-rocm-gpu-support-on-ubuntu-24-04
description: Learn how to install Docker with ROCm GPU support on Ubuntu 24.04 for accelerated container workloads. Step-by-step guide for AMD GPU users.
publish_date: 2024-12-02T13:15:34.419229Z
last_updated: 2026-09-09T23:28:38.928143Z
author: Mirdul Swarup
header_image: https://assets.vultrdevrel.com/docs-main-doc-assets-1/2014/f6bd081f-f4e4-48bb-8225-0d3362f647c8.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

## Introduction

Docker is a platform that allows you to package applications and their dependencies into isolated environments called containers, ensuring they run consistently on any system. GPU-enabled containers are specialized Docker containers that can access and use your computer's Graphics Processing Unit (GPU) for tasks requiring high computational power, such as machine learning or video processing. These containers allow applications to leverage GPU resources, which are used for compute and graphical tasks, making them ideal for performance-intensive workloads.

In this article, you are to install Docker from Docker's official repository on ROCm supported systems and access ROCm devices using a Docker container.

## Install Docker

In this section, you are to add Docker's official GPG key to the system, add Docker's official repository to the system's APT sources list, and install Docker and its components such as Docker Engine, Docker CLI, Containerd, Buildx Plugin, and Docker Compose Plugin.

1. Add Docker's official GPG key to the system.

    ```console
    $ sudo apt-get update
    $ sudo apt-get install ca-certificates curl
    $ sudo install -m 0755 -d /etc/apt/keyrings
    $ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    $ sudo chmod a+r /etc/apt/keyrings/docker.asc
    ```

    Above commands ensure that packages downloaded from Docker's repository are authentic and secure. These steps are needed before adding Docker's repository and installing the Docker engine.

1. Add Docker's official repository to the system's APT sources list.

    ```console
    $ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
        $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
        sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    $ sudo apt-get update
    ```

1. Install Docker and its components.

    ```console
    $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    ```

## Understanding ROCm Devices

The following is the list of devices you need to expose to Docker containers.

* `/dev/kfd` **(Kernel Fusion Driver)**: It manages the communication between user applications and AMD GPUs for compute tasks. Also handles GPU memory, scheduling and execution of computational tasks like deep learning or scientific computing.
* `/dev/dri` **(Direct Rendering Infrastructure)**: It provides access to GPU for graphics rendering. Also used for 2D/3D rendering and video processing tasks, enabling graphics acceleration in applications.

Both devices are required for exposing GPU capabilities to Docker containers for GPU-accelerated tasks, such as machine learning and rendering. [Learn more](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/docker.html#accessing-gpus-in-containers)

## Access ROCm Devices from a Container

In this section, you are to download the Docker container of a lighweight ROCm terminal and run a temporary container with ROCm GPU support.

1. Pull lightweight ROCm terminal container image.

    ```console
    $ docker pull rocm/rocm-terminal:latest
    ```

1. Run a temporary container.

    ```console
    $ docker run --rm -it --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined rocm/rocm-terminal 
    ```

    The above command runs a temporary container with access to the necessary GPU devices (`/dev/kfd` and `/dev/dri`) on the system.

1. Verify GPU availability from the container.

    ```console
    $ rocm-smi
    ```

    The above command's output should display all the devices along with their specifications.

1. Exit and destroy the container.

    ```console
    $ exit
    ```

## Conclusion

In this article, you installed Docker from its official repository on ROCm supported systems. Furthermore, you explored ROCm devices like `/dev/kfd` and `/dev/dri` and accessed ROCm devices from a container to enable GPU workloads for containerized applications.

## More Resources

* [Install PyTorch with ROCm Acceleration on Ubuntu 24.04](https://docs.vultr.com/how-to-install-pytorch-with-rocm-acceleration-on-ubuntu-24-04).
* [Install TensorFlow with ROCm Acceleration on Ubuntu 24.04](https://docs.vultr.com/how-to-install-tensorflow-with-rocm-acceleration-on-ubuntu-24-04).
* [Install K3s with ROCm GPU Operator on Ubuntu 24.04](https://docs.vultr.com/how-to-install-k3s-with-rocm-gpu-operator-on-ubuntu-24-04).
* [Install JAX with ROCm Acceleration on Ubuntu 24.04](https://docs.vultr.com/how-to-install-jax-with-rocm-acceleration-on-ubuntu-24-04).
