Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/gpu-kubelet-plugin/vfio-device.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ func (vm *VfioPciManager) verifyDisabledVFs(pciBusID string) error {
if err != nil {
return err
}
if gpu == nil {
return fmt.Errorf("no GPU found at PCI bus ID %q", pciBusID)
}
// PhysicalFunction is nil for GPUs that do not support SR-IOV (e.g. T400).
// A nil PhysicalFunction means no VFs can exist, so it is safe to proceed.
if gpu.SriovInfo.PhysicalFunction == nil {
return nil
}
numVFs := gpu.SriovInfo.PhysicalFunction.NumVFs
if numVFs > 0 {
return fmt.Errorf("gpu has %d VFs, cannot unbind", numVFs)
Expand Down