Nvidia CUDA Software Gets Ported to Open-Source RISC-V GPGPU Project

(Image credit: Nvidia)

RISC-V has been one of the hottest topics in the world of computing, as the Instruction Set Architecture (ISA) allows for extensive customization and is easy to understand, besides the whole open-source, license-free benefit. There's even a project that designed a general-purpose GPU based on RISC-V ISA, and now we are witnessing a port of Nvidia's CUDA software library to the Vortex RISC-V GPGPU platform.

Nvidia's CUDA (Compute Unified Device Architecture) represents a unique computing platform and application programming interface (API) that runs on Nvidia's lineup of graphics cards. When applications are coded for CUDA support, whenever a system spots a CUDA-based GPU, it gets massive GPU acceleration of the code.

Today, researchers have examined a way to enable CUDA software toolkit support on a RISC-V GPGPU project called Vortex. The Vortex RISC-V GPGPU aims to provide a full-system RISC-V GPU based on RV32IMF ISA. That means 32-bit cores that can be scaled from 1-core to 32-core GPU designs. It supports OpenCL 1.2 graphics API, and today it got support for some CUDA action as well.

The researchers explain: "...in this project we propose and build a pipeline to support an end-to-end CUDA migration: the pipeline accepts CUDA source codes as input and executes them on an extended RISC-V GPU architecture. Our pipeline consists of several steps: translates CUDA source code into NVVM IR, convert NVVM IR into SPIR-V IR, forwards SPIR-V IR into POCL to get RISC-V binary file, and finally executes the binary file on an extended RISC-V GPU architecture."

(Image credit: arXiv:2109.00673)

This process is visualized in the graph above, showing all the steps to get it working. In simple terms, CUDA source code is represented in the intermediate representation (IR) format called NVVM IR, based on the open-source LLVM IR. It is later converted to Standard Portable Intermediate Representation (SPIR-V) IR, then forwards that into the portable open-source implementation of the OpenCL standard called POCL. As Vortex supports OpenCL, it is fed with supported code and executes it without a problem.

For more details on this complicated process, check out this paper. And as an important note, you have to appreciate the effort of these researchers to enable CUDA to run on a RISC-V GPGPU. While this is only a small step for now, it is a possible beginning of an era where RISC-V is used for accelerated computing applications, very similar to what Nvidia is doing today with its GPU lineup.