diff --git a/internal/controller/datadogagent/feature/gpu/envvar.go b/internal/controller/datadogagent/feature/gpu/envvar.go index 46940b287b..8213b2f35a 100644 --- a/internal/controller/datadogagent/feature/gpu/envvar.go +++ b/internal/controller/datadogagent/feature/gpu/envvar.go @@ -17,3 +17,6 @@ const NVIDIAVisibleDevicesEnvVar = "NVIDIA_VISIBLE_DEVICES" // DDPatchCgroupPermissionsEnvVar is the name of the system-probe gpu_monitoring module cgroup permissions patch knob const DDPatchCgroupPermissionsEnvVar = "DD_GPU_MONITORING_CONFIGURE_CGROUP_PERMS" + +// DDEnableEBPFProbesEnvVar is the name of the system-probe gpu_monitoring module eBPF probes enablement knob +const DDEnableEBPFProbesEnvVar = "DD_GPU_MONITORING_ENABLE_EBPF_PROBES" diff --git a/internal/controller/datadogagent/feature/gpu/feature.go b/internal/controller/datadogagent/feature/gpu/feature.go index ad2a949a1d..99f34d9a2c 100644 --- a/internal/controller/datadogagent/feature/gpu/feature.go +++ b/internal/controller/datadogagent/feature/gpu/feature.go @@ -127,6 +127,21 @@ func configureSystemProbe(managers feature.PodTemplateManagers) { // add the env var to the core agent as well, to prevent config mismatches in runtime managers.EnvVar().AddEnvVarToContainer(apicommon.CoreAgentContainerName, enableSPEnvVar) + // In privileged mode the eBPF probes are disabled, as GPU monitoring relies on + // the privileged host access rather than the eBPF probes. + disableEBPFProbesEnvVar := &corev1.EnvVar{ + Name: DDEnableEBPFProbesEnvVar, + Value: "false", + } + + // disable the eBPF probes in system-probe + managers.EnvVar().AddEnvVarToContainer(apicommon.SystemProbeContainerName, disableEBPFProbesEnvVar) + + // add the env var to the core agent as well, so both containers agree that the + // eBPF probes are disabled and the core GPU check does not poll a system-probe + // module that has the probes turned off + managers.EnvVar().AddEnvVarToContainer(apicommon.CoreAgentContainerName, disableEBPFProbesEnvVar) + // annotations managers.Annotation().AddAnnotation(common.SystemProbeAppArmorAnnotationKey, common.SystemProbeAppArmorAnnotationValue) diff --git a/internal/controller/datadogagent/feature/gpu/feature_test.go b/internal/controller/datadogagent/feature/gpu/feature_test.go index 6824e6640d..3ae8a55819 100644 --- a/internal/controller/datadogagent/feature/gpu/feature_test.go +++ b/internal/controller/datadogagent/feature/gpu/feature_test.go @@ -193,6 +193,10 @@ func Test_GPUMonitoringFeature_Configure(t *testing.T) { Name: DDEnableGPUProbeEnvVar, Value: "true", }, + { + Name: DDEnableEBPFProbesEnvVar, + Value: "false", + }, { Name: NVIDIAVisibleDevicesEnvVar, Value: "all", @@ -216,6 +220,10 @@ func Test_GPUMonitoringFeature_Configure(t *testing.T) { Name: DDEnableGPUProbeEnvVar, Value: "true", }, + { + Name: DDEnableEBPFProbesEnvVar, + Value: "false", + }, { Name: common.DDSystemProbeSocket, Value: common.DefaultSystemProbeSocketPath,