Files
rocm-systems/hipamd/INSTALL.md
T
Julia Jiang ab16be4b8f SWDEV-324824 - Update install instrction to define repository branch variable
Change-Id: I6080aabb5a9b6d4a89bc1f2a26c4ed3a4e77aa9f
2022-03-02 19:56:37 -05:00

1.6 KiB

Prerequisites

Branch of repository

Before get HIP source code, set the expected branch of repository at the variable HIP_BRANCH. For example, for ROCm5.0 release branch, set

export HIP_BRANCH=rocm-5.0.x

ROCm5.1 release branch, set

export HIP_BRANCH=rocm-5.1.x

Similiar format for future branches.

Getting the source code

git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/hipamd.git
git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/hip.git
git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/ROCclr.git
git clone -b $HIP_BRANCH https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git

Set the environment variables

export HIPAMD_DIR="$(readlink -f hipamd)"
export HIP_DIR="$(readlink -f hip)"
export ROCclr_DIR="$(readlink -f ROCclr)"
export OPENCL_DIR="$(readlink -f ROCm-OpenCL-Runtime)"

Build HIPAMD

Commands to build hipamd are as following,

cd "$HIPAMD_DIR"
mkdir -p build; cd build
cmake -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=$OPENCL_DIR -DROCCLR_PATH=$ROCCLR_DIR -DCMAKE_PREFIX_PATH="<ROCM_PATH>/" -DCMAKE_INSTALL_PREFIX=$PWD/install ..
make -j$(nproc)
sudo make install

Note, HIP_COMMON_DIR looks for hip common (HIP) source codes. By default, release version of hipamd is built.