File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 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) {
103103 return l .GetDeviceSpecsBy (identifiers ... )
104104}
105105
106- // GetDeviceSpecsBy is not supported for the gdslib specs .
106+ // GetDeviceSpecsBy returns the device specs for devices with the specified identifiers .
107107func (l * nvmllib ) GetDeviceSpecsBy (identifiers ... device.Identifier ) ([]specs.Device , error ) {
108108 for _ , id := range identifiers {
109109 if id == "all" {
@@ -118,10 +118,23 @@ func (l *nvmllib) GetDeviceSpecsBy(identifiers ...device.Identifier) ([]specs.De
118118 }
119119 defer func () {
120120 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 )
122122 }
123123 }()
124124
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+
125138 nvmlDevices , err := l .getNVMLDevicesByID (identifiers ... )
126139 if err != nil {
127140 return nil , fmt .Errorf ("failed to get NVML device handles: %w" , err )
You can’t perform that action at this time.
0 commit comments