Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cuda 12.4.1 support #282

Merged
merged 2 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ markers = [

[tool.uv]
constraint-dependencies = ["llvmlite>=0.40.0"]
# TODO: create an issue on https://github.com/thewh1teagle/kokoro-onnx regarding this
override-dependencies = ["onnxruntime-gpu>=1.20.1 ; platform_machine == 'x86_64'"]

[tool.uv.sources]
piper-phonemize = { url = "https://github.com/fedirz/piper-phonemize/raw/refs/heads/master/dist/piper_phonemize-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl" }
Expand Down
3 changes: 2 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading