Frequently asked questions#

This topic provides answers to frequently asked questions from new HIP users and users familiar with NVIDIA CUDA.

HIP Support#

What hardware does HIP support?#

HIP supports AMD and NVIDIA GPUs. See prerequisites of the install guide for detailed information.

What operating systems does HIP support?#

Linux as well as Windows are supported by ROCm. The exact versions are listed in the system requirements for Supported operating systems and Supported SKUs.

Note

Not all HIP runtime API functions are yet supported on Windows. A note is added to those functions’ documentation in the HIP runtime API reference.

What libraries does HIP provide?#

HIP provides key math and AI libraries. See ROCm libraries for the full list.

What NVIDIA CUDA features does HIP support?#

The NVIDIA CUDA runtime API supported by HIP and NVIDIA CUDA driver API supported by HIP pages describe which NVIDIA CUDA APIs are supported and what the equivalents are. The HIP API documentation describes each API and its limitations, if any, compared with the equivalent CUDA API.

The kernel language features are documented in the C++ language extensions page.

Relation to other GPGPU frameworks#

Is HIP a drop-in replacement for CUDA?#

The HIPIFY tools can automatically convert almost all CUDA runtime code to HIP. Most device code needs no additional conversion because HIP and CUDA have the same signatures for math and built-in functions except for the name. HIP code provides similar performance as native CUDA code on NVIDIA platforms, plus the benefits of being compilable for AMD platforms.

Additional porting might be required to deal with architecture feature queries or CUDA capabilities that HIP doesn’t support.

How does HIP compare with OpenCL?#

HIP offers several benefits over OpenCL:

  • Device code can be written in modern C++, including templates, lambdas, classes and so on.

  • Host and device code can be mixed in the source files.

  • The HIP API is less verbose than OpenCL and is familiar to CUDA developers.

  • Porting from CUDA to HIP is significantly easier than from CUDA to OpenCL.

  • HIP uses development tools specialized for each platform: amdclang++ for AMD GPUs or nvcc for NVIDIA GPUs, and profilers like ROCm Compute Profiler or Nsight Systems.

  • HIP provides * pointers and host-side pointer arithmetic. * device-level control over memory allocation and placement. * an offline compilation model.

How does porting CUDA to HIP compare to porting CUDA to OpenCL?#

OpenCL differs from HIP and CUDA when considering the host runtime, but even more so when considering the kernel code. The HIP device code is a C++ dialect, while OpenCL is C99-based. OpenCL does not support single-source compilation.

As a result, the OpenCL syntax differs significantly from HIP, and porting tools must perform complex transformations, especially regarding templates or other C++ features in kernels.

To better understand the syntax differences, see here or the HIP porting guide.

Can I install CUDA and ROCm on the same machine?#

Yes, but you require a compatible GPU to run the compiled code.

On NVIDIA platforms, can I mix HIP code with CUDA code?#

Yes. Most HIP types and data structures are typedef s to CUDA equivalents and can be used interchangeably. This can be useful for iteratively porting CUDA code.

See HIP porting guide for more details.

Can a HIP binary run on both AMD and NVIDIA platforms?#

HIP is a source-portable language that can be compiled to run on AMD or NVIDIA platforms. However, the HIP tools don’t create a “fat binary” that can run on both platforms.