diff --git a/CMakeLists.txt b/CMakeLists.txt index 50aeeb7541..a3a23d5941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ include(ROCMCheckTargetIds) ############################################################################### rocm_setup_version(VERSION 2.0.0) -project(rocshmem CXX) +project(rocshmem VERSION 2.0.0 LANGUAGES CXX) ############################################################################### # SET GPU ARCHITECTURES @@ -250,6 +250,8 @@ rocm_package_add_dependencies( hsa-rocr "hip-runtime-amd >= 6.2.2" "rocm-dev >= 6.2.2" + "openmpi >= 5.0.6" + "ucx >= 1.17.0" ) rocm_create_package( diff --git a/README.md b/README.md index eea481f414..1dfeb0b0d7 100644 --- a/README.md +++ b/README.md @@ -164,5 +164,13 @@ make -j 8 make -j 8 install ``` +Alternatively, we have script to install dependencies. +However, it is not gauranteed to work and perform optimally on all platforms. +Configuration options are platform dependent. + +``` +./scripts/install_dependencies.sh +``` + For more information on OpenMPI-UCX support, please visit: https://rocm.docs.amd.com/en/latest/how-to/gpu-enabled-mpi.html diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh new file mode 100755 index 0000000000..3be42542ba --- /dev/null +++ b/scripts/install_dependencies.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +set -e +set -o pipefail + +if [[ -z "${_ROCM_DIR}" ]]; then + export _ROCM_DIR=/opt/rocm +fi + +# Location of dependencies source code +export _INSTALL_DIR=$HOME/installDIR +export _DEPS_SRC_DIR=$_INSTALL_DIR/src + +mkdir -p $_DEPS_SRC_DIR + +#Adjust branches and installation location as necessary +export _UCX_INSTALL_DIR=$_INSTALL_DIR/ucx +export _UCX_REPO=https://github.com/openucx/ucx.git +export _UCX_BRANCH=v1.17.x + +export _OMPI_INSTALL_DIR=$_INSTALL_DIR/ompi +export _OMPI_REPO=https://github.com/open-mpi/ompi.git +export _OMPI_BRANCH=v5.0.x + +# Step 1: Build UCX with ROCm support +cd $_DEPS_SRC_DIR +rm -rf ucx +git clone $_UCX_REPO -b $_UCX_BRANCH +cd ucx +./autogen.sh +./contrib/configure-release --prefix=$_UCX_INSTALL_DIR \ + --with-rocm=$_ROCM_DIR \ + --enable-mt \ + --without-go \ + --without-java \ + --without-cuda \ + --without-knem +make -j +make install + +# Step 3: Install OpenMPI with UCX support +cd $_DEPS_SRC_DIR +rm -rf ompi +git clone --recursive $_OMPI_REPO -b $_OMPI_BRANCH +cd ompi +./autogen.pl +./configure --prefix=$_OMPI_INSTALL_DIR \ + --with-rocm=$_ROCM_DIR \ + --with-ucx=$_UCX_INSTALL_DIR \ + --disable-oshmem \ + --with-prrte=internal \ + --with-hwloc=internal \ + --with-libevent=internal \ + --without-cuda \ + --disable-sphinx \ + --disable-mpi-fortran \ + --without-ofi +make -j +make install + +rm -rf $_DEPS_SRC_DIR + +echo "Dependencies for rocSHMEM are now installed" +echo "" +echo "UCX $_UCX_BRANCH Installed to $_UCX_INSTALL_DIR" +echo "OpenMPI $_OMPI_BRANCH Installed to $_OMPI_INSTALL_DIR" +echo "" +echo "Please update your PATH and LD_LIBRARY_PATH"