diff --git a/.github/workflows/build-and-push-to-docker.yml b/.github/workflows/build-and-push-to-docker.yml index f6e1feda..58e2be97 100644 --- a/.github/workflows/build-and-push-to-docker.yml +++ b/.github/workflows/build-and-push-to-docker.yml @@ -193,8 +193,12 @@ jobs: CUDA_CUDART_PACKAGE: "cuda-cudart-11-7=11.7.60-1" CUDA_COMPAT_PACKAGE: "cuda-compat-11-7" LIBCUDNN_PACKAGE: "libcudnn8=8.5.0.96-1+cuda11.7" - # note cuda 11.8 is available now, but there I could not - # find a cuda-compat package in the ubuntu repos at this time + - CUDA_VERSION: "11.8" + EXTRA_LIBRARIES: "" + CUDA_CUDART_PACKAGE: "cuda-cudart-11-8=11.8.89-1" + CUDA_COMPAT_PACKAGE: "cuda-compat-11-8" + LIBCUDNN_PACKAGE: "libcudnn8=8.6.0.163-1+cuda11.8" + ADD_2204_APT_REPOS: "true" steps: - name: Docker Login uses: Azure/docker-login@v1 @@ -229,6 +233,7 @@ jobs: CUDA_VERSION=${{ matrix.CUDA_VERSION }} EXTRA_LIBRARIES=${{ matrix.EXTRA_LIBRARIES }} LIBCUDNN_PACKAGE=${{ matrix.LIBCUDNN_PACKAGE }} + ADD_2204_APT_REPOS=${{ matrix.ADD_2204_APT_REPOS }} context: docker/cuda labels: ${{ steps.meta.outputs.labels }} load: true diff --git a/docker/cuda/Dockerfile b/docker/cuda/Dockerfile index f3020ba2..bb6dd05e 100644 --- a/docker/cuda/Dockerfile +++ b/docker/cuda/Dockerfile @@ -14,6 +14,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list && \ apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub && \ apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \ + if [[ -z "${ADD_2204_APT_REPOS}" ]] ; \ + then echo "Not adding 22.04 CUDA repos." ; \ + else \ + curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub | apt-key add - && \ + echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \ + apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub ; \ + fi && \ apt-get purge --autoremove -y curl \ && rm -rf /var/lib/apt/lists/* @@ -77,9 +84,13 @@ ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD # Link the libcuda stub to the location where tensorflow is searching for it and reconfigure # dynamic linker run-time bindings -RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \ +RUN if [[ -d /usr/local/cuda/lib64/stubs ]] ; \ + then ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 \ && echo "/usr/local/cuda/lib64/stubs" > /etc/ld.so.conf.d/z-cuda-stubs.conf \ - && ldconfig + && ldconfig ; \ + else \ + echo "libcuda stubs folder does not exist, skipping linking" ; \ + fi # See http://bugs.python.org/issue19846 ENV LANG C.UTF-8