File tree 1 file changed +10
-8
lines changed
pkg/sensors/accelerator/devices
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,12 @@ type gpuGraceACPI struct {
55
55
}
56
56
57
57
func graceCheck (r * Registry ) {
58
- if err := graceAccImpl .InitLib (); err != nil {
59
- klog .V (5 ).Infof ("Error initializing Grace GPU: %v" , err )
58
+ if err := graceAccImpl .Init (); err != nil {
59
+ klog .V (5 ).Infof ("Grace GPU initialization failed: %v" , err )
60
+ return
61
+ }
62
+ if ! graceAccImpl .IsDeviceCollectionSupported () {
63
+ klog .V (5 ).Infof ("No Grace GPU power modules found" )
60
64
return
61
65
}
62
66
graceType = GRACE
@@ -68,10 +72,6 @@ func graceCheck(r *Registry) {
68
72
}
69
73
70
74
func graceDeviceStartup () Device {
71
- if err := graceAccImpl .Init (); err != nil {
72
- klog .Errorf ("failed to init Grace GPU device: %v" , err )
73
- return nil
74
- }
75
75
return & graceAccImpl
76
76
}
77
77
@@ -163,9 +163,11 @@ func (g *gpuGraceACPI) Init() error {
163
163
return err
164
164
}
165
165
g .collectionSupported = len (g .modulePowerPaths ) > 0
166
- if g .collectionSupported {
167
- klog . V ( 4 ). Infof ( "Detected Grace Hopper system with %d GPUs" , len ( g . modulePowerPaths ) )
166
+ if ! g .collectionSupported {
167
+ return fmt . Errorf ( "no Grace GPU power modules found" )
168
168
}
169
+
170
+ klog .V (4 ).Infof ("Detected Grace Hopper system with %d GPUs" , len (g .modulePowerPaths ))
169
171
return nil
170
172
}
171
173
You can’t perform that action at this time.
0 commit comments