Skip to content

Instantly share code, notes, and snippets.

@rigtorp
Last active July 3, 2022 13:02
Embed
What would you like to do?
How to build rocm 3.6.x beta from source

Install rocm-cmake

git clone https://github.com/RadeonOpenCompute/rocm-cmake.git
mkdir bulid
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm ..
make
sudo make install

Install ROCT-Thunk-Interface

git clone -b roc-3.6.x https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface.git
cd ROCT-Thunk-Interface
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm ..
make
sudo make install
sudo cp -r include /opt/rocm/

Install ROCR-Runtime

git clone -b rocm-3.6.x https://github.com/RadeonOpenCompute/ROCR-Runtime.git
cd ROCR-Runtime/src
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm -DHSAKMT_INC_PATH=/opt/rocm/include -DHSAKMT_LIB_PATH=/opt/rocm/lib64 ..
make
sudo make install

Install rocminfo

git clone https://github.com/RadeonOpenCompute/rocminfo.git
cd rocminfo
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm -DROCM_DIR=/opt/rocm ..
make
sudo make install

Install ROCM LLVM / CLang

git clone -b amd-stg-open https://github.com/RadeonOpenCompute/llvm-project.git
cd llvm-project
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="compiler-rt;lld;clang" ../llvm
make
sudo make install

Install ROCm-Device-Libs

git clone -b amd-stg-open http://github.com/RadeonOpenCompute/ROCm-Device-Libs.git
cd ROCm-Device-Libs
export PATH=/opt/rocm/llvm/bin:$PATH
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm ..
make
sudo make install

Install ROCm-CompilerSupport

git clone -b amd-stg-open https://github.com/RadeonOpenCompute/ROCm-CompilerSupport
cd ROCm-CompilerSupport/lib/comgr
export PATH=/opt/rocm/llvm/bin:$PATH
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm ..
make
sudo make install

Install ROCclr

git clone -b roc-3.6.x https://github.com/ROCm-Developer-Tools/ROCclr.git
git clone -b roc-3.6.x https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git

export ROCclr_DIR="$(readlink -f ROCclr)"
export OPENCL_DIR="$(readlink -f ROCm-OpenCL-Runtime)"

cd "$ROCclr_DIR"
mkdir -p build; cd build
cmake -DOPENCL_DIR="$OPENCL_DIR" -DCMAKE_INSTALL_PREFIX=/opt/rocm/rocclr ..
make -j$(nproc)
sudo make install

Install HIP

git clone -b roc-3.6.x https://github.com/ROCm-Developer-Tools/HIP.git
cd HIP
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DHIP_COMPILER=clang -DHIP_PLATFORM=rocclr -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_INSTALL_PREFIX=/opt/rocm ..
make
sudo make install

Build sample

cd HIP/samples/0_Intro/square
export HIP_PATH=/opt/rocm
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment