Install HIP#
HIP can be installed on AMD (ROCm with HIP-Clang) and NVIDIA (CUDA with NVCC) platforms.
Note
The version definition for the HIP runtime is different from CUDA. On AMD
platforms, the hipRuntimeGetVersion()
function returns the HIP
runtime version. On NVIDIA platforms, this function returns the CUDA runtime
version.
Prerequisites#
Refer to the Prerequisites section in the ROCm install guides:
With NVIDIA GPUs, HIP requires unified memory. All CUDA-enabled NVIDIA GPUs with compute capability 5.0 or later should be supported. For more information, see NVIDIA’s list of CUDA enabled GPUs.
Installation#
HIP is automatically installed during the ROCm installation. If you haven’t yet installed ROCm, you can find installation instructions here:
By default, HIP is installed into /opt/rocm
.
Note
There is no autodetection for the HIP installation. If you choose to install it somewhere other than the default location, you must set the HIP_PATH
environment variable as explained in Build HIP from source.
Install the NVIDIA driver.
sudo apt-get install ubuntu-drivers-common && sudo ubuntu-drivers autoinstall sudo reboot
Alternatively, you can download the latest CUDA Toolkit.
Install the
hip-runtime-nvidia
andhip-dev
packages. This installs the CUDA SDK and HIP porting layer.apt-get install hip-runtime-nvidia hip-dev
- The default paths are:
CUDA SDK:
/usr/local/cuda
HIP:
/opt/rocm
You can optionally add
/opt/rocm/bin
to your path, which can make it easier to use the tools.
Verify your installation#
Run hipconfig
in your installation path.
/opt/rocm/bin/hipconfig --full