Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions requirements/gromacs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- GDRCopy:
- name: autoconf
version: latest
- name: automake
version: latest
- name: libtool
version: latest
- name: libnuma-dev
version: latest
- name: numactl
version: latest
- name: flex
version: latest
2 changes: 2 additions & 0 deletions requirements/req.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ dependencies:
- namd:
- req_file: namd.yml

- gromacs:
- req_file: gromacs.yml
# Project description
description: ROCm Machine Learning one-script installer xxxxxxxxxxxx xxxxxxxxxxxxxxxxxx xx xxxxxxxxxxxxxxxx
...
Expand Down
8 changes: 6 additions & 2 deletions src/cmd
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function parseArgs {
;;

# Set Packages ########################################################################
"rocm" | "tensorflow" | "pytorch" | "namd")
"rocm" | "tensorflow" | "pytorch" | "namd" | "gromacs")
# Permitted commands: install, remove and update
if [[ ! "$__cmd_parseArgs" =~ ^("install"|"update"|"remove"|"benchmark")$ ]]; then logPrint "ERR" "Wrong command! Did you mean: $0 install $__arg_parseArgs"; exit; fi
if [[ "$__arg_parseArgs" =~ ^("tensorflow"|"pytorch")$ ]]; then
Expand All @@ -146,6 +146,7 @@ function parseArgs {
fi

[[ "$__arg_parseArgs" = "namd" ]] && { __arg_parseArgs="$__arg_parseArgs:src"; __isROCmRequired_parseArgs=0; }
[[ "$__arg_parseArgs" = "gromacs" ]] && { __arg_parseArgs="$__arg_parseArgs:src"; __isROCmRequired_parseArgs=0; }
__pkgs_parseArgs+=("$__arg_parseArgs");
shift
;;
Expand Down Expand Up @@ -296,6 +297,9 @@ function runInstall {
namd)
installNAMD;
;;
gromacs)
installGROMACS;
;;
esac

# Run post installation
Expand Down Expand Up @@ -578,4 +582,4 @@ function runBenchmark {
return "$?";
;;
esac
}
}
82 changes: 81 additions & 1 deletion src/cmd_utils
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,84 @@ function buildFromSource {
runCmd __cmd_array_buildFromSource "ERR" "1" "Build/Install $__dist_dir_name_buildFromSource" "0"
done
stopLoadBar
}
}


# Install GROMACS from Source
# This should be removed once GROMACS support DEP & RPM package installation
function installGROMACS {
local __cmd_ret_installGROMACS
local __retPath_installGROMACS=$(pwd)
local __cmd_array_installGROMACS=()
local __url_GROMACS_installGROMACS="http://gitlab1.amd.com/dc-hpc/gromacs-hip.git"
local __url_OpenMPI_installGROMACS="https://github.com/open-mpi/ompi.git -b v4.0.1"
local __url_GDRCOPY_installGROMACS="https://github.com/NVIDIA/gdrcopy.git -b v1.3"
local __url_UCX_installGROMACS="https://github.com/openucx/ucx.git -b v1.6.0"

#local __inst_root_installMPI="$TEMP_DIRECTRORY/mpi_install"
local __inst_root_installMPI="/home/amd/work/vicky/GROMACS/RET/mpi_install"

local __inst_root_installGROMACS="$__inst_root_installMPI/gromacs"
local __inst_root_installOpenMPI="$__inst_root_installMPI/ompi"
local __inst_root_installGDRCOPY="$__inst_root_installMPI/gdr"
local __inst_root_installGDRCOPY_SRC="$__inst_root_installMPI/gdrcopy"
local __inst_root_installGDRCOPY_LIB="$__inst_root_installGDRCOPY/lib64"
local __inst_root_installGDRCOPY_INCLUDE="$__inst_root_installGDRCOPY/include"
local __inst_root_installUCX="$__inst_root_installMPI/ucx"

# Confirmation message
logPrint "STEP" "Build GROMACS"

# Set the ROCm binaries in PATH
__cmd_array_installGROMACS=("source /etc/profile.d/rocm.sh"); runCmd __cmd_array_installGROMACS "ERR"

# Clone GDRCPY #######################################################################################################
startLoadBar "Clone GDRCOPY Repository"

__cmd_array_installGROMACS=("su -p $SUDO_USER -c 'git clone ${__url_GDRCOPY_installGROMACS} $__inst_root_installGDRCOPY_SRC'")
runCmd __cmd_array_installGROMACS "ERR"

stopLoadBar "Clone GDRCOPY Completed Successfully."

# Build GDRCPY ##############################################################################################
startLoadBar "Build GDRCOPY"

__cmd_array_installGROMACS=("cd $__inst_root_installGDRCOPY_SRC && mkdir -p $__inst_root_installGDRCOPY_LIB $__inst_root_installGDRCOPY_INCLUDE")
runCmd __cmd_array_installGROMACS "ERR"

__cmd_array_installGROMACS=("make PREFIX=$__inst_root_installGDRCOPY lib install && cd $__inst_root_installMPI")
runCmd __cmd_array_installGROMACS "ERR"

stopLoadBar "Build GDRCOPY Completed Successfully."

# Build UCX ##############################################################################################
__cmd_array_installGROMACS=("cd $__inst_root_installUCX && ./autogen.sh" "mkdir build && cd build && ../contrib/configure-release --prefix=$__inst_root_installUCX --with-rocm=/opt/rocm --with-gdrcopy=$__inst_root_installGDRCOPY" "sudo make -j$(nproc) && sudo make -j$(nproc) install" "cd $__inst_root_installGROMACS")
buildFromSource "$__url_UCX_installGROMACS" "$__inst_root_installUCX" __cmd_array_installGROMACS "ucx" "ucx" "0"

# Build OMPI ##############################################################################################
__cmd_array_installGROMACS=("cd $__inst_root_installOpenMPI && ./autogen.pl && mkdir build && cd build && ../configure --prefix=$__inst_root_installOpenMPI/ompi --with-ucx=$__inst_root_install_UCX && sudo make -j\$(nproc) && sudo make -j\$(nproc) install && cd $__inst_root_installGROMACS")
#buildFromSource "$__url_OpenMPI_installGROMACS" "$__inst_root_installOpenMPI" __cmd_array_installGROMACS "ompi" "ompi" "0"

__cmd_array_installGROMACS=("echo 'export PATH=$ROCM_PATH/hcc/bin:$ROCM_PATH/hip/bin:$ROCM_PATH/bin:$ROCM_PATH/hcc/bin:\${PATH:+:\${PATH}}' | tee -a /etc/profile.d/gromacs.sh && echo 'export LD_LIBRARY_PATH=$ROCM_PATH/lib:/usr/local/lib:\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}' | tee -a /etc/profile.d/gromacs.sh && echo 'export PATH=$__inst_root_installOpenMPI/bin:$ROCM_PATH/bin:\${PATH:+:\${PATH}}' | tee -a /etc/profile.d/gromacs.sh && echo 'export CPLUS_INCLUDE_PATH=$__inst_root_installOpenMPI/include:\${CPLUS_INCLUDE_PATH:+:\${CPLUS_INCLUDE_PATH}}' | tee -a /etc/profile.d/gromacs.sh")

__cmd_array_installGROMACS=("source /etc/profile.d/gromacs.sh")
runCmd __cmd_array_installGROMACS "ERR"

# Build GROMACS ##############################################################################################
#__cmd_array_installGROMACS=("cd $__inst_root_installGROMACS" "git checkout master" "mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=ON -DGMX_BUILD_FOR_COVERAGE=on -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpic++ -DGMX_MPI=on -DGMX_GPU=on -DGMX_OPENMP=on -DGMX_GPU_USE_AMD=on -DGMX_GPU_DETECTION_DONE=on -DGMX_SIMD=AVX2_128 -DREGRESSIONTEST_DOWNLOAD=OFF -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_INSTALL_PREFIX=RET_GROMACS/no_mpi .." "sudo make -j$(nproc) && sudo make -j$(nproc) install" "cd $__inst_root_installGROMACS")
#buildFromSource "$__url_GROMACS_installGROMACS" "$__inst_root_installGROMACS" __cmd_array_installGROMACS "gromacs" "gromacs" "0"
__cmd_array_installGROMACS=("cd $__inst_root_installGROMACS")
runCmd __cmd_array_installGROMACS "ERR"

__cmd_arry_installGRAMACS=("mkdir build && cd build && cmake -DBUILD_SHARED_LIBS=ON -DGMX_BUILD_FOR_COVERAGE=on -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpic++ -DGMX_MPI=on -DGMX_GPU=on -DGMX_OPENMP=on -DGMX_GPU_USE_AMD=on -DGMX_GPU_DETECTION_DONE=on -DGMX_SIMD=AVX2_128 -DREGRESSIONTEST_DOWNLOAD=OFF -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_INSTALL_PREFIX=RET_GROMACS/no_mpi .. && sudo make -j$(nproc) && sudo make -j$(nproc) install")
runCmd __cmd_array_installGROMACS "ERR"


##################################################################################################################

# Back to the RET folder
cd "$__retPath_installGROMACS"

[ $? -ne 0 ] && stopLoadBar "There was a problem building GROMACS!" "ERR" "make" \
|| stopLoadBar "Install Completed Successfully."
}