Skip to content

Commit d1a6194

Browse files
committed
misc: Refactor Dockerfile.amd
1 parent 4f015eb commit d1a6194

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

docker/Dockerfile.amd

+12-8
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ ARG ROCM_VERSION
1111
ENV rocm=/opt/rocm-${ROCM_VERSION}
1212
ENV AOMP=/opt/rocm-${ROCM_VERSION}/llvm
1313

14+
# Bring in cmake3.19 apt repo
15+
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - && \
16+
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
17+
1418
# Some utils needed
15-
RUN apt-get update && apt-get install -y wget git autoconf dh-autoreconf flex python3-venv python3-dev vim libnuma1 tmux
19+
# * lmod required to source Omniperf via `module use`
20+
# * software-properties-common required to compile cmake3.19, which in turn is required to compile Omniperf
21+
RUN apt-get update && \
22+
apt-get install -y wget git autoconf dh-autoreconf \
23+
flex python3-venv python3-dev vim lmod \
24+
software-properties-common cmake libnuma1 tmux
1625

1726
# Install tmpi
1827
RUN curl https://raw.githubusercontent.com/Azrael3000/tmpi/master/tmpi -o /usr/local/bin/tmpi
@@ -51,20 +60,15 @@ RUN ./omnitrace-1.7.3-ubuntu-20.04-ROCm-50100-PAPI-OMPT-Python3.sh --prefix=/opt
5160
rm omnitrace-1.7.3-ubuntu-20.04-ROCm-50100-PAPI-OMPT-Python3.sh
5261

5362
# Install Omniperf, an AMDResearch profiling tool akin to Nvidia's Nsight-compute
54-
RUN apt-get update && apt-get install -y software-properties-common && \ # cmake3.19 required by Omniperf...
55-
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add - && \
56-
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
57-
apt-get update && \
58-
apt install -y -q cmake
59-
RUN apt-get update && apt-get install lmod # to eventually bring it in PATH via the entrypoint
6063
ENV OMNIPERF_DIR=/app/omniperf
6164
RUN wget https://github.com/AMDResearch/omniperf/releases/download/v1.0.4/omniperf-1.0.4.tar.gz -q
6265
RUN tar xfz omniperf-1.0.4.tar.gz && \
6366
cd omniperf-1.0.4/ && \
6467
/venv/bin/pip install --no-cache-dir -r requirements.txt && \
6568
mkdir build && cd build/ && \
6669
cmake -DCMAKE_INSTALL_PREFIX=${OMNIPERF_DIR}/1.0.4 -DPYTHON_DEPS=${OMNIPERF_DIR}/python-libs -DMOD_INSTALL_PATH=${OMNIPERF_DIR}/modulefiles .. && \
67-
make install
70+
make install && \
71+
rm -rf omniperf-1.0.4.tar.gz omniperf-1.0.4/
6872

6973
# Devito env
7074
ENV DEVITO_ARCH="aomp"

docker/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717

1818
if [[ -n "${ROCM_VERSION}" ]]; then
1919
echo "configuring Omnitrace..."
20-
source /opt/omnitrace/share/omnitrace/setup-env.sh
20+
module use /opt/omnitrace/share/modulefiles
2121
echo "configuring Omniperf..."
2222
module use /opt/omniperf/modulefiles
2323
module load omniperf

0 commit comments

Comments
 (0)