AMD Adds Basic RPC Mechanism To LLVM libc For GPUs

Written by Michael Larabel in LLVM on 22 March 2023 at 06:19 AM EDT. 4 Comments
LLVM
AMD has upstreamed a basic RPC (remote procedure call) mechanism for GPU use to LLVM's libc and wired it up for AMDGPU use.

AMD engineer Joseph Huber has contributed this basic RPC client-server implementation to LLVM's libc for GPU use and given their focus is wired up for the AMDGPU back-end currently. Huber explained in the commit:
This patch adds initial support for an RPC client / server architecture. The GPU is unable to perform several system utilities on its own, so in order to implement features like printing or memory allocation we need to be able to communicate with the executing process. This is done via a buffer of "sharable" memory. That is, a buffer with a unified pointer that both the client and server can use to communicate.

The implementation here is based off of Jon Chesterfields minimal RPC example in his work. We use an `inbox` and `outbox` to communicate between if there is an RPC request and to signify when work is done. We use a fixed-size buffer for the communication channel. This is fixed size so that we can ensure that there is enough space for all compute-units on the GPU to issue work to any of the ports. Right now the implementation is single threaded so there is only a single buffer that is not shared.

This implementation still has several features missing to be complete. Such as multi-threaded support and asynchrnonous calls.

That initial GPU RPC implementation landed via this commit.

Other pending work around the AMDGPU back-end for upstream LLVM can be found via this LLVM Phabricator query.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week