Skip to content

Commit 391bbe8

Browse files
committed
vfio: Add NvSwitches to the list of devices
In when using DGX/HGX systems with virtualization we need to bind the NvSwitchess to vfio-pci as well. This enables us to use two virtualization modes 1. Full passthrough 2. ServiceVM We're explicitly not considering mode 3 with vGPUs. Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
1 parent 69eec27 commit 391bbe8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/vfio-manage/bind.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ func (m bindCommand) bindAll() error {
115115
return fmt.Errorf("failed to get NVIDIA GPUs: %w", err)
116116
}
117117

118+
nvswitches, err := m.nvpciLib.GetNVSwitches()
119+
if err != nil {
120+
return fmt.Errorf("failed to get NVIDIA NVSwitches: %w", err)
121+
}
122+
devices = append(devices, nvswitches...)
123+
118124
for _, dev := range devices {
119125
m.logger.Infof("Binding device %s", dev.Address)
120126
// (cdesiniotis) ideally this should be replaced by a call to nvdev.BindToVFIODriver()

0 commit comments

Comments
 (0)