Skip to content

Commit e55e53d

Browse files
authored
fix: dedicated gpu annotation causing webhook failure issue (#356)
1 parent e628187 commit e55e53d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/gpuallocator/gpuallocator.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,11 @@ func (s *GpuAllocator) handleGPUCreate(ctx context.Context, gpu *tfv1.GPU) {
850850
defer s.storeMutex.Unlock()
851851

852852
if s.gpuStore[key] != nil {
853+
if gpu.Status.GPUModel != "" {
854+
if _, exists := GPUCapacityMap[gpu.Status.GPUModel]; !exists {
855+
GPUCapacityMap[gpu.Status.GPUModel] = *gpu.Status.Capacity
856+
}
857+
}
853858
syncGPUMetadataAndStatusFromCluster(s.gpuStore[key], gpu)
854859
log.V(6).Info("GPU already exists in store", "name", key.Name)
855860
return

internal/webhook/v1/tf_parser.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ func handleDedicatedGPU(pod *corev1.Pod, workloadProfile *tfv1.WorkloadProfile)
258258
workloadProfile.Spec.Resources.Requests.Vram = resource.Vram
259259
workloadProfile.Spec.Resources.Limits.Tflops = resource.Tflops
260260
workloadProfile.Spec.Resources.Limits.Vram = resource.Vram
261+
workloadProfile.Spec.Qos = tfv1.QoSCritical
261262

262263
return nil
263264
}

0 commit comments

Comments
 (0)