Skip to content

Commit

Permalink
feat: add cuda 12.4.1 support (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedir Zadniprovskyi committed Jan 26, 2025
1 parent 5809d79 commit 986ffbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:
fail-fast: false
matrix:
# https://hub.docker.com/r/nvidia/cuda/tags
base-image: ['nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04', 'ubuntu:24.04']
base-image: ['nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04', 'nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04', 'ubuntu:24.04']
include:
- base-image: nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04
tag-suffix: -cuda
- base-image: nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
tag-suffix: -cuda-12.4.1
- base-image: ubuntu:24.04
tag-suffix: -cpu
steps:
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ LABEL org.opencontainers.image.licenses="MIT"
# `ffmpeg` is installed because without it `gradio` won't work with mp3(possible others as well) files
# hadolint ignore=DL3008
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl ffmpeg python3.12 && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends curl ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# "ubuntu" is the default user on ubuntu images with UID=1000. This user is used for two reasons:
# 1. It's generally a good practice to run containers as non-root users. See https://www.docker.com/blog/understanding-the-docker-user-instruction/
# 2. Docker Spaces on HuggingFace don't support running containers as root. See https://huggingface.co/docs/hub/en/spaces-sdks-docker#permissions
# NOTE: the following command was added since nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 doesn't have the `ubuntu` user
RUN useradd --create-home --shell /bin/bash --uid 1000 ubuntu || true
USER ubuntu
ENV HOME=/home/ubuntu \
PATH=/home/ubuntu/.local/bin:$PATH
WORKDIR $HOME/speaches
# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
COPY --chown=ubuntu --from=ghcr.io/astral-sh/uv:0.5.18 /uv /bin/uv
# NOTE: per https://docs.astral.sh/uv/guides/install-python, `uv` will automatically install the necessary python version
# https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
# TODO: figure out if `/home/ubuntu/.cache/uv` should be used instead of `/root/.cache/uv`
Expand Down
3 changes: 2 additions & 1 deletion compose.cuda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ services:
extends:
file: compose.yaml
service: speaches
# NOTE: slightly older cuda version is available under 'latest-cuda-12.4.1' tag
image: ghcr.io/speaches-ai/speaches:latest-cuda
build:
args:
BASE_IMAGE: nvidia/cuda:12.6.2-cudnn-runtime-ubuntu24.04
BASE_IMAGE: nvidia/cuda:12.6.3-cudnn-runtime-ubuntu24.04
environment:
- WHISPER__MODEL=Systran/faster-whisper-large-v3
volumes:
Expand Down

0 comments on commit 986ffbb

Please sign in to comment.