Skip to content

Commit efa64d6

Browse files
committed
misc: Add Omniperf to Dockerfile.amd
1 parent 39e3a3c commit efa64d6

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

docker/Dockerfile.amd

+19-8
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,26 @@ ENV PATH=${PATH}:/opt/openmpi/bin:$AOMP/bin
4545
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/openmpi/lib:$AOMP/lib
4646
ENV OMPI_CC=$AOMP/bin/clang
4747

48-
# Install Omnitrace, an AMDResearch profiling tool which is de facto the best profiler from AMD
48+
# Install Omnitrace, an AMDResearch profiling tool akin to Nvidia's Nsight-systems
4949
RUN wget https://github.com/AMDResearch/omnitrace/releases/download/v1.7.3/omnitrace-1.7.3-ubuntu-20.04-ROCm-50100-PAPI-OMPT-Python3.sh -q
50-
RUN mv omnitrace-1.7.3-ubuntu-20.04-ROCm-50100-PAPI-OMPT-Python3.sh omnitrace-installer.sh && \
51-
chmod +x omnitrace-installer.sh && \
52-
mkdir -p /opt/omnitrace && \
53-
mv omnitrace-installer.sh /opt/omnitrace && \
54-
cd /opt/omnitrace && \
55-
./omnitrace-installer.sh --skip-license && \
56-
cd -
50+
RUN ./omnitrace-1.7.3-ubuntu-20.04-ROCm-50100-PAPI-OMPT-Python3.sh --prefix=/opt/omnitrace --exclude-subdir --skip-license && \
51+
rm omnitrace-1.7.3-ubuntu-20.04-ROCm-50100-PAPI-OMPT-Python3.sh
52+
53+
# 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
60+
ENV OMNIPERF_DIR=/app/omniperf
61+
RUN wget https://github.com/AMDResearch/omniperf/releases/download/v1.0.4/omniperf-1.0.4.tar.gz -q
62+
RUN tar xfz omniperf-1.0.4.tar.gz && \
63+
cd omniperf-1.0.4/ && \
64+
/venv/bin/pip install --no-cache-dir -t ${OMNIPERF_DIR}/python-libs -r requirements.txt && \
65+
mkdir build && cd build/ && \
66+
cmake -DCMAKE_INSTALL_PREFIX=${OMNIPERF_DIR}/1.0.4 -DPYTHON_DEPS=${OMNIPERF_DIR}/python-libs -DMOD_INSTALL_PATH=${OMNIPERF_DIR}/modulefiles .. && \
67+
make install
5768

5869
# Devito env
5970
ENV DEVITO_ARCH="aomp"

docker/entrypoint.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ else
1818
fi
1919

2020
if [[ -n "${ROCM_VERSION}" ]]; then
21-
echo "sourcing Omnitrace"
21+
echo "configuring Omnitrace..."
2222
source /opt/omnitrace/share/omnitrace/setup-env.sh
23+
echo "configuring Omniperf..."
24+
module use /opt/omniperf/modulefiles
25+
module load omniperf
2326
fi

0 commit comments

Comments
 (0)