Skip to content

Commit

Permalink
factor out whisper CUDA 11.8 in a separate image
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijffels committed May 22, 2024
1 parent 6e48efd commit 6a59e5e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ jobs:
runs-on: ubuntu-latest

strategy:
max-parallel: 1
matrix:
config:
- { tag: "whisper-base", dockerfile: "whisper/Dockerfile", context: "whisper"}
- { tag: "whisper-base", dockerfile: "whisper/Dockerfile", context: "whisper"}
- { tag: "whisper-base-cuda-11-8", dockerfile: "whisper/Dockerfile.cuda", context: "whisper"}

steps:
- name: Clone
Expand Down
28 changes: 14 additions & 14 deletions whisper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

## Install CUDA in case the hardware is a GPU - use CUDA 11-8 to be able to run Silero VAD with torch
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common dirmngr \
&& dpkg -i cuda-keyring_1.1-1_all.deb \
&& rm cuda-keyring_1.1-1_all.deb \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y nvidia-gds cuda-11-8 cuda-toolkit-11-8 cuda-drivers \
&& apt-get autoremove -y --quiet \
&& apt-get clean --quiet \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
ENV CUDA_PATH=/usr/local/cuda-11.8
ENV CUDA=11.8
#RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
# && apt-get update \
# && apt-get install -y --no-install-recommends software-properties-common dirmngr \
# && dpkg -i cuda-keyring_1.1-1_all.deb \
# && rm cuda-keyring_1.1-1_all.deb \
# && apt-get update \
# && DEBIAN_FRONTEND=noninteractive apt-get install -y nvidia-gds cuda-11-8 cuda-toolkit-11-8 cuda-drivers \
# && apt-get autoremove -y --quiet \
# && apt-get clean --quiet \
# && rm -rf /var/lib/apt/lists/*
#ENV PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
#ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
#ENV CUDA_PATH=/usr/local/cuda-11.8
#ENV CUDA=11.8

## General R packages
RUN apt-get update \
Expand Down
22 changes: 22 additions & 0 deletions whisper/Dockerfile.cuda
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ghcr.io/bnosac/whisper-base:latest
LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.vendor="BNOSAC" \
org.opencontainers.image.authors="Jan Wijffels <[email protected]>"

## Install CUDA in case the hardware is a GPU - use CUDA 11-8 to be able to run Silero VAD with torch
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb \
&& apt-get update \
&& apt-get install -y --no-install-recommends software-properties-common dirmngr \
&& dpkg -i cuda-keyring_1.1-1_all.deb \
&& rm cuda-keyring_1.1-1_all.deb \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y nvidia-gds cuda-11-8 cuda-toolkit-11-8 cuda-drivers \
&& apt-get autoremove -y --quiet \
&& apt-get clean --quiet \
&& rm -rf /var/lib/apt/lists/*
ENV PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}}
ENV LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
ENV CUDA_PATH=/usr/local/cuda-11.8
ENV CUDA=11.8

RUN R -e "torch::install_torch(reinstall = TRUE)"

0 comments on commit 6a59e5e

Please sign in to comment.