View Single Post
Staro 12.02.2024., 17:59   #177
The Exiled
McG
Moj komp
 
The Exiled's Avatar
 
Datum registracije: Feb 2014
Lokacija: Varaždin
Postovi: 6,776
AMD auietly funded a drop-in CUDA implementation built on ROCm: It's now open-source
Citiraj:
While there have been efforts by AMD over the years to make it easier to port codebases targeting nVidia's CUDA API to run atop HIP/ROCm, it still requires work on the part of developers. The tooling has improved such as with HIPIFY to help in auto-generating but it isn't any simple, instant, and guaranteed solution -- especially if striving for optimal performance. Over the past two years AMD has quietly been funding an effort though to bring binary compatibility so that many nVidia CUDA applications could run atop the AMD ROCm stack at the library level -- a drop-in replacement without the need to adapt source code. In practice for many real-world workloads, it's a solution for end-users to run CUDA-enabled software without any developer intervention.

From several years ago you may recall ZLUDA that was for enabling CUDA support on Intel graphics. That open-source project aimed to provide a drop-in CUDA implementation on Intel graphics built atop Intel oneAPI Level Zero. ZLUDA was discontinued due to private reasons but it turns out that the developer behind that (and who was also employed by Intel at the time), Andrzej Janik, was contracted by AMD in 2022 to effectively adapt ZLUDA for use on AMD GPUs with HIP/ROCm. Prior to being contracted by AMD, Intel was considering ZLUDA development. However, they ultimately turned down the idea and did not provide funding for the project.

Andrzej Janik spent the past two years bringing ZLUDA to Radeon GPUs and it works: many CUDA software can run on HIP/ROCm without any modifications -- or other processes... Just run the binaries as you normally would while ensuring that the ZLUDA library replacements to CUDA are loaded. For reasons unknown to me, AMD decided this year to discontinue funding the effort and not release it as any software product. But the good news was that there was a clause in case of this eventuality: Janik could open-source the work if/when the contract ended.

Using ZLUDA is as easy as building the code (or grabbing the release) and then using the $LD_LIBRARY_PATH environment variable to specify the path to ZLUDA's various CUDA library drop-in replacement files. From there launching CUDA software should "just work" if all goes well. Among the CUDA-enabled software that's been tested by Janik includes Geekbench, Blender CUDA, 3DF Zephyr, Llama.cpp, Arnold, LuxCore, LAMMPS, OpenFOAM, XGBoost, NAMD, and other software packages. Some of these software packages have since adopted native ROCm/HIP support but keep in mind this ZLUDA on Radeon effort has been in the works now for 2+ years.
Izvor: Phoronix
__________________
AMD Ryzen 7 Pro 4750G + Vega iGPU | be quiet! Pure Rock 2 Black | MSI B450 Tomahawk Max II | 32GB G.Skill DDR4-2666 Value | 256GB AData SX8200 Pro NVMe | 2x4TB WD Red Plus | Fractal Define 7 Compact | Corsair CX450M
The Exiled je offline   Reply With Quote