Installation

These steps run on Ubuntu 22.04 or newer, the releases Docker’s packages support. Other Linux distributions may work, since most processing takes place in a Docker container, but install_docker.sh is specific to Ubuntu. Your machine does need NVIDIA GPU drivers installed. Your machine does NOT need CUDA installed.

  1. Clone the repository
git clone https://github.com/MyrtleSoftware/caiman-asr-dev.git && cd caiman-asr-dev
  1. Install Docker, its buildx plugin and the NVIDIA Container Toolkit, which gives containers the GPUs
caiman_train/install_docker.sh
  1. Add your username to the docker group:
sudo usermod -a -G docker [user]

Run the following in the same terminal window, and you might not have to log out and in again:

newgrp docker
  1. Build the docker image
caiman_train/scripts/docker/build.sh

The launcher in step 5 also builds the image first, so this step only saves waiting later. The first build is slow, most of it compiling NVIDIA’s apex for every GPU architecture. Later builds are quick, unless the dependencies changed. The image holds the Python environment from the repository’s uv.lock, not the code: the launcher mounts your checkout into the container, so editing the code needs no rebuild.

Each change to the dependencies leaves an old image and its build cache behind. Run caiman_train/scripts/docker/gc.sh weekly, from cron for example, to remove old training images and the build cache they leave behind. Docker can also cap its build cache by itself: see build garbage collection.

  1. Start an interactive session in the Docker container mounting the volumes, as described in the next section.
caiman_train/scripts/docker/launch.sh <DATASETS> <CHECKPOINTS> <RESULTS>

The container runs as your user, so the files it writes to the mounted directories are yours.

Requirements

The image’s CUDA version, its base image in caiman_train/Dockerfile, sets the oldest NVIDIA driver it runs with: see NVIDIA’s table of compatible drivers.

Information about volume mounts

Setting up the training environment requires mounting the three directories: <DATASETS>, <CHECKPOINTS>, and <RESULTS> for the training data, model checkpoints, and results, respectively.

The following table shows the mappings between directories on a host machine and inside the container.

Host machineInside container
the repository/workspace
<DATASETS>/datasets
<CHECKPOINTS>/checkpoints
<RESULTS>/results

Note

The host directories passed to caiman_train/scripts/docker/launch.sh must have absolute paths.

If your <DATASETS> directory contains symlinks to other drives (i.e. if your data is too large to fit on a single drive), they will not be accessible from within the running container. In this case, you can pass the absolute paths to your drives as the 4th, 5th, 6th, … arguments to caiman_train/scripts/docker/launch.sh. This will enable the container to follow symlinks to these drives.

Note

During training, the model checkpoints are saved to the /results directory so it is sometimes convenient to load them from /results rather than from /checkpoints.

Next Steps

Go to the Data preparation docs to see how to download and preprocess data in advance of training.