Skip to content
/ TheRock Public
forked from nod-ai/TheRock

The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm

License

Notifications You must be signed in to change notification settings

pcf000/TheRock

 
 

Repository files navigation

TheRock

The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm

Install Deps

On Ubuntu

sudo apt install \
  repo git-lfs libnuma-dev ninja-build cmake g++ pkg-config libdrm-dev \
  libelf-dev

Checkout Sources

We want ROCm sources checked out into the sources/ directory or if you check it out elsewhere create a symlink called ln -s /path/to/rocm sources

Via script

./fetch_sources.sh

Manually

Checkout the latest development branch with

mkdir ~/github/rocm
cd ~/github/rocm
repo init -u https://github.com/RadeonOpenCompute/ROCm.git
repo sync -j16

Use -b roc-6.0.x if you need a specific branch of ROCm sources.

Checkout out latest LLVM sources

cd ~/github/rocm/llvm-project
git fetch --all
llvm-project$ git checkout rocm-org/amd-staging

Latest HIP and clr should be on the develop branch

Checkout TheRock build tools

cd ~/github/
git clone https://github.com/nod-ai/TheRock
cd TheRock
ln -s </path/to/rocm> sources

Applying hacks/patches

Here are current patch topics that we are maintaining.

./apply_patches.sh

Build

cmake -B build -GNinja .
# Or if iterating and wishing to cache:
#   cmake -Bbuild -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .
cmake --build build

# Install per component.
cmake --install build --component amdgpu-runtime
cmake --install build --component amdgpu-runtime-dev
cmake --install build --component amdgpu-compiler

# Create archives.
(cd build && cpack -G TBZ2)

Sanity Checks

The following does not replace a robust test suite. However, it will tell you whether the toolchain you have just crafted is viable at all (as in can load and enumerate devices).

./build/dlopen-hip install/lib/libamdhip64.so

HIP enabled IREE can also be used to enumerate:

LD_LIBRARY_PATH=install/lib iree-run-module --dump_devices=hip

Development Notes

Building in a manylinux container

Our CI builds run in such a container, and it can be useful to run locally.

docker run --rm -it -v $PWD:$PWD --entrypoint /bin/bash ghcr.io/nod-ai/manylinux_ghr_x86_64:main

Packages needed:

yum install -y numactl-devel elfutils-libelf-devel vim-common git-lfs
pip install CppHeaderParser

About

The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CMake 87.9%
  • Shell 7.8%
  • C 4.3%