From 7c736f276ea479dfa2c5a2e8ba409c2d6772964b Mon Sep 17 00:00:00 2001 From: Thai Nguyen Date: Sat, 7 Dec 2024 15:57:53 +0700 Subject: [PATCH] Install CUDA toolkit in docker image --- .github/workflows/gcp_models.yml | 4 ++++ backend/modal/Dockerfile | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gcp_models.yml b/.github/workflows/gcp_models.yml index 23e42b3f2..0e7328c5f 100644 --- a/.github/workflows/gcp_models.yml +++ b/.github/workflows/gcp_models.yml @@ -23,6 +23,10 @@ jobs: runs-on: ubuntu-latest steps: + # To workaround "no space left on device" issue of GitHub-hosted runner + - name: Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + - name: Checkout uses: actions/checkout@v4 diff --git a/backend/modal/Dockerfile b/backend/modal/Dockerfile index 0a6314cb4..985639c70 100644 --- a/backend/modal/Dockerfile +++ b/backend/modal/Dockerfile @@ -11,7 +11,14 @@ FROM python:3.11-slim WORKDIR /app ENV PATH="/opt/venv/bin:$PATH" -RUN apt-get update && apt-get -y install ffmpeg curl unzip && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get -y install build-essential ffmpeg curl unzip wget software-properties-common && \ +wget https://developer.download.nvidia.com/compute/cuda/12.6.3/local_installers/cuda-repo-debian11-12-6-local_12.6.3-560.35.05-1_amd64.deb && \ +dpkg -i cuda-repo-debian11-12-6-local_12.6.3-560.35.05-1_amd64.deb && \ +cp /var/cuda-repo-debian11-12-6-local/cuda-*-keyring.gpg /usr/share/keyrings/ && \ +add-apt-repository contrib && \ +apt-get update && \ +apt-get -y install cuda-toolkit-12-6 && \ +rm -rf /var/lib/apt/lists/* cuda-repo-debian11-12-6-local_12.6.3-560.35.05-1_amd64.deb COPY --from=builder /opt/venv /opt/venv COPY backend/modal/ .