-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.Ubuntu20.04
More file actions
87 lines (72 loc) · 3.38 KB
/
Dockerfile.Ubuntu20.04
File metadata and controls
87 lines (72 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Part of the examples from the Parallel and High Performance Computing
# Robey and Zamora, Manning Publications
# https://github.com/EssentialsofParallelComputing/Chapter5
#
# The built image can be found at:
#
# https://hub.docker.com/r/essentialsofparallelcomputing/chapter5
#
# Author:
# Bob Robey <brobey@earthlink.net>
FROM ubuntu:20.04 AS builder
LABEL maintainer Bob Robey <brobey@earthlink.net>
ARG DOCKER_LANG=en_US
ARG DOCKER_TIMEZONE=America/Denver
WORKDIR /tmp
RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qq install -y cmake git vim gcc g++ gfortran software-properties-common \
wget gnupg-agent libglu1-mesa-dev freeglut3-dev mesa-common-dev cmake \
imagemagick libmagickwand-dev libnuma1 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Installing latest GCC compiler (version 10)
RUN apt-get -qq update && \
apt-get -qq install -y gcc-8 g++-8 gfortran-8 \
gcc-10 g++-10 gfortran-10 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Problem with compile of compact hash neighbor with gcc-10
RUN update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-8 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-8 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-8 && \
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 80 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 && \
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-10 70 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 && \
chmod u+s /usr/bin/update-alternatives
# Nvidia GPU software for computation
# See https://docs.nvidia.com/hpc-sdk/index.html for Nvidia install instructions
RUN wget --no-verbose https://developer.download.nvidia.com/hpc-sdk/20.9/nvhpc-20-9_20.9_amd64.deb
RUN wget --no-verbose https://developer.download.nvidia.com/hpc-sdk/20.9/nvhpc-2020_20.9_amd64.deb
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -y ./nvhpc-20-9_20.9_amd64.deb ./nvhpc-2020_20.9_amd64.deb && \
apt-get clean && rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-c"]
#RUN groupadd -r chapter13 && useradd -r -s /bin/false -g chapter13 chapter13
RUN groupadd -r chapter13 && useradd -m -s /bin/bash -g chapter13 chapter13
RUN usermod -a -G video chapter13
WORKDIR /home/chapter13
RUN chown -R chapter13:chapter13 /home/chapter13
USER chapter13
ENV LANG='en_US.UTF-8'
ENV DISPLAY=:0
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=display,graphics,utility,compute
#ENV NVIDIA_DRIVER_CAPABILITIES all
ENV NVARCH=Linux_x86_64
ENV NVCOMPILERS=/opt/nvidia/hpc_sdk
ENV MANPATH=$MANPATH:$NVCOMPILERS/$NVARCH/20.9/compilers/man
ENV PATH=$NVCOMPILERS/$NVARCH/20.9/compilers/bin:$PATH
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${NVCOMPILERS}/${NVARCH}/20.9/cuda/11.0/extras/CUPTI/lib64
ENV CC=pgcc
RUN git clone --recursive https://github.com/essentialsofparallelcomputing/Chapter13.git
WORKDIR /home/chapter13/Chapter13
#RUN make
ENTRYPOINT ["bash"]