Skip to content

Commit

Permalink
#2075: Update nvidia docker to use official image
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable authored and cz4rs committed Mar 27, 2023
1 parent 29884f8 commit d5cea30
Showing 1 changed file with 5 additions and 34 deletions.
39 changes: 5 additions & 34 deletions ci/docker/ubuntu-nvidia-cpp.dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

ARG cuda=10.1
ARG compiler=11.0.3
ARG arch=amd64
FROM ${arch}/ubuntu:18.04 as base
# Works with 18.04, 20.04 and 22.04
ARG ubuntu=18.04
FROM --platform=${arch} nvidia/cuda:${compiler}-devel-ubuntu${ubuntu} as base

ARG proxy=""
ARG compiler=nvcc-11

ENV https_proxy=${proxy} \
http_proxy=${proxy}

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y -q && \
apt-get install -y -q --no-install-recommends \
apt-get install -y --no-install-recommends \
ca-certificates \
g++-7 \
curl \
less \
git \
Expand All @@ -31,32 +31,6 @@ RUN apt-get update -y -q && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN if test ${compiler} = "nvcc-11"; then \
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin && \
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
wget http://developer.download.nvidia.com/compute/cuda/11.0.1/local_installers/cuda-repo-ubuntu1804-11-0-local_11.0.1-450.36.06-1_amd64.deb && \
dpkg -i cuda-repo-ubuntu1804-11-0-local_11.0.1-450.36.06-1_amd64.deb && \
apt-key add /var/cuda-repo-ubuntu1804-11-0-local/7fa2af80.pub && \
apt-get update && \
apt-get -y install cuda-nvcc-11-0 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf cuda-repo-ubuntu1804-11-0-local_11.0.1-450.36.06-1_amd64.deb && \
ln -s /usr/local/cuda-11.0 /usr/local/cuda-versioned; \
else \
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin && \
mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda-repo-ubuntu1804-11-2-local_11.2.0-460.27.04-1_amd64.deb && \
dpkg -i cuda-repo-ubuntu1804-11-2-local_11.2.0-460.27.04-1_amd64.deb && \
apt-key add /var/cuda-repo-ubuntu1804-11-2-local/7fa2af80.pub && \
apt-get update && \
apt-get -y install cuda-nvcc-11-2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf cuda-repo-ubuntu1804-11-2-local_11.2.0-460.27.04-1_amd64.deb && \
ln -s /usr/local/cuda-11.2 /usr/local/cuda-versioned; \
fi

ENV CC=gcc \
CXX=g++

Expand All @@ -69,9 +43,6 @@ ENV LESSCHARSET=utf-8
COPY ./ci/deps/mpich.sh mpich.sh
RUN ./mpich.sh 3.3.2 -j4

ENV CUDACXX=/usr/local/cuda-versioned/bin/nvcc
ENV PATH=/usr/local/cuda-versioned/bin/:$PATH

RUN mkdir -p /nvcc_wrapper/build && \
wget https://raw.githubusercontent.com/kokkos/kokkos/master/bin/nvcc_wrapper -P /nvcc_wrapper/build && \
chmod +x /nvcc_wrapper/build/nvcc_wrapper
Expand Down

0 comments on commit d5cea30

Please sign in to comment.