Matthew Poremba has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/59051 )

Change subject: util: Add dockerfile for building GPUFS application
......................................................................

util: Add dockerfile for building GPUFS application

In order to compile binaries to run in GPUFS, users would either have to
install ROCm 4.2 locally, use something like docker, or build within
gem5 using KVM and copy the binary out. The simplest way of those is to
use docker. This minimal dockerfile contains only ROCm 4.2 and can build
binaries that will be placed on the host which can be run in gem5.

For example, current gem5-resources can be built for gem5 as follows:

cd util/dockerfiles/gpu-fs
docker build -t rocm42-build .
cd /path/to/gem5-resources/src/gpu/hip-samples
docker run --rm -u $UID:$GID -v ${PWD}:${PWD} \
    -w ${PWD} rocm42-build make

Those binaries can then be run in gem5 using the
configs/example/gpufs/vega10_kvm.py script:

build/VEGA_X86/gem5.opt configs/example/gpufs/vega10_kvm.py --app \
    /path/to/gem5-resources/src/gpu/hip-samples/bin/MatrixTranspose

Change-Id: Ie76146be0ccf6fcc1941322cacc15965fe70073a
---
A util/dockerfiles/gpu-fs/Dockerfile
1 file changed, 85 insertions(+), 0 deletions(-)



diff --git a/util/dockerfiles/gpu-fs/Dockerfile b/util/dockerfiles/gpu-fs/Dockerfile
new file mode 100644
index 0000000..eae6b76
--- /dev/null
+++ b/util/dockerfiles/gpu-fs/Dockerfile
@@ -0,0 +1,56 @@
+# Copyright (c) 2022 Advanced Micro Devices, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its
+# contributors may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+FROM ubuntu:20.04
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt -y update
+RUN apt -y upgrade
+RUN apt -y install build-essential git m4 scons zlib1g zlib1g-dev \
+ libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev \
+    python3-dev python-is-python3 doxygen libboost-all-dev \
+    libhdf5-serial-dev python3-pydot libpng-dev libelf-dev pkg-config
+
+# Requirements for ROCm
+RUN apt -y install cmake mesa-common-dev libgflags-dev libgoogle-glog-dev
+
+# Needed to get ROCm repo, build packages
+RUN apt -y install wget gnupg2 rpm
+
+# Get the radeon gpg key for apt repository
+RUN wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add -
+
+# Modify apt sources to pull from ROCm 4.2 repository only
+RUN echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/4.2/ ubuntu main' | tee /etc/apt/sources.list.d/rocm.list
+
+RUN apt-get update
+RUN apt -y install libnuma-dev
+
+# Install the ROCm-dkms source
+RUN apt -y install initramfs-tools
+RUN apt -y install rocm-dkms

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/59051
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie76146be0ccf6fcc1941322cacc15965fe70073a
Gerrit-Change-Number: 59051
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to