File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ func main() {
102102 os .Exit (1 )
103103 }
104104
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 {}
109109
110110 allDeviceIDs := make ([]string , 0 )
111111
@@ -140,7 +140,7 @@ func main() {
140140 })
141141 tflops := info .Fp16TFlops
142142 if ! ok {
143- tflops = resource .MustParse ( "0" )
143+ tflops = resource.Quantity {}
144144 }
145145 gpu := & tfv1.GPU {
146146 ObjectMeta : metav1.ObjectMeta {
Original file line number Diff line number Diff line change @@ -208,6 +208,18 @@ func (r *GPUNodeReconciler) checkStatusAndUpdateVirtualCapacity(ctx context.Cont
208208 return true , nil
209209 }
210210
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+
211223 virtualVRAM , virtualTFlops := r .CalculateVirtualCapacity (node , poolObj )
212224 node .Status .VirtualTFlops = virtualTFlops
213225 node .Status .VirtualVRAM = virtualVRAM
You can’t perform that action at this time.
0 commit comments