Skip to content

Commit c0f5135

Browse files
authored
fix(hypervisor): add DEVICE_PLUGIN_PATH env to hypervisor container (#454)
1 parent 931c6c1 commit c0f5135

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/constants/env.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ const (
145145
HypervisorMetricsFormatEnv = "TF_HYPERVISOR_METRICS_FORMAT"
146146
HypervisorMetricsExtraLabelsEnv = "TF_HYPERVISOR_METRICS_EXTRA_LABELS"
147147
HypervisorDetectUsedGPUEnv = "DETECT_IN_USED_GPUS"
148+
HypervisorDevicePluginPathEnv = "DEVICE_PLUGIN_PATH"
148149

149150
// Add ptrace capability to hypervisor container, to trace all host PID using GPU
150151
SystemPtraceCapability = "SYS_PTRACE"

internal/utils/compose.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,11 @@ func composeHypervisorContainer(spec *v1.PodSpec, pool *tfv1.GPUPool, enableVect
641641
spec.Containers[0].Image = pool.Spec.ComponentConfig.Hypervisor.Image
642642
}
643643

644+
spec.Containers[0].Env = append(spec.Containers[0].Env, v1.EnvVar{
645+
Name: constants.HypervisorDevicePluginPathEnv,
646+
Value: constants.KubeletDevicePluginPath,
647+
})
648+
644649
if len(spec.Containers[0].Resources.Requests) == 0 {
645650
spec.Containers[0].Resources.Requests = hypervisorDefaultRequests
646651
}

0 commit comments

Comments
 (0)