Skip to content

Commit 9d55deb

Browse files
committed
demos: drop daemon-mode cuda check in favor of preflight-checks/cuda-validation
The demo re-bundled CUDA context/memory validation as a polling daemon check — the exact model deesharma24 rejected on #891, where a long-running daemon contends for GPU memory with active workloads. That review is why CUDA validation re-landed as a preflight init-container (#1384), which runs once before workloads schedule. Remove the daemon check from this demo to avoid contradicting the accepted design: delete checks/cuda_validation.py and drop all references from monitor.py, config.py, metrics.py, the k8s ConfigMap/PrometheusRule, and the tests. README now points at preflight-checks/cuda-validation/ (#1384) as the supported form. Also note in the DaemonSet that the system-services-monitor:0.1.0 tag is a demo-local pin, independent of the Helm chart appVersion.
1 parent 1544d6d commit 9d55deb

9 files changed

Lines changed: 11 additions & 163 deletions

File tree

demos/system-services-monitor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ NVIDIA Fabric Manager can fail and stay broken for weeks undetected. NVSentinel'
1717
| 1 | **Fabric Manager Service** | FM not running, flapping, error state | `nsenter` + `systemctl` |
1818
| 2 | **Critical GPU Services** | persistenced dead | `nsenter` + `systemctl` |
1919
| 3 | **Per-GPU Fabric State** | FM_NOT_STARTED, FM_REGISTRATION_STUCK, FM_FABRIC_ERROR | `nsenter` + `nvidia-smi` |
20-
| 4 | **CUDA Validation** | Context failures, memory errors | PyTorch subprocess |
20+
21+
> **CUDA validation is not part of this monitor.** Polling CUDA context/memory tests from a long-running daemon contends for GPU memory with active workloads (see the [#891 review](https://github.com/NVIDIA/NVSentinel/pull/891)). The supported form is a preflight init-container that runs once before workloads schedule — see [`preflight-checks/cuda-validation/`](../../preflight-checks/cuda-validation/) (#1384).
2122
2223
## Quick Start
2324

@@ -60,7 +61,6 @@ The ServiceMonitor includes PrometheusRule with alerts:
6061
- `FabricManagerFlapping` (warning, 5m)
6162
- `FabricStateUnhealthy` (critical, 5m) -- per-GPU fabric orchestration failure
6263
- `GPUServiceDown` (critical, 3m)
63-
- `CUDAValidationFailed` (critical, 5m)
6464

6565
## Validated On
6666

demos/system-services-monitor/checks/cuda_validation.py

Lines changed: 0 additions & 104 deletions
This file was deleted.

demos/system-services-monitor/config.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class MonitorConfig:
2727

2828
# Check toggles
2929
enable_fabric_check: bool = True
30-
enable_cuda_validation: bool = False # off by default (resource intensive)
31-
32-
# CUDA validation runs at a slower cadence
33-
cuda_validation_interval: int = 600 # seconds
3430

3531
# Services to monitor (besides fabric manager).
3632
# nv-hostengine is monitored by gpu-health-monitor via
@@ -55,8 +51,6 @@ def _bool(val: str) -> bool:
5551
flap_window=int(os.environ.get("FLAP_WINDOW", "600")),
5652
flap_threshold=int(os.environ.get("FLAP_THRESHOLD", "3")),
5753
enable_fabric_check=_bool(os.environ.get("ENABLE_FABRIC_CHECK", "true")),
58-
enable_cuda_validation=_bool(os.environ.get("ENABLE_CUDA_VALIDATION", "false")),
59-
cuda_validation_interval=int(os.environ.get("CUDA_VALIDATION_INTERVAL", "600")),
6054
)
6155

6256
services_env = os.environ.get("GPU_SERVICES")

demos/system-services-monitor/k8s/configmap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ data:
1414
FLAP_WINDOW: "600"
1515
FLAP_THRESHOLD: "3"
1616
ENABLE_FABRIC_CHECK: "true"
17-
ENABLE_CUDA_VALIDATION: "false"
1817
LOG_LEVEL: "INFO"

demos/system-services-monitor/k8s/daemonset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ spec:
3232
- name: monitor
3333
# Pin to a specific semver tag (or @sha256:<digest> in production).
3434
# Demo image; replace with your registry path when deploying.
35+
# 0.1.0 is a demo-local pin, independent of the Helm chart appVersion.
3536
image: system-services-monitor:0.1.0
3637
imagePullPolicy: IfNotPresent
3738
envFrom:

demos/system-services-monitor/k8s/servicemonitor.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,3 @@ spec:
9494
description: >-
9595
NVIDIA service {{ $labels.service_name }} has been down for more
9696
than 3 minutes on {{ $labels.node }}.
97-
98-
# Critical: CUDA validation failed
99-
- alert: CUDAValidationFailed
100-
expr: cuda_validation_passed == 0
101-
for: 5m
102-
labels:
103-
severity: critical
104-
component: system-services-monitor
105-
annotations:
106-
summary: "CUDA validation failed on {{ $labels.node }}"
107-
description: >-
108-
CUDA context creation or memory test failed on {{ $labels.node }}.
109-
One or more GPUs may be in a bad state requiring driver reload or reboot.

demos/system-services-monitor/metrics.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@
3838
["node", "service_name"],
3939
)
4040

41-
# --- CUDA validation ---
42-
cuda_validation_passed = Gauge(
43-
"cuda_validation_passed",
44-
"CUDA validation result (1=passed, 0=failed)",
45-
["node"],
46-
)
47-
4841
# --- Check infrastructure ---
4942
health_check_duration_seconds = Histogram(
5043
"health_check_duration_seconds",

demos/system-services-monitor/monitor.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
fabric_manager_restarts_total,
2525
fabric_manager_last_healthy_seconds,
2626
nvidia_service_up,
27-
cuda_validation_passed,
2827
health_check_duration_seconds,
2928
health_check_errors_total,
3029
)
3130
from checks.service_check import ServiceChecker
32-
from checks.cuda_validation import CUDAValidator
3331

3432
logger = logging.getLogger(__name__)
3533

@@ -41,14 +39,12 @@ def __init__(self, config: MonitorConfig):
4139
self.config = config
4240
self._shutdown = Event()
4341
self._start_time = time.monotonic()
44-
self._last_cuda_check = 0.0
4542

4643
# Initialize checkers
4744
self._service_checker = ServiceChecker(
4845
flap_window=config.flap_window,
4946
flap_threshold=config.flap_threshold,
5047
)
51-
self._cuda_validator = CUDAValidator()
5248

5349
# Track state for cross-check correlation
5450
self._fabric_manager_down = False
@@ -129,22 +125,9 @@ def run_check_cycle(self):
129125
logger.exception("Service check failed")
130126
health_check_errors_total.labels("services").inc()
131127

132-
# --- Check 3: CUDA validation (slower cadence) ---
133-
if self.config.enable_cuda_validation:
134-
now = time.monotonic()
135-
if (now - self._last_cuda_check) >= self.config.cuda_validation_interval:
136-
self._last_cuda_check = now
137-
with health_check_duration_seconds.labels("cuda").time():
138-
try:
139-
cuda_result = self._cuda_validator.check()
140-
cuda_validation_passed.labels(node).set(1 if cuda_result.passed else 0)
141-
if not cuda_result.passed:
142-
logger.error("CUDA validation FAILED on %s: %s",
143-
node, cuda_result.errors or cuda_result.error)
144-
overall_healthy = False
145-
except Exception:
146-
logger.exception("CUDA validation failed")
147-
health_check_errors_total.labels("cuda").inc()
128+
# GPU context/memory validation is intentionally not polled from this
129+
# daemon (it would contend for GPU memory with running workloads). It
130+
# runs as a preflight init-container instead — see the demo README.
148131

149132
# --- Overall health ---
150133
if self._in_grace_period():

demos/system-services-monitor/tests/test_monitor.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def test_defaults(self):
2020
assert config.metrics_port == 9101
2121
assert config.boot_grace_period == 300
2222
assert config.enable_fabric_check is True
23-
assert config.enable_cuda_validation is False
2423
assert "nvidia-fabricmanager" in config.gpu_services
2524
# nv-hostengine is covered by gpu-health-monitor / DCGM and must
2625
# not appear in the default demo service list.
@@ -36,8 +35,6 @@ def test_from_env(self):
3635
"FLAP_WINDOW": "300",
3736
"FLAP_THRESHOLD": "5",
3837
"ENABLE_FABRIC_CHECK": "true",
39-
"ENABLE_CUDA_VALIDATION": "true",
40-
"CUDA_VALIDATION_INTERVAL": "1200",
4138
}
4239
with patch.dict(os.environ, env, clear=False):
4340
config = MonitorConfig.from_env()
@@ -48,8 +45,7 @@ def test_from_env(self):
4845
assert config.node_name == "test-node"
4946
assert config.boot_grace_period == 120
5047
assert config.flap_threshold == 5
51-
assert config.enable_cuda_validation is True
52-
assert config.cuda_validation_interval == 1200
48+
assert config.enable_fabric_check is True
5349

5450
def test_custom_gpu_services(self):
5551
with patch.dict(os.environ, {"GPU_SERVICES": "svc-a, svc-b , svc-c"}, clear=False):
@@ -58,14 +54,14 @@ def test_custom_gpu_services(self):
5854

5955
def test_bool_parsing(self):
6056
for truthy in ("true", "True", "TRUE", "1", "yes", "Yes"):
61-
with patch.dict(os.environ, {"ENABLE_CUDA_VALIDATION": truthy}, clear=False):
57+
with patch.dict(os.environ, {"ENABLE_FABRIC_CHECK": truthy}, clear=False):
6258
config = MonitorConfig.from_env()
63-
assert config.enable_cuda_validation is True
59+
assert config.enable_fabric_check is True
6460

6561
for falsy in ("false", "False", "0", "no", ""):
66-
with patch.dict(os.environ, {"ENABLE_CUDA_VALIDATION": falsy}, clear=False):
62+
with patch.dict(os.environ, {"ENABLE_FABRIC_CHECK": falsy}, clear=False):
6763
config = MonitorConfig.from_env()
68-
assert config.enable_cuda_validation is False
64+
assert config.enable_fabric_check is False
6965

7066

7167
class TestSystemServicesMonitor:
@@ -78,7 +74,6 @@ def _make_monitor(self, **overrides):
7874
"node_name": "test-node",
7975
"boot_grace_period": 0, # no grace period in tests
8076
"enable_fabric_check": True,
81-
"enable_cuda_validation": False,
8277
}
8378
defaults.update(overrides)
8479
config = MonitorConfig(**defaults)

0 commit comments

Comments
 (0)