Docker Quickstart

Estimated time: 5 minutes, 6 minutes with buffer.


Pulling a Docker Image

Your node comes with Docker Engine installed, so all Docker functionality should be available to you on your first connection. Begin by pulling the desired image:

docker pull tensorwavehq/hello_world:latest

You can verify that your image was properly pulled by running the following command and checking for your desired image:

docker images

If the pull was successful, your output should look similar to this:

REPOSITORY                      TAG            IMAGE ID       CREATED          SIZE
tensorwavehq/hello_world        latest         359e600f7aac   2 minutes ago   61.2GB

TensorWave's officially supported images can be found here.


Running a Docker Container

In order to run your Docker containers with GPU acceleration, you must mount the devices. For certain applications, you must also add the container to a group to utilize your GPUs.

Using the docker run Command

Here's an example command to mount the devices and configure the correct permissions:

docker run --device /dev/kfd --device /dev/dri --group-add video tensorwavehq/hello_world:latest

The usage of each option is as follows:

  • --device /dev/kfd

    • This command mounts the main compute interface to your container.

  • --device /dev/dri

    • This command mounts the Direct Rendering Interface for your GPU. To restrict access, append /renderD<node>, where the node is the ID of the node you want to mount.

  • --group-add video (optional)

    • This command adds your container to the server's video group, which is necessary for certain applications (including PyTorch).

Using docker-compose

The following is an equivalent docker-compose to the command above:

version: '3'
services:
  hello_world:
    image: tensorwavehq/hello_world:latest
    devices:
      - /dev/kfd
      - /dev/dri
    group_add:
      - video

To use it, create a docker-compose.yml file in any subdirectory, and within that subdirectory, run:

docker compose up

Verifying Setup

If done properly, the output of either the run or compose command should be similar to:

CUDA available: True
Number of GPUs: 8
GPU 0: AMD Instinct MI300X
GPU 1: AMD Instinct MI300X
GPU 2: AMD Instinct MI300X
GPU 3: AMD Instinct MI300X
GPU 4: AMD Instinct MI300X
GPU 5: AMD Instinct MI300X
GPU 6: AMD Instinct MI300X
GPU 7: AMD Instinct MI300X

For other containers, to verify that your Docker container has access to your GPUs, run both rocm-smi and rocminfo. These commands will reveal information about the GPUs mounted to your container.


Last updated