-
Notifications
You must be signed in to change notification settings - Fork 276
RDMA Devel
Ben McClelland edited this page Aug 4, 2026
·
3 revisions
-
cmd/vgwrdma: the gateway binary. Adds--rdma-*flags on top of the standardversitygwflags and wirescubackend.CuServerin front of the chosen storage backend when--rdma-ipis set. -
cubackend:CuServer, abackend.Backenddecorator. Delegates every S3 operation to the wrapped backend exceptPutObject/GetObject, which use RDMA transfers when the request carries a cuObject descriptor. -
cumiddleware: Fiber middleware that parses the cuObject RDMA headers (X-Amz-Rdma-Token, or the legacy 3-header scheme used by this repo's own test tooling) and stashes the descriptor/size/remote address on the request context forcubackendto pick up. -
rdma: cgo bindings tolibcuobjserver(the vendor library implementing the RDMA DC protocol server side). Builds only onlinux/amd64with cgo; a stub implementation on other platforms lets the rest of the tree build. -
rdma/bufferpool: a fixed pool of pre-allocated, pre-registered RDMA buffers soCuServerdoesn't pay allocation/registration cost per request. -
cuwrapper: small C++ shims (cuobjserver_wrapper,cuobjclient_wrapper,rdma_host_client_wrapper) that present a plain C ABI over the vendor C++ libraries so cgo can link against them. -
cuobjclient: Go client SDK used bycuobjtest. Has two implementations selected by build tag: a CUDA/GPU-backed one (session_linux.go, default) using the real NVIDIAlibcuobjclient, and a host-memory-only one (session_host_linux.go,cuobjclient_hostbuild tag) usingrdma/hostclientfor RDMA-capable machines with no GPU. -
cmd/cuobjtest: example/benchmark client, see below.
The SDK lives in cuobjclient/ and exposes a small session-based API:
NewSession(size int) (*Session, error)(*Session).Upload(base *s3.Client, bucket, key string, src []byte) error(*Session).Download(base *s3.Client, bucket, key string, dst []byte) error(*Session).Close()
- Default GPU build (
session_linux.go):- build tags:
linux && amd64 && cgo && !cuobjclient_host - uses NVIDIA
libcuobjclientand CUDA memory registration
- build tags:
- Host-memory build (
session_host_linux.go):- build tags:
linux && amd64 && cgo && cuobjclient_host - no GPU dependency; uses
rdma/hostclient
- build tags:
- Unsupported platform stub (
session_stub.go):- selected when not
linux/amd64/cgo - returns explicit "only supported on linux/amd64 with cgo" errors
- selected when not
Maximum transfer size is 1 << 30 bytes (1 GiB), defined in
cuobjclient/limits.go.
- Create one session for a fixed transfer size.
- Reuse that session across multiple sequential transfers.
- Each
Upload/Downloadbuffer length must exactly match session size. - Session methods are not goroutine-safe; do not call methods concurrently on the same session.
- Call
Close()to release GPU/host RDMA resources.
Implementation is shared in cuobjclient/transport.go:
- SDK sends a zero-byte
PutObject/GetObjectrequest. - It injects cuObject headers (
X-Amz-Rdma-*) through Smithy build middleware so headers are included in SigV4 signed headers. - Actual payload transfer happens via RDMA, not HTTP body streaming.
- SDK validates gateway response headers:
-
X-Amz-Rdma-Reply(offload success) -
X-Amz-Rdma-Bytes-Transferred(must match expected size)
-
- If these headers are missing or mismatched, SDK returns an error rather than silently treating the transfer as success.
When built with -tags cuobjclient_host, NewSession reads:
-
VGWRDMA_RDMA_DEV(default: first device) -
VGWRDMA_RDMA_PORT(default:1) -
VGWRDMA_GID_INDEX(default: auto-select first non-link-local GID) -
VGWRDMA_DC_KEY(default:0xffeeddccviahostclient.DefaultDCKey)
sess, err := cuobjclient.NewSession(size)
if err != nil {
return err
}
defer sess.Close()
putBuf := make([]byte, size)
getBuf := make([]byte, size)
if err := sess.Upload(s3Client, bucket, key, putBuf); err != nil {
return err
}
if err := sess.Download(s3Client, bucket, key, getBuf); err != nil {
return err
}For a full, runnable reference using this SDK, see cmd/cuobjtest/main.go.
cuobjtest demonstrates:
- creating a normal AWS SDK v2 S3 client (
UsePathStyle: true) - creating and reusing one
cuobjclient.Session - PUT/GET data-path benchmarking with per-iteration latency + GB/s
- checksum verification for round-trip correctness
- baseline comparison mode with standard S3 only (
-std-s3)
Example run:
make cuobjtest-gpu-docker
./cuobjtest \
-access <access-key> \
-secret <secret-key> \
-endpoint http://<gw-host>:7070 \
-bucket cuobjtestIf you are validating SDK integration in a new client, cuobjtest is the best
starting point for expected control flow and error handling.
- Home
- User:
- Quickstart
- System Requirements
- Install
- Workflow
- Global Options
- Troubleshooting
- TLS
- Virtual Host Addressing
- HA/Load Balancing
- Event Notifications
- Docker / Helm
- PreSignedURL
- Multi Tenant/IAM
- Example Client Configs
- Incompatibilities with AWS S3
- Metrics
- Admin APIs
- Backends:
- Logging:
- WebGUI
- S3 RDMA
- Testing
- Third Party Packaging
- Developer:
- Articles:



