File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ func main() {
102
102
os .Exit (1 )
103
103
}
104
104
105
- totalTFlops := resource .MustParse ( "0" )
106
- totalVRAM := resource .MustParse ( "0Ki" )
107
- availableTFlops := resource .MustParse ( "0" )
108
- availableVRAM := resource .MustParse ( "0Ki" )
105
+ totalTFlops := resource.Quantity {}
106
+ totalVRAM := resource.Quantity {}
107
+ availableTFlops := resource.Quantity {}
108
+ availableVRAM := resource.Quantity {}
109
109
110
110
allDeviceIDs := make ([]string , 0 )
111
111
@@ -140,7 +140,7 @@ func main() {
140
140
})
141
141
tflops := info .Fp16TFlops
142
142
if ! ok {
143
- tflops = resource .MustParse ( "0" )
143
+ tflops = resource.Quantity {}
144
144
}
145
145
gpu := & tfv1.GPU {
146
146
ObjectMeta : metav1.ObjectMeta {
Original file line number Diff line number Diff line change @@ -208,6 +208,18 @@ func (r *GPUNodeReconciler) checkStatusAndUpdateVirtualCapacity(ctx context.Cont
208
208
return true , nil
209
209
}
210
210
211
+ node .Status .AvailableVRAM = resource.Quantity {}
212
+ node .Status .AvailableTFlops = resource.Quantity {}
213
+ node .Status .TotalTFlops = resource.Quantity {}
214
+ node .Status .TotalVRAM = resource.Quantity {}
215
+
216
+ for _ , gpu := range gpuList {
217
+ node .Status .AvailableVRAM .Add (gpu .Status .Available .Vram )
218
+ node .Status .AvailableTFlops .Add (gpu .Status .Available .Tflops )
219
+ node .Status .TotalVRAM .Add (gpu .Status .Capacity .Vram )
220
+ node .Status .TotalTFlops .Add (gpu .Status .Capacity .Tflops )
221
+ }
222
+
211
223
virtualVRAM , virtualTFlops := r .CalculateVirtualCapacity (node , poolObj )
212
224
node .Status .VirtualTFlops = virtualTFlops
213
225
node .Status .VirtualVRAM = virtualVRAM
You can’t perform that action at this time.
0 commit comments