mirror of
https://github.com/versity/versitygw.git
synced 2026-09-30 03:35:42 +00:00
fix: port the cuObjServer wrapper to libcuobjserver 2.0.0
NVIDIA's rolling cuda-rhel9 repository bumped libcuobjserver from `1.2.0` to `2.0.0` and `build/vgwrdma-builder/Dockerfile` installs it unpinned, so `make vgwrdma-docker` broke: `setTelemFlags` gained a second mask and `initRDMAConfigParams` vanished along with the `RDMAConnection` base class that 2.0.0 deletes entirely. Rather than pin the package, this ports the C wrapper and the Go `rdma` package to the new API. Telemetry now calls `setTelemFlags(flags, 0)`, where 0 reproduces the old behaviour. `Server.InitRDMAConfig` and its C entry point are removed, which drops a method from the exported API of `github.com/versity/versitygw/rdma`; it had no callers, and 2.0.0 only accepts tunables through the four-argument constructor that `NewServer` already uses. The `dlsym` lookups for `startRDMASession` and `closeRDMASession` go too, as dead code: 1.2.0 never exported those symbols either, so the fallback paths were always what ran. `HandleGet` and `HandlePut` now wrap the library's negative return in a `syscall.Errno` so 2.0.0's new `-EPROTO` is legible, and the wrapper compile rule gains `-std=c++17`. No defaults change. `make vgwrdma-docker` passes and the binary links `libcuobjserver.so.2`, so it requires a 2.x install at runtime. `cuobjtest-gpu` and `cuobjtest-host` are unaffected. The RDMA data path itself is not verified here; that needs Mellanox hardware with DC transport.
This commit is contained in:
@@ -59,10 +59,10 @@ func New(opts CuServerOpts, be backend.Backend) (*CuServer, error) {
|
||||
return nil, fmt.Errorf("cuserver: rdma server: %w", err)
|
||||
}
|
||||
|
||||
// StartSession is a no-op when the library manages session start
|
||||
// internally (e.g. libcuobjserver v1.2.0 calls startRDMASession from
|
||||
// the cuObjServer constructor). It is kept here for forward compatibility
|
||||
// with library versions that require an explicit call.
|
||||
// libcuobjserver starts the RDMA session inside the cuObjServer
|
||||
// constructor, so this verifies the session came up rather than
|
||||
// initiating it, and fails fast if the server constructed but did not
|
||||
// connect.
|
||||
if err := rdmaSrv.StartSession(); err != nil {
|
||||
rdmaSrv.Close()
|
||||
be.Shutdown()
|
||||
|
||||
Reference in New Issue
Block a user