ZLUDA, an implementation that allows running CUDA applications on AMD GPUs

ZLUDA

ZLUDA runs on AMD's ROCm stack

The news has been released that AMD has made the decision to stop funding the development of ZLUDA, which is an open implementation of CUDA technology for AMD GPUs, allowing you to run CUDA applications without modifying them with performance close to that of applications running without additional layers.

During the last two years, work has been done on the development of this layer to facilitate the execution of CUDA applications on systems with AMD GPUs. But until recently AMD has made the decision that run CUDA applications on AMD GPUs was not of commercial interest, which allowed the developer to open its developments as agreed in the contract.

About ZLUDA

The project was initially created to support CUDA work on Intel GPUs and the change in GPU support policy is due to the fact that initially the developer of ZLUDA was an Intel employee. In 2021, Intel decided it was not commercially viable provide the ability to run CUDA applications on Intel GPUs, which led to the discontinuation of development of the initiative.

In early 2022, the developer left Intel and signed a contract with AMD to continue development of the CUDA compatibility layer. During development, AMD requested that the company's interest in the ZLUDA project not be promoted and that it not commit to the ZLUDA public repository.

ZLUDA provides binary support for CUDA applications existing ones compiled with the CUDA compiler for NVIDIA GPUs, without the need to make changes at the source code level. The implementation operates on AMD's ROCm stack and the HIP runtime.

In its current state, ZLUDA's conversion quality level is considered an alpha version. Although it is worth mentioning that it is already capable of running many CUDA applications, in addition to providing minimal support for primitives and libraries, it also has prototype implementations of the OptiX framework.

ZLUDA

ZLUDA Comparison Chart

During first execution of CUDA applications under ZLUDA control you experience noticeable delays because ZLUDA compiles the code for the GPU. However, on subsequent runs this delay disappears, as the compiled code is cached, resulting in near-native performance when running the compiled code. For example, when running Geekbench on an AMD Radeon 6800 XT GPU, the ZLUDA-based version of the CUDA benchmark suite showed significantly better performance than the OpenCL-based version.

In addition, it is mentioned that support for the official CUDA driver API and reverse engineering of the undocumented CUDA API is implemented in ZLUDA by replacing function calls with analogous functions provided in the HIP runtime, which is very similar to CUDA.

For example, the function cuDeviceGetAttribute() is replaced by hipDeviceGetAttribute(). ZLUDA also ensures compatibility with NVIDIA libraries such as NVML, cuBLAS and cuSPARSE. For these libraries, ZLUDA provides translation libraries with the same name and the same feature set, built on top of similar AMD libraries. The GPU application code, compiled in PTX (Parallel Thread Execution) representation, is translated by a special compiler to an intermediate LLVM IR representation, from which the binary code for the AMD GPU is generated.

Finally, it should be mentioned that The future of the project depends on the interest of the community and possible cooperation proposals from other companies. Without external support, the project will continue to develop solely in areas of personal interest to the author, such as DLSS.

For interested in the project code, you should know that it is written in Rust and is distributed under the MIT and Apache 2.0 licenses, and the project is compatible with Linux and Windows. If you are interested in learning more about it, you can consult the details In the following link.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.