From 6a59e5efc787dac07c79963baec3e90680d31edd Mon Sep 17 00:00:00 2001 From: Jan Wijffels Date: Wed, 22 May 2024 22:08:38 +0200 Subject: [PATCH] factor out whisper CUDA 11.8 in a separate image --- .github/workflows/build.yml | 4 +++- whisper/Dockerfile | 28 ++++++++++++++-------------- whisper/Dockerfile.cuda | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 whisper/Dockerfile.cuda diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3827e9..bb01bf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/whisper/Dockerfile b/whisper/Dockerfile index e96dbea..ca2df11 100644 --- a/whisper/Dockerfile +++ b/whisper/Dockerfile @@ -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 \ diff --git a/whisper/Dockerfile.cuda b/whisper/Dockerfile.cuda new file mode 100644 index 0000000..161496d --- /dev/null +++ b/whisper/Dockerfile.cuda @@ -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 " + +## 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)"