mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-22 00:08:11 +00:00
Check for required device majors
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
05632c0a40
commit
315f4adb8f
@ -40,12 +40,23 @@ func newAllPossible(logger *logrus.Logger, driverRoot string) (nodeLister, error
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed reading device majors: %v", err)
|
||||
}
|
||||
|
||||
var requiredMajors []devices.Name
|
||||
migCaps, err := nvcaps.NewMigCaps()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read MIG caps: %v", err)
|
||||
}
|
||||
if migCaps == nil {
|
||||
migCaps = make(nvcaps.MigCaps)
|
||||
} else {
|
||||
requiredMajors = append(requiredMajors, devices.NVIDIACaps)
|
||||
}
|
||||
|
||||
requiredMajors = append(requiredMajors, devices.NVIDIAGPU, devices.NVIDIAUVM)
|
||||
for _, name := range requiredMajors {
|
||||
if !deviceMajors.Exists(name) {
|
||||
return nil, fmt.Errorf("missing required device major %s", name)
|
||||
}
|
||||
}
|
||||
|
||||
l := allPossible{
|
||||
|
Loading…
Reference in New Issue
Block a user