feat(vgpu-manager): ship and start Fabric Manager on NVSwitch hosts#854
Draft
lexfrei wants to merge 1 commit into
Draft
feat(vgpu-manager): ship and start Fabric Manager on NVSwitch hosts#854lexfrei wants to merge 1 commit into
lexfrei wants to merge 1 commit into
Conversation
The vGPU Manager image did not install Fabric Manager and its entrypoint never started it, so on NVSwitch (HGX) hosts running SR-IOV vGPU the fabric stayed in the packaged mode. In that state a whole-card vGPU guest cannot initialize CUDA, because SR-IOV vGPU requires Fabric Manager to run in vGPU multitenancy mode (FABRIC_MODE=2) rather than the default bare-metal / passthrough mode. Install Fabric Manager and its NSCQ / NVSDM / NVLink Subnet Manager dependencies in the Ubuntu vGPU Manager images, mirroring how the non-vGPU driver image installs them. Before starting the daemon, the entrypoint writes the FABRIC_MODE environment value into fabricmanager.cfg when set; otherwise the packaged default is left unchanged. Fabric Manager is started only on NVSwitch hosts, using the NVLink5 start path when applicable, and is stopped before the driver is unloaded. Backward compatible: when FABRIC_MODE is unset the config is untouched, and on non-NVSwitch hosts the daemon is never started. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Aleksei Sviridkin <f@lex.la>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
RFC / Draft — seeking maintainer design direction before completing. Please do not merge.
On NVSwitch (HGX) systems running SR-IOV vGPU, NVIDIA Fabric Manager must run in vGPU multitenancy mode (
FABRIC_MODE=2) instead of the default bare-metal / passthrough mode (FABRIC_MODE=0). In mode 0 a whole-card vGPU guest cannot initialize CUDA —cuInitfails with error 802 — because the guest's NVLink fabric never becomes usable.Today the vGPU Manager container image ships no Fabric Manager and its entrypoint never starts it (Fabric Manager is installed only in the non-vGPU driver image, gated on
DRIVER_TYPE != vgpu), so SR-IOV vGPU on NVSwitch cannot be brought up through this image.This change makes the vGPU Manager image own Fabric Manager on vGPU nodes:
nvidia-fabricmanager+libnvidia-nscq(and, on driver branch ≥ 570,libnvsdm+nvlsm+infiniband-diagsfor the NVLink5 path) from the public CUDA repository, mirroring how the non-vGPU driver image installs them.FABRIC_MODEand start Fabric Manager on NVSwitch hosts. Before starting the daemon the entrypoint writes theFABRIC_MODEenvironment value intofabricmanager.cfgwhen set (validated as a non-negative integer); when unset the packaged default is left unchanged. Fabric Manager is started only when NVSwitch devices are present — using the NVLink5 start path (nvidia-fabricmanager-start.sh+ NVLSM) on NVLink5+ systems, otherwisenv-fabricmanager— and is stopped before the driver is unloaded.This is the image half of a two-repo change. The operator half — injecting
FABRIC_MODE=2into the vGPU Manager container env on thevm-vgpusandbox-workload path — is NVIDIA/gpu-operator#2602; that env is inert without this change.Open design questions (why this is an RFC)
=${DRIVER_VERSION}*), which resolves because the datacenter driver and its Fabric Manager share a version there. The vGPU Manager image is different: it must carry a Fabric Manager that matches thevgpu-kvmhost driver baked into the image, and the public CUDA repository carries datacenter Fabric Manager whose patch versions do not trackvgpu-kvmpatch versions — so an exact public pin generally would not resolve. As a buildable placeholder this change installs from the public repository bounded to the driver's major branch (=<branch>.*), and Fabric Manager start is fatal on failure so a mismatch surfaces loudly (container restart) rather than silently. Direct question for maintainers: how does NVIDIA intend Fabric Manager to be packaged / sourced for the vGPU Manager image — should it come from the same source as thevgpu-kvmhost driver (so the versions always match), rather than the public datacenter repository?FABRIC_MODEto 2 when the variable is unset? No, by design here: the image is the mechanism (it readsFABRIC_MODEand applies it), and setting the mode is policy that belongs to the operator — #2602 injectsFABRIC_MODE=2on thevm-vgpusandbox-workload path. So an unsetFABRIC_MODEleaves the packagedfabricmanager.cfgdefault unchanged, which keeps the image a faithful consumer, avoids double-defaulting with the operator, and leaves existing non-multitenancy vGPU deployments unaffected on upgrade. Hardcoding mode 2 in the image would break that backward compatibility for standalone use and duplicate the operator's policy.Out of scope: the host-installed-driver path (
driver.enabled=false), and per-VM fabric-partition activation (a device-plugin concern).Related: NVIDIA/gpu-operator#2602 (operator half), NVIDIA/gpu-operator#2594 (adjacent SR-IOV / vendor-specific VFIO vGPU device-creation gap on the same class of hardware).
Testing
shellcheckon the changed entrypoints andhadolinton the changed Dockerfiles introduce no new findings versus the base branch.FABRIC_MODE=2rewrites an existingFABRIC_MODE=0; unsetFABRIC_MODEleaves the config untouched; a non-numericFABRIC_MODEis rejected with a warning; and a stale or empty Fabric Manager pid file no longer aborts driver teardown on shutdown.docker buildof the vGPU Manager image was not run: it requires the proprietaryNVIDIA-Linux-<arch>-<version>-vgpu-kvm.runhost-driver installer in the build context, which is not publicly downloadable. End-to-end behavior on NVSwitch hardware depends on the companion operator change and cannot run in CI here.