rocRAND icon indicating copy to clipboard operation
rocRAND copied to clipboard

Add CMake HIP language support

Open cgmb opened this issue 3 years ago • 3 comments

Build Instructions

  1. Install ROCm 4.5.2
  2. Install CMake 3.21.3 or later
  3. Install libnuma and kmod (so that rocm_agent_enumerator works)
  4. Build rocRAND:
HIPCXX=/opt/rocm/llvm/bin/clang++ \
CXX=/opt/rocm/llvm/bin/clang++ \
CC=/opt/rocm/llvm/bin/clang \
cmake -S. -Bbuild -GNinja \
  -DBUILD_HIPRAND=OFF \
  -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
  -DROCRAND_CMAKE_HIP_LANGUAGE=ON

With these changes, the above command will build a version of the library compatible with the system it's running on. If you want specific GPU architectures, append -DCMAKE_HIP_ARCHITECTURES='gfx906:xnack-;gfx1030' (replacing the example gfx906:xnack-;gfx1030 values with your chosen semi-colon delimited list of AMDGPU target ids).

Related CMake Documentation

cgmb avatar Apr 07 '22 01:04 cgmb

HI! rocRAND developer here, thank you for getting this off the ground. I believe cmake HIP support for rocRAND would simplify many projects that depend on rocRAND. I added a few comments, and will try this out soon.

I think I can help answer some questions regarding the project if you need anything.

Maetveis avatar Apr 08 '22 18:04 Maetveis

This has been sitting around for a while. Should it be resurrected?

saadrahim avatar Jan 05 '23 21:01 saadrahim

This has been sitting around for a while. Should it be resurrected?

Maybe, but I don't have the bandwidth to do that quite yet.

The official Linux and Windows builds now both use CMake 3.22, so if this PR were finished, we could begin to use the CMake HIP language support in our official builds.

cgmb avatar Jan 10 '23 21:01 cgmb