Skip to content

Commit

Permalink
Merge branch 'bugfix-new-device' into 'master'
Browse files Browse the repository at this point in the history
Use NewDeviceLite when constructing MIG device map

See merge request nvidia/kubernetes/device-plugin!74
  • Loading branch information
klueska committed Feb 8, 2021
2 parents e9f44f5 + 297cb71 commit 68123eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mig-strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (s *migStrategySingle) GetPlugins() []*NvidiaDevicePlugin {
}

if err := devices.AssertAllMigEnabledDevicesAreValid(); err != nil {
panic(fmt.Errorf("At least one device with migEnabled=true was not configured corectly: %v", err))
panic(fmt.Errorf("At least one device with migEnabled=true was not configured correctly: %v", err))
}

resources := make(MigStrategyResourceSet)
Expand Down Expand Up @@ -168,7 +168,7 @@ func (s *migStrategyMixed) GetPlugins() []*NvidiaDevicePlugin {
devices := NewMIGCapableDevices()

if err := devices.AssertAllMigEnabledDevicesAreValid(); err != nil {
panic(fmt.Errorf("At least one device with migEnabled=true was not configured corectly: %v", err))
panic(fmt.Errorf("At least one device with migEnabled=true was not configured correctly: %v", err))
}

resources := make(MigStrategyResourceSet)
Expand Down
4 changes: 2 additions & 2 deletions mig.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (devices *MIGCapableDevices) getDevicesMap() (map[bool][]*nvml.Device, erro

migEnabledDevicesMap := make(map[bool][]*nvml.Device)
for i := uint(0); i < n; i++ {
d, err := nvml.NewDevice(i)
d, err := nvml.NewDeviceLite(i)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -81,7 +81,7 @@ func (devices *MIGCapableDevices) AssertAllMigEnabledDevicesAreValid() error {
return err
}
if len(migs) == 0 {
return fmt.Errorf("No MIG devices associated with %v", d)
return fmt.Errorf("No MIG devices associated with %v: %v", d.Path, d.UUID)
}
}
return nil
Expand Down

0 comments on commit 68123eb

Please sign in to comment.