[libc-commits] [PATCH] D145913: [libc] Add initial support for an RPC mechanism for the GPU

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Mar 13 02:38:47 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, JonChesterfield, tianshilei1992, michaelrj, lntue, sivachandra, tra.
Herald added subscribers: libc-commits, kosarev, ecnelises, kerbowa, tschuett, jvesely.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.

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.

Depends on D145912 <https://reviews.llvm.org/D145912>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145913

Files:
  libc/src/__support/CMakeLists.txt
  libc/src/__support/OSUtil/CMakeLists.txt
  libc/src/__support/OSUtil/gpu/CMakeLists.txt
  libc/src/__support/OSUtil/gpu/io.cpp
  libc/src/__support/OSUtil/gpu/io.h
  libc/src/__support/OSUtil/gpu/quick_exit.cpp
  libc/src/__support/OSUtil/io.h
  libc/src/__support/RPC/CMakeLists.txt
  libc/src/__support/RPC/rpc.h
  libc/src/__support/RPC/rpc_client.cpp
  libc/src/__support/RPC/rpc_client.h
  libc/startup/gpu/amdgpu/CMakeLists.txt
  libc/startup/gpu/amdgpu/start.cpp
  libc/utils/gpu/loader/amdgpu/CMakeLists.txt
  libc/utils/gpu/loader/amdgpu/Loader.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145913.504564.patch
Type: text/x-patch
Size: 16718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230313/f1b47a85/attachment-0001.bin>


More information about the libc-commits mailing list