Skip to content

Commit

Permalink
Merge pull request #806 from klueska/warn-mixed-no-mig-devices
Browse files Browse the repository at this point in the history
Warn instead of error when a GPU has no MIG devices with mixed strategy
  • Loading branch information
klueska authored Jul 9, 2024
2 parents 58883b7 + 1df05f8 commit e379075
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/rm/device_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/NVIDIA/go-nvlib/pkg/nvlib/device"
"github.com/NVIDIA/go-nvlib/pkg/nvlib/info"
"github.com/NVIDIA/go-nvml/pkg/nvml"
"k8s.io/klog/v2"

spec "github.com/NVIDIA/k8s-device-plugin/api/config/v1"
)
Expand Down Expand Up @@ -164,9 +165,11 @@ func (b *deviceMapBuilder) assertAllMigDevicesAreValid(uniform bool) error {
if err != nil {
return err
}
if len(migDevices) == 0 {
i := 0
return fmt.Errorf("device %v has an invalid MIG configuration", i)
if uniform && len(migDevices) == 0 {
return fmt.Errorf("device %v has no MIG devices configured", i)
}
if !uniform && len(migDevices) == 0 {
klog.Warningf("device %v has no MIG devices configured", i)
}
return nil
})
Expand Down

0 comments on commit e379075

Please sign in to comment.