Skip to content

Commit edb68fc

Browse files
authored
Adding cholla docker and baremetal build details (#27)
1 parent 02c1c6a commit edb68fc

File tree

6 files changed

+462
-2
lines changed

6 files changed

+462
-2
lines changed

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ For ROCm installation procedures and validation checks, see:
1616
## Applications:
1717
- [AMD Base Docker Container for GPU-Aware MPI in ROCm applications](/base-gpu-mpi-rocm-docker/)
1818
- [AMD's Implementation of Gromacs with HIP in Docker](/gromacs-docker/)
19+
- [Cholla](/cholla)
20+
- [Docker](/cholla/docker/)
21+
- [Bare Metal](/cholla/baremetal/)
1922
- [CP2K](/cp2k-docker/)
2023
- [HPCG in Docker](/hpcg-docker/)
2124
- [LAMMPS in Docker](/lammps-docker/)
@@ -24,6 +27,6 @@ For ROCm installation procedures and validation checks, see:
2427
- [PETSc in Docker](/petsc-docker/)
2528
- [PyFR in Docker](/pyfr-docker/)
2629
- [rocHPL](/rochpl/)
27-
- [docker](/rochpl/docker/)
28-
- [spack](/rochpl/spack/)
30+
- [Docker](/rochpl/docker/)
31+
- [Spack](/rochpl/spack/)
2932
- [Specfem3D - Cartesian](/specfem3d/)

cholla/README.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Cholla
2+
3+
## Overview
4+
Cholla is a static-mesh, GPU-native hydrodynamics simulation code that efficiently runs high-resolution simulations on massively-parallel computers. The code is written in a combination of C++, Cuda C, and HIP, and requires at least one AMD GPU to run.
5+
6+
Cholla (Computational Hydrodynamics On ParaLLel Architectures) is a 3D GPU-based hydrodynamics code (Schneider & Robertson, ApJS, 2015). Cholla is designed to be run using (AMD or NVIDIA) GPUs, and can be run in serial mode using one GPU or with MPI for multiple GPUs.
7+
8+
The source code is available on [github](https://github.com/cholla-hydro/cholla/). Cholla was designed for astrophysics simulations, and the current release includes the following physics:
9+
- compressible hydrodynamics in 1, 2, or 3 dimensions
10+
- optically-thin radiative cooling and photoionization heating, including the option to use the Grackle cooling library
11+
- static gravity with user-defined functions
12+
- FFT-based gas self-gravity
13+
- particle-mesh based particle gravity
14+
- cosmology
15+
- passive scalar tracking
16+
17+
Cholla can be run using a variety of different numerical algorithms, allowing users to test the sensitivity of their results to the exact code configuration. Options include:
18+
- Exact, Roe, and HLLC Riemann solvers
19+
- 2nd and 3rd order spatial reconstruction with limiting in either primitive or conserved variables
20+
- a second order Van Leer integrator
21+
22+
## Single-Node Server Requirements
23+
24+
| CPUs | GPUs | Operating Systems | ROCm™ Driver | Container Runtimes |
25+
| ---- | ---- | ----------------- | ------------ | ------------------ |
26+
| X86_64 CPU(s) | AMD Instinct MI200 GPU(s) <br> AMD Instinct MI100 GPU(s) <br> Radeon Instinct MI50(S) | Ubuntu 20.04 <br> Ubuntu 22.04 <BR> RHEL8 <br> RHEL9 <br> SLES 15 sp4 | ROCm v5.x compatibility |[Docker Engine](https://docs.docker.com/engine/install/) <br> [Singularity](https://sylabs.io/docs/) |
27+
28+
For ROCm installation procedures and validation checks, see:
29+
* [ROCm Documentation](https://rocm.docs.amd.com)
30+
* [AMD Lab Notes ROCm installation notes](https://github.com/amd/amd-lab-notes/tree/release/rocm-installation).
31+
* [ROCm Examples](https://github.com/amd/rocm-examples)
32+
33+
## Build Recipes
34+
- [Docker/Singularity Build](/cholla/docker/)
35+
- [Baremetal Build](/cholla/baremetal/)
36+
37+
## Running Cholla Benchmarks
38+
These examples are using the [Cholla Docker Build](/cholla/docker/), which build the binary file cholla.hydro.cholla-container based on environment variable `CHOLLA_MACHINE` set to `cholla-container` and was build/installed into `/opt/cholla`.
39+
40+
Cholla has many examples within the project, `/path/to/cholla/examples/`, find the benchmark that you wish to run in there, or provide your own workload.
41+
42+
You can run the examples using the command syntax below, where `#` is the number of GPUs to use and `<benchmark-to-run>` should be replaced with the full file path to the load details.
43+
44+
```
45+
mpirun -np # cholla.hydro.cholla-container <benchmark-to-run>
46+
```
47+
### Examples:
48+
* 4 GPU 3D sound wave<br>`mpirun -np 4 cholla.hydro.cholla-container /opt/cholla/examples/3D/sound_wave.txt`
49+
* 8 GPU 3D Sound wave<br>`mpirun -np 8 cholla.hydro.cholla-container /opt/cholla/examples/3D/sound_wave.txt`
50+
* 4 GPU 3D sod<br> `mpirun -np 4 cholla.hydro.cholla-container /opt/cholla/examples/3D/sod.txt`
51+
* 8 GPU 3D sod<br> `mpirun -np 8 cholla.hydro.cholla-container /opt/cholla/examples/3D/sod.txt`
52+
53+
Each MPI rank will bind to a particular unique GPU (1 rank per device) and strong-scale the problem accordingly. Please define `HIP_VISIBLE_DEVICES` to control which particular GPUs are available to Cholla.
54+
55+
56+
## Licensing Information
57+
Your access and use of this application is subject to the terms of the applicable component-level license identified below. To the extent any subcomponent in this container requires an offer for corresponding source code, AMD hereby makes such an offer for corresponding source code form, which will be made available upon request. By accessing and using this application, you are agreeing to fully comply with the terms of this license. If you do not agree to the terms of this license, do not access or use this application.
58+
59+
The application is provided in a container image format that includes the following separate and independent components:
60+
|Package | License | URL|
61+
|---|---|---|
62+
|Ubuntu| Creative Commons CC-BY-SA Version 3.0 UK License |[Ubuntu Legal](https://ubuntu.com/legal)|
63+
|CMAKE|OSI-approved BSD-3 clause|[CMake License](https://cmake.org/licensing/)|
64+
|OpenMPI|BSD 3-Clause|[OpenMPI License](https://www-lb.open-mpi.org/community/license.php)<br /> [OpenMPI Dependencies Licenses](https://docs.open-mpi.org/en/v5.0.x/license/index.html)|
65+
|OpenUCX|BSD 3-Clause|[OpenUCX License](https://openucx.org/license/)|
66+
|ROCm|Custom/MIT/Apache V2.0/UIUC OSL|[ROCm Licensing Terms](https://rocm.docs.amd.com/en/latest/release/licensing.html)|
67+
|Cholla|MIT|[Cholla](https://github.com/cholla-hydro/cholla)<br >[Cholla License](https://github.com/cholla-hydro/cholla/blob/main/LICENSE.txt)|
68+
|HDF5|BSD-like(CUSTOM)|[HDF5 License](https://github.com/HDFGroup/hdf5/blob/develop/COPYING)|
69+
70+
71+
Additional third-party content in this container may be subject to additional licenses and restrictions. The components are licensed to you directly by the party that owns the content pursuant to the license terms included with such content and is not licensed to you by AMD. ALL THIRD-PARTY CONTENT IS MADE AVAILABLE BY AMD “AS IS” WITHOUT A WARRANTY OF ANY KIND. USE OF SUCH THIRD-PARTY CONTENT IS DONE AT YOUR SOLE DISCRETION AND UNDER NO CIRCUMSTANCES WILL AMD BE LIABLE TO YOU FOR ANY THIRD-PARTY CONTENT. YOU ASSUME ALL RISK AND ARE SOLELY RESPONSIBLE FOR ANY DAMAGES THAT MAY ARISE FROM YOUR USE OF THIRD-PARTY CONTENT.
72+
73+
## Disclaimer
74+
The information contained herein is for informational purposes only, and is subject to change without notice. In addition, any stated support is planned and is also subject to change. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. No license, including implied or arising by estoppel, to any intellectual property rights is granted by this document. Terms and limitations applicable to the purchase or use of AMD’s products are as set forth in a signed agreement between the parties or in AMD's Standard Terms and Conditions of Sale.
75+
76+
## Notices and Attribution
77+
© 2022-2023 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo, Instinct, Radeon Instinct, ROCm, and combinations thereof are trademarks of Advanced Micro Devices, Inc.
78+
79+
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
80+
81+
All other trademarks and copyrights are property of their respective owners and are only mentioned for informative purposes.

cholla/baremetal/README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Cholla Bare Metal Build Instructions
2+
3+
## Overview
4+
This document provides instructions on how to do a bare metal install of Cholla in a Linux environment.
5+
6+
## Single-Node Server Requirements
7+
| CPUs | GPUs | Operating Systems | ROCm™ Driver |
8+
| ---- | ---- | ----------------- | ------------ |
9+
| X86_64 CPU(s) | AMD Instinct MI200 GPU(s) <br> AMD Instinct MI100 GPU(s) | Ubuntu 20.04 <br> Ubuntu 22.04 <BR> RHEL8 <br> RHEL9 <br> SLES 15 sp4 | ROCm v5.x compatibility |
10+
11+
For ROCm installation procedures and validation checks, see:
12+
* [ROCm Documentation](https://rocm.docs.amd.com)
13+
* [AMD Lab Notes ROCm installation notes](https://github.com/amd/amd-lab-notes/tree/release/rocm-installation).
14+
* [ROCm Examples](https://github.com/amd/rocm-examples)
15+
16+
### System Dependencies
17+
|Application|Minimum|Recommended|
18+
|---|---|---|
19+
|Git|Latest|Latest|
20+
|ROCm|5.3.0|5.4.2|
21+
|OpenMPI|4.0.3|4.1.5|
22+
|UCX|1.13.0|1.14.1|
23+
|HDF5|1.12.1|1.14.1|
24+
25+
### Installing Cholla
26+
27+
1. Validate the Cluster/System has all of the above applications, with system path, library, and include environments set correctly. If you are unsure, the [Dockerfile](/cholla/docker/Dockerfile) has examples of all useful configurations listed after the `ENV` commands.
28+
2. Clone the [Cholla GIT repo](https://github.com/cholla-hydro/cholla.git) into your workspace.
29+
```bash
30+
git clone -b CAAR --recursive https://github.com/cholla-hydro/cholla.git
31+
```
32+
3. Customize the host file for the Cluster. An example [make.host](/cholla/docker/make.host.cholla-container) file is available. The build will use the host name of the system or environment variable `CHOLLA_MACHINE` for build details.
33+
- Save a copy of the [make.host](/cholla/docker/make.host.cholla-container) in `/path/to/cholla/builds` to build and/or run benchmarks.
34+
- Rename it appropriately for the cluster/system to be built/run on.
35+
- Update `OMPI_ROOT`, `HDF5_ROOT` and `ROCM_PATH` in the make.host file to match your cluster.
36+
4. Building Cholla
37+
```bash
38+
cd /path/to/cholla
39+
make
40+
```
41+
5. (Optional) Adding Cholla to System Path
42+
After the build has completed a binary will be created at `cholla/bin/cholla.hydro.[hostname]`.
43+
This binary can be moved without causing linking issues and placed appropriately for your cluster.
44+
**Be sure to add the Binary to your PATH!**
45+
```bash
46+
PATH=$PATH:/path/to/cholla/bin
47+
```
48+
> Installation Recommendations:
49+
> - Use branch: `CAAR`
50+
> - Installing 'in place' can allow for ease of use and future updates.
51+
> - Example benchmark/workloads located in `cholla/examples`
52+
> - Adding clusters make.host.[host-name] file to `cholla/builds` for easy future builds.
53+
54+
## Licensing Information
55+
Your access and use of this application is subject to the terms of the applicable component-level license identified below. To the extent any subcomponent in this container requires an offer for corresponding source code, AMD hereby makes such an offer for corresponding source code form, which will be made available upon request. By accessing and using this application, you are agreeing to fully comply with the terms of this license. If you do not agree to the terms of this license, do not access or use this application.
56+
57+
The application is provided in a container image format that includes the following separate and independent components:
58+
|Package | License | URL|
59+
|---|---|---|
60+
|OpenMPI|BSD 3-Clause|[OpenMPI License](https://www-lb.open-mpi.org/community/license.php)<br /> [OpenMPI Dependencies Licenses](https://docs.open-mpi.org/en/v5.0.x/license/index.html)|
61+
|OpenUCX|BSD 3-Clause|[OpenUCX License](https://openucx.org/license/)|
62+
|ROCm|Custom/MIT/Apache V2.0/UIUC OSL|[ROCm Licensing Terms](https://rocm.docs.amd.com/en/latest/release/licensing.html)|
63+
|Cholla|MIT|[Cholla](https://github.com/cholla-hydro/cholla)<br >[Cholla License](https://github.com/cholla-hydro/cholla/blob/main/LICENSE.txt)|
64+
|HDF5|BSD-like(CUSTOM)|[HDF5 License](https://github.com/HDFGroup/hdf5/blob/develop/COPYING)|
65+
66+
Additional third-party content in this container may be subject to additional licenses and restrictions. The components are licensed to you directly by the party that owns the content pursuant to the license terms included with such content and is not licensed to you by AMD. ALL THIRD-PARTY CONTENT IS MADE AVAILABLE BY AMD “AS IS” WITHOUT A WARRANTY OF ANY KIND. USE OF SUCH THIRD-PARTY CONTENT IS DONE AT YOUR SOLE DISCRETION AND UNDER NO CIRCUMSTANCES WILL AMD BE LIABLE TO YOU FOR ANY THIRD-PARTY CONTENT. YOU ASSUME ALL RISK AND ARE SOLELY RESPONSIBLE FOR ANY DAMAGES THAT MAY ARISE FROM YOUR USE OF THIRD-PARTY CONTENT.
67+
68+
## Disclaimer
69+
The information contained herein is for informational purposes only, and is subject to change without notice. In addition, any stated support is planned and is also subject to change. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. No license, including implied or arising by estoppel, to any intellectual property rights is granted by this document. Terms and limitations applicable to the purchase or use of AMD’s products are as set forth in a signed agreement between the parties or in AMD's Standard Terms and Conditions of Sale.
70+
71+
## Notices and Attribution
72+
© 2022-2023 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo, Instinct, Radeon Instinct, ROCm, and combinations thereof are trademarks of Advanced Micro Devices, Inc.
73+
74+
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
75+
76+
All other trademarks and copyrights are property of their respective owners and are only mentioned for informative purposes.

cholla/docker/Dockerfile

+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
ARG IMAGE="rocm/dev-ubuntu-22.04:5.4.2"
2+
3+
FROM ${IMAGE}
4+
5+
ARG CHOLLA_BRANCH="CAAR"
6+
ARG UCX_BRANCH="v1.14.1"
7+
ARG OMPI_BRANCH="v4.1.5"
8+
ARG HDF5_BRANCH="hdf5-1_14_1"
9+
10+
# Update and Install basic Linux development tools
11+
RUN rm /etc/apt/sources.list.d/* \
12+
&& apt-get update \
13+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
14+
ca-certificates \
15+
git \
16+
ssh \
17+
make \
18+
vim \
19+
nano \
20+
libtinfo* \
21+
initramfs-tools \
22+
libelf-dev \
23+
numactl \
24+
curl \
25+
wget \
26+
tmux \
27+
build-essential \
28+
autoconf \
29+
automake \
30+
libtool \
31+
pkg-config \
32+
libnuma* \
33+
gfortran \
34+
flex \
35+
hwloc \
36+
&& apt-get clean \
37+
&& ln -s /opt/rocm/llvm/bin/offload-arch /opt/rocm/bin/offload-arch
38+
39+
# Requires cmake > 3.22
40+
RUN mkdir -p /opt/cmake \
41+
&& wget --no-check-certificate --quiet -O - https://cmake.org/files/v3.22/cmake-3.22.2-linux-x86_64.tar.gz | tar --strip-components=1 -xz -C /opt/cmake
42+
43+
ENV ROCM_PATH=/opt/rocm \
44+
UCX_PATH=/opt/ucx \
45+
OMPI_PATH=/opt/ompi
46+
47+
# Adding rocm/cmake to the Environment
48+
ENV PATH=$ROCM_PATH/bin:$ROCM_PATH/profiler/bin:$ROCM_PATH/opencl/bin:/opt/cmake/bin:$PATH \
49+
LD_LIBRARY_PATH=$ROCM_PATH/lib:$ROCM_PATH/lib64:$ROCM_PATH/llvm/lib:$LD_LIBRARY_PATH \
50+
LIBRARY_PATH=$ROCM_PATH/lib:$ROCM_PATH/lib64:$LIBRARY_PATH \
51+
C_INCLUDE_PATH=$ROCM_PATH/include:$C_INCLUDE_PATH \
52+
CPLUS_INCLUDE_PATH=$ROCM_PATH/include:$CPLUS_INCLUDE_PATH \
53+
CPATH=$ROCM_PATH/include:$CPATH \
54+
INCLUDE=$ROCM_PATH/include:$INCLUDE
55+
56+
WORKDIR /tmp
57+
58+
# Install UCX
59+
RUN cd /tmp/ \
60+
&& git clone https://github.com/openucx/ucx.git -b ${UCX_BRANCH} \
61+
&& cd ucx \
62+
&& ./autogen.sh \
63+
&& mkdir build \
64+
&& cd build \
65+
&& ../contrib/configure-release --prefix=$UCX_PATH \
66+
--with-rocm=$ROCM_PATH \
67+
--without-knem \
68+
--without-xpmem \
69+
--without-cuda \
70+
--enable-optimizations \
71+
--disable-logging \
72+
--disable-debug \
73+
--disable-examples \
74+
&& make -j $(nproc) \
75+
&& make install \
76+
&& cd .. \
77+
&& rm -rf ucx
78+
79+
# Install OpenMPI
80+
RUN cd /tmp \
81+
&& git clone --recursive https://github.com/open-mpi/ompi.git -b ${OMPI_BRANCH} \
82+
&& cd ompi \
83+
&& ./autogen.pl \
84+
&& mkdir build \
85+
&& cd build \
86+
&& ../configure --prefix=$OMPI_PATH --with-ucx=$UCX_PATH \
87+
--enable-mca-no-build=btl-uct \
88+
--without-verbs \
89+
--with-pmix=internal \
90+
--enable-mpi \
91+
--enable-mpi-fortran=yes \
92+
--disable-man-pages \
93+
--disable-debug \
94+
&& make -j $(nproc) \
95+
&& make install \
96+
&& cd .. \
97+
&& rm -rf ompi
98+
99+
# Adding OpenMPI and UCX to Environment
100+
ENV PATH=$OMPI_PATH/bin:$UCX_PATH/bin:$PATH \
101+
LD_LIBRARY_PATH=$OMPI_PATH/lib:$UCX_PATH/lib:$LD_LIBRARY_PATH \
102+
LIBRARY_PATH=$OMPI_PATH/lib:$UCX_PATH/lib:$LIBRARY_PATH \
103+
C_INCLUDE_PATH=$OMPI_PATH/include:$UCX_PATH/include:$C_INCLUDE_PATH \
104+
CPLUS_INCLUDE_PATH=$OMPI_PATH/include:$UCX_PATH/include:$CPLUS_INCLUDE_PATH \
105+
CPATH=$OMPI_PATH/include:$UCX_PATH/include:$CPATH \
106+
INCLUDE=$OMPI_PATH/include:$UCX_PATH/include:$INCLUDE \
107+
PKG_CONFIG_PATH=$OMPI_PATH/lib/pkgconfig:$UCX_PATH/lib/pkgconfig:$PKG_CONFIG_PATH \
108+
HDF5_HOME=/opt/hdf5
109+
110+
111+
112+
#Installing HDF5 download here: https://www.hdfgroup.org/downloads/hdf5/source-code/
113+
114+
RUN cd /tmp \
115+
&& git clone --recursive https://github.com/HDFGroup/hdf5.git -b ${HDF5_BRANCH} \
116+
&& cd hdf5 \
117+
&& CC=mpicc \
118+
./configure --prefix=$HDF5_HOME --enable-parallel \
119+
&& make -j 16 \
120+
&& make install \
121+
&& cd /tmp \
122+
&& rm -rf hdf5
123+
124+
125+
ENV PATH=$HDF5_HOME/bin:$PATH \
126+
LD_LIBRARY_PATH=$HDF5_HOME/lib:$LD_LIBRARY_PATH \
127+
LIBRARY_PATH=$HDF5_HOME/lib:$LIBRARY_PATH \
128+
C_INCLUDE_PATH=$HDF5_HOME/include:$C_INCLUDE_PATH \
129+
CPLUS_INCLUDE_PATH=$HDF5_HOME/include:$CPLUS_INCLUDE_PATH \
130+
CPATH=$HDF5_HOME/include:$CPATH \
131+
INCLUDE=$HDF5_HOME/include:$INCLUDE \
132+
PKG_CONFIG_PATH=$HDF5_HOME/lib/pkgconfig:$PKG_CONFIG_PATH \
133+
CHOLLA_MACHINE='cholla-container'
134+
135+
COPY ./make.host.cholla-container /tmp/.
136+
137+
RUN cd /opt \
138+
&& git clone --recursive https://github.com/cholla-hydro/cholla.git -b ${CHOLLA_BRANCH} \
139+
&& cp /tmp/make.host.cholla-container /opt/cholla/builds \
140+
&& cd cholla \
141+
&& make \
142+
&& mkdir /benchmark \
143+
&& chmod -R 777 /benchmark
144+
145+
WORKDIR /benchmark
146+
147+
# Adding environment variable for Running as ROOT and set MCA pml to UCX
148+
ENV PATH=$PATH:/opt/cholla/bin \
149+
OMPI_ALLOW_RUN_AS_ROOT=1 \
150+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
151+
OMPI_MCA_pml=ucx \
152+
UCX_WARN_UNUSED_ENV_VARS=n
153+
154+
CMD ["/bin/bash"]
155+

0 commit comments

Comments
 (0)