Skip to content

Commit 00c68bb

Browse files
authored
Add flag (#1840)
1 parent e45b675 commit 00c68bb

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

internal/controller/datadogagent/feature/gpu/envvar.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
package gpu
77

88
const DDEnableGPUMonitoringEnvVar = "DD_GPU_MONITORING_ENABLED"
9+
const DDEnableNVMLDetectionEnvVar = "DD_ENABLE_NVML_DETECTION"
910
const NVIDIAVisibleDevicesEnvVar = "NVIDIA_VISIBLE_DEVICES"

internal/controller/datadogagent/feature/gpu/feature.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ func (f *gpuFeature) ManageNodeAgent(managers feature.PodTemplateManagers, _ str
138138
// Both in the core agent and the system probe
139139
managers.EnvVar().AddEnvVarToContainers([]apicommon.AgentContainerName{apicommon.CoreAgentContainerName, apicommon.SystemProbeContainerName}, enableEnvVar)
140140

141+
// env var to enable NVML detection, so that workloadmeta features depending on it
142+
// can be enabled
143+
nvmlDetectionEnvVar := &corev1.EnvVar{
144+
Name: DDEnableNVMLDetectionEnvVar,
145+
Value: "true",
146+
}
147+
managers.EnvVar().AddEnvVarToContainers([]apicommon.AgentContainerName{apicommon.CoreAgentContainerName}, nvmlDetectionEnvVar)
148+
141149
// The agent check does not need to be manually enabled, the init config container will
142150
// check if GPU monitoring is enabled and will enable the check automatically (see
143151
// Dockerfiles/agent/cont-init.d/60-sysprobe-check.sh in the datadog-agent repo).

internal/controller/datadogagent/feature/gpu/feature_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ func Test_GPUMonitoringFeature_Configure(t *testing.T) {
170170
Name: common.DDKubernetesPodResourcesSocket,
171171
Value: path.Join(podResourcesSocketPath, "kubelet.sock"),
172172
},
173+
{
174+
Name: DDEnableNVMLDetectionEnvVar,
175+
Value: "true",
176+
},
173177
}, wantSystemProbeEnvVars...)
174178

175179
agentEnvVars := mgr.EnvVarMgr.EnvVarsByC[apicommon.CoreAgentContainerName]

0 commit comments

Comments
 (0)