File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ func (l *nvmllib) GetDeviceSpecsByID(ids ...string) ([]specs.Device, error) {
103
103
return l .GetDeviceSpecsBy (identifiers ... )
104
104
}
105
105
106
- // GetDeviceSpecsBy is not supported for the gdslib specs .
106
+ // GetDeviceSpecsBy returns the device specs for devices with the specified identifiers .
107
107
func (l * nvmllib ) GetDeviceSpecsBy (identifiers ... device.Identifier ) ([]specs.Device , error ) {
108
108
for _ , id := range identifiers {
109
109
if id == "all" {
@@ -118,10 +118,23 @@ func (l *nvmllib) GetDeviceSpecsBy(identifiers ...device.Identifier) ([]specs.De
118
118
}
119
119
defer func () {
120
120
if r := l .nvmllib .Shutdown (); r != nvml .SUCCESS {
121
- l .logger .Warningf ("failed to shutdown NVML: %w " , r )
121
+ l .logger .Warningf ("failed to shutdown NVML: %v " , r )
122
122
}
123
123
}()
124
124
125
+ if l .nvsandboxutilslib != nil {
126
+ if r := l .nvsandboxutilslib .Init (l .driverRoot ); r != nvsandboxutils .SUCCESS {
127
+ l .logger .Warningf ("Failed to init nvsandboxutils: %v; ignoring" , r )
128
+ l .nvsandboxutilslib = nil
129
+ }
130
+ defer func () {
131
+ if l .nvsandboxutilslib == nil {
132
+ return
133
+ }
134
+ _ = l .nvsandboxutilslib .Shutdown ()
135
+ }()
136
+ }
137
+
125
138
nvmlDevices , err := l .getNVMLDevicesByID (identifiers ... )
126
139
if err != nil {
127
140
return nil , fmt .Errorf ("failed to get NVML device handles: %w" , err )
You can’t perform that action at this time.
0 commit comments