Implement safe wrapper for nvmlDeviceGetGpuFabricInfoV. - #142
Conversation
|
Thanks for the thorough PR — the version handling, enum mappings, and docs all check out against the NVML 13 header. One real bug to fix before this can merge, though: The health-mask decoding treats the #define NVML_GPU_FABRIC_HEALTH_GET(var, type) \
(((var) >> NVML_GPU_FABRIC_HEALTH_MASK_SHIFT##type) & \
(NVML_GPU_FABRIC_HEALTH_MASK_WIDTH##type))i.e. it masks with
Concrete failure on a healthy multi-node fabric: The fix is one line: let field = |shift: u32, width: u32| (mask >> shift) & width;Could you also add a unit test with a synthetic mask (e.g. Happy to merge once that's addressed. (Minor non-blocking note: on r535-era drivers that only accept the v2 struct, this call will surface |
This PR provides a safe wrapper over
nvmlReturn_t nvmlDeviceGetGpuFabricInfoV ( nvmlDevice_t device, nvmlGpuFabricInfoV_t* gpuFabricInfo )by invoking the FFI binding provided bynvml-wrapper-sysin a similar way as the rest of this crate's wrappers.This returns a Rust struct corresponding to
nvmlGpuFabricInfo_v3_t:One limitation is that the
nvml-wrapper-syscrate does not contain bindings for the following health variants:This can be addressed in follow up work. See
nvml-wrapper/nvml-wrapper-sys/src/bindings.rs
Line 468 in eb47417
The older
nvmlReturn_t nvmlDeviceGetGpuFabricInfo ( nvmlDevice_t device, nvmlGpuFabricInfo_t* gpuFabricInfo )does not provide thehealthSummaryfield, so I do not implement it here (see nvmlGpuFabricInfo_t).Note that the output of
GpuFabricInfo::registration_resultis only worth reading whenGpuFabricStateisCompleted. Registering a device with the NVLink fabric is async, andstatusis only reported when registration/initialization completes.From the Nvidia docs:
On single-node 8xB300 systems,
nvidia-smireports the following when a device's NVLink is healthy:This can now be represented in Rust like so:
During fabric-manager initialization,
nvidia-smireports the following:Machines stuck in this
in progressstate may have underlying NVLink health issues.