From 06a34632ea5027334a699eaafaea3fec91b05788 Mon Sep 17 00:00:00 2001 From: Jihyeon Gim Date: Sat, 5 Sep 2026 19:50:29 +0900 Subject: [PATCH] rdma: name the deviceless init failures in the RC server The verbs loader and device enumeration failures returned RC_E_INTERNAL without any stderr trace, which made a VM or container without RDMA indistinguishable from a genuine library problem. Print the failing step so operators can tell the two apart at startup. --- cuwrapper/rc/rc_server_abi.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cuwrapper/rc/rc_server_abi.cpp b/cuwrapper/rc/rc_server_abi.cpp index c915b417..da2f1938 100644 --- a/cuwrapper/rc/rc_server_abi.cpp +++ b/cuwrapper/rc/rc_server_abi.cpp @@ -300,7 +300,10 @@ void rc_server_set_log_sink(rc_server *srv, rc_log_fn fn, void *ctx) { int rc_server_init(const rc_device_opts *opts, rc_server **out) { if (!opts || !out) return RC_E_ARG; - if (!hipObj::ibv.ensureLoaded()) return RC_E_INTERNAL; + if (!hipObj::ibv.ensureLoaded()) { + fprintf(stderr, "rc: cannot load libibverbs (dlopen/dlsym failed)\n"); + return RC_E_INTERNAL; + } std::unique_ptr srv(new rc_server()); srv->opts = *opts; /* ibv port numbers are 1-based; treat an unset (0) port as 1 so @@ -316,7 +319,10 @@ int rc_server_init(const rc_device_opts *opts, rc_server **out) { int n = 0; struct ibv_device **devs = hipObj::ibv.get_device_list(&n); - if (!devs || n == 0) return RC_E_INTERNAL; + if (!devs || n == 0) { + fprintf(stderr, "rc: no RDMA devices found (ibv_get_device_list)\n"); + return RC_E_INTERNAL; + } struct ibv_device *chosen = devs[0]; /* GID hint: pick the first device/port whose GID starts with it. * Query with srv->opts.port, which the normalization above has