| # Copyright 2020 The IREE Authors | |
| # | |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. | |
| # See https://llvm.org/LICENSE.txt for license information. | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| # To use the host GPUs, `docker run` must be called with the `--gpus all` flag. | |
| # We use .deb files that we host because we have to pin the version exactly to | |
| # match the host machine and packages routinely dissapear from the Ubuntu | |
| # apt repositories. | |
| ARG NVIDIA_GL_DEB="libnvidia-gl-460_460.39-0ubuntu0.18.04.1_amd64.deb" | |
| ARG NVIDIA_COMPUTE_DEB="libnvidia-compute-460_460.39-0ubuntu0.18.04.1_amd64.deb" | |
| ARG NVIDIA_COMMON_DEB="libnvidia-common-460_460.39-0ubuntu0.18.04.1_all.deb" | |
| FROM gcr.io/iree-oss/util@sha256:40846b4aea5886af3250399d6adfdb3e1195a8b0177706bb0375e812d62dc49c AS fetch-nvidia | |
| ARG NVIDIA_COMMON_DEB | |
| ARG NVIDIA_GL_DEB | |
| ARG NVIDIA_COMPUTE_DEB | |
| WORKDIR /fetch-nvidia | |
| RUN wget -q "https://storage.googleapis.com/iree-shared-files/${NVIDIA_COMMON_DEB}" | |
| RUN wget -q "https://storage.googleapis.com/iree-shared-files/${NVIDIA_GL_DEB?}" | |
| RUN wget -q "https://storage.googleapis.com/iree-shared-files/${NVIDIA_COMPUTE_DEB}" | |
| # Set up the image and working directory by inheriting the vulkan CMake | |
| # configuration. | |
| # Note that we don't start from NVIDIA's docker base: | |
| # - nvidia/cuda (https://hub.docker.com/r/nvidia/cuda): | |
| # it's.. for CUDA. | |
| # - nvidia/vulkan (https://hub.docker.com/r/nvidia/vulkan): | |
| # does not support Ubuntu 18.04. | |
| # This allows to share configuration with base CMake, but it also means we need | |
| # to MATCH the driver version between the host machine and the docker image. | |
| FROM gcr.io/iree-oss/cmake-bazel-frontends-vulkan@sha256:e99fd07a48e2b1a00200b3b600ff00878d413045cb7809fe73dac4c36fa4825a AS final | |
| ARG NVIDIA_COMMON_DEB | |
| ARG NVIDIA_GL_DEB | |
| ARG NVIDIA_COMPUTE_DEB | |
| COPY --from=fetch-nvidia \ | |
| "/fetch-nvidia/${NVIDIA_COMMON_DEB}" \ | |
| "/fetch-nvidia/${NVIDIA_GL_DEB}" \ | |
| "/fetch-nvidia/${NVIDIA_COMPUTE_DEB}" \ | |
| /tmp/ | |
| RUN apt-get install "/tmp/${NVIDIA_COMMON_DEB?}" \ | |
| "/tmp/${NVIDIA_GL_DEB?}" \ | |
| "/tmp/${NVIDIA_COMPUTE_DEB?}" |