HON’s Wiki # HIP

Home / High-Performance Computing (HPC)

Contents

HIP (TODO abbreviation) is AMD ROCm’s runtime API and kernel language, which is compilable for both AMD (through ROCm) and NVIDIA (through CUDA) GPUs. Compared to OpenCL (which is also supported by both NVIDIA and AMD), it’s much more similar to CUDA (making it very easy to port CUDA code) and allows using existing profiling tools and similar for CUDA and ROCm.

Resources

Info

Setup (Debian)

Install for AMD GPUs

  1. Install the ROCm suite (contains HIP and other useful stuff): See ROCm.

Install for NVIDIA GPUs

Updated for ROCm 5.0.

  1. Install the CUDA toolkit and the NVIDIA driver: See CUDA.
  2. Add the ROCm package repo:
    1. Install requirements: sudo apt install curl libnuma-dev wget gnupg2
    2. Add repo key: curl -sSf https://repo.radeon.com/rocm/rocm.gpg.key | sudo gpg --dearmor --output /usr/share/keyrings/rocm.gpg
    3. Add ROCm repo: echo 'deb [signed-by=/usr/share/keyrings/rocm.gpg arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
    4. Update cache: sudo apt update
  3. Install: sudo apt install hip-dev hip-doc hip-runtime-nvidia
  4. Add ROCm to PATH: echo 'export PATH=$PATH:/opt/rocm/bin' | sudo tee /etc/profile.d/rocm.sh (relog to reload)

Post-Install Verification

  1. Verify installation: hipconfig --full
  2. (Optional) Try to build a HIP sample program:
    1. git clone https://github.com/ROCm-Developer-Tools/HIP
    2. cd HIP/samples/0_Intro/square
    3. make
    4. ./square.out

Usage and Tools


hon.one | HON95/wiki | Edit page