Skip to content

Commit

Permalink
Merge pull request #2076 from DARMA-tasking/2075-improve-dockerfile-f…
Browse files Browse the repository at this point in the history
…or-cuda

#2075: Update nvidia docker to use official image
  • Loading branch information
lifflander authored Mar 7, 2023
2 parents 893ca59 + 34003d1 commit 64d3700
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 44 deletions.
4 changes: 2 additions & 2 deletions ci/azure/azure-nvidia-11-2-ubuntu-mpich.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ variables:
tag: '$(Build.BuildId)'
REPO: lifflander1/vt
ARCH: amd64
UBUNTU: 18.04
UBUNTU: 20.04
COMPILER_TYPE: nvidia
COMPILER: nvcc-11.2
COMPILER: 11.2.0
BUILD_TYPE: release
ULIMIT_CORE: 0
CODE_COVERAGE: 0
Expand Down
4 changes: 2 additions & 2 deletions ci/azure/azure-nvidia-11-ubuntu-mpich.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ variables:
tag: '$(Build.BuildId)'
REPO: lifflander1/vt
ARCH: amd64
UBUNTU: 18.04
UBUNTU: 20.04
COMPILER_TYPE: nvidia
COMPILER: nvcc-11
COMPILER: 11.0.3
BUILD_TYPE: release
ULIMIT_CORE: 0
CODE_COVERAGE: 0
Expand Down
43 changes: 7 additions & 36 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 20.04 and 22.04
ARG ubuntu=20.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,16 +43,13 @@ 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

ENV MPI_EXTRA_FLAGS="" \
CXX=/nvcc_wrapper/build/nvcc_wrapper \
PATH=/usr/lib/ccache/:$PATH
PATH=/usr/lib/ccache/:/nvcc_wrapper/build:$PATH \
CXX=nvcc_wrapper

FROM base as build
COPY . /vt
Expand Down
8 changes: 4 additions & 4 deletions scripts/workflows-azure.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ vt_extended_tests = 0
[PR-tests-nvcc-11-0]
test_configuration = "nvidia cuda 11.0, ubuntu, mpich"
compiler_type = nvidia
compiler = nvcc-11
distro = 18.04
compiler = 11.0.3
distro = 20.04
cache_name = ubuntu-nvidia-11-cache
output_name = ci/azure/azure-nvidia-11-ubuntu-mpich.yml
vt_extended_tests = 0
Expand All @@ -77,8 +77,8 @@ vt_tests_num_nodes = 4
[PR-tests-nvcc-11-2]
test_configuration = "nvidia cuda 11.2, ubuntu, mpich"
compiler_type = nvidia
compiler = nvcc-11.2
distro = 18.04
compiler = 11.2.0
distro = 20.04
cache_name = ubuntu-nvidia-11.2-cache
output_name = ci/azure/azure-nvidia-11-2-ubuntu-mpich.yml
vt_extended_tests = 0
Expand Down

0 comments on commit 64d3700

Please sign in to comment.