MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / applyMIGConfiguration

Function applyMIGConfiguration

controllers/object_controls.go:2795–2806  ·  view source on GitHub ↗

applies MIG related configuration env to container spec

(c *corev1.Container, strategy gpuv1.MIGStrategy)

Source from the content-addressed store, hash-verified

2793
2794// applies MIG related configuration env to container spec
2795func applyMIGConfiguration(c *corev1.Container, strategy gpuv1.MIGStrategy) {
2796 // if not set then let plugin decide this per node(default: none)
2797 if strategy == "" {
2798 setContainerEnv(c, "NVIDIA_MIG_MONITOR_DEVICES", "all")
2799 return
2800 }
2801
2802 setContainerEnv(c, "MIG_STRATEGY", string(strategy))
2803 if strategy != gpuv1.MIGStrategyNone {
2804 setContainerEnv(c, "NVIDIA_MIG_MONITOR_DEVICES", "all")
2805 }
2806}
2807
2808// checks if custom plugin config is provided through a ConfigMap
2809func isCustomPluginConfigSet(pluginConfig *gpuv1.DevicePluginConfig) bool {

Callers 3

TransformDevicePluginFunction · 0.85

Calls 1

setContainerEnvFunction · 0.85

Tested by

no test coverage detected