Converting CUDA programs to run on AMD GPUs
Anderssén, Victor (2024)
Anderssén, Victor
2024
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi-fe2024042321241
https://urn.fi/URN:NBN:fi-fe2024042321241
Tiivistelmä
This Master’s thesis outlines the conversion process of CUDA (Compute Unified Device Architecture) source code, originally designed for Nvidia hardware, to code compatible with both Nvidia and Advanced Micro Devices (AMD) hardware. The conversion is facilitated by AMD’s Heterogeneous-Computing Interface for Portability (HIP).
Parallel computing using Graphics Processing Units (GPUs) has been a longstanding practice, leveraging GPUs’ parallel capabilities, software support, and speed. Nvidia has historically dominated the supercomputing market for GPUs. However, with the emergence of Advanced Micro Devices (AMD) as a competitor, a viable alternative for supercomputers now exists. Notably, the LUMI supercomputer in Finland incorporates AMD GPUs in its GPU partition.
This Master’s thesis addresses the challenge of converting pre-existing CUDA code, along with associated libraries, into HIP code, thereby enabling execution on hardware from both manufacturers. This HIP conversion empowers developers to run their legacy CUDA programs seamlessly on Nvidia or AMD hardware. A general method for the ’hipification’ of external libraries and own code was developed.
The general method was tested on a Quasi-Minimal Residual method (QMR) solver. The test data that the QMR solver is run with is from DREAM (Disruption and Runaway Electron Analysis Model). Quadruple precision was used in order to achieve convergence in the QMR solver. The runtime of the QMR program was measured for different GPUs resulting in comparable runtimes for both AMD and Nvidia GPUs.
Parallel computing using Graphics Processing Units (GPUs) has been a longstanding practice, leveraging GPUs’ parallel capabilities, software support, and speed. Nvidia has historically dominated the supercomputing market for GPUs. However, with the emergence of Advanced Micro Devices (AMD) as a competitor, a viable alternative for supercomputers now exists. Notably, the LUMI supercomputer in Finland incorporates AMD GPUs in its GPU partition.
This Master’s thesis addresses the challenge of converting pre-existing CUDA code, along with associated libraries, into HIP code, thereby enabling execution on hardware from both manufacturers. This HIP conversion empowers developers to run their legacy CUDA programs seamlessly on Nvidia or AMD hardware. A general method for the ’hipification’ of external libraries and own code was developed.
The general method was tested on a Quasi-Minimal Residual method (QMR) solver. The test data that the QMR solver is run with is from DREAM (Disruption and Runaway Electron Analysis Model). Quadruple precision was used in order to achieve convergence in the QMR solver. The runtime of the QMR program was measured for different GPUs resulting in comparable runtimes for both AMD and Nvidia GPUs.