Skip to content

WIS installation on Ubuntu 24.04 #447

@Cynon42

Description

@Cynon42

When attempting to get WIS to build the image on Ubuntu 24.04 recently, I had to make a few changes to the Dockerfile to include the following:

WORKDIR /app

# System dependencies required for PyAV / aiortc
RUN apt-get update && apt-get install -y \
    zstd \
    git-lfs \
    pkg-config \
    libavcodec-dev \
    libavformat-dev \
    libavdevice-dev \
    libavutil-dev \
    libswscale-dev \
    libswresample-dev \
    libavfilter-dev \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
# PyAV 10.0.0 is incompatible with Cython >= 3
RUN --mount=type=cache,target=/root/.cache pip install "cython<3"

RUN --mount=type=cache,target=/root/.cache pip install --no-build-isolation -r requirements.txt

Also, a separate approach was needed to treat Nvidia GPU support rather than that available in Ubuntu.sh

Manually install NVIDIA Container Toolkit using the generic repo

This is what most people on 24.04 are doing.

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey |
sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg

curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list |
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' |
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

sudo apt update
sudo apt install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Then test:

docker run --rm --gpus all nvidia/cuda:12.4.1-base-ubuntu22.04 nvidia-smi

If you see your GPU, you’re done.

Also Fix: install NVIDIA Container Toolkit (Ubuntu 24.04)

On your server, run the following exact commands.

Step 1 — Add NVIDIA repository
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list |
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit.gpg] https://#g' |
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

Step 2 — Install toolkit
sudo apt update
sudo apt install -y nvidia-container-toolkit

Step 3 — Configure Docker to use NVIDIA runtime
sudo nvidia-ctk runtime configure --runtime=docker

Step 4 — Restart Docker
sudo systemctl restart docker

  1. Verify GPU access (very important)

Run this:

docker run --rm --gpus all nvidia/cuda:12.2.0-base-ubuntu22.04 nvidia-smi

Expected result:

You should see your GPU listed inside the container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions