Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Give the real-host NVIDIA probe test a budget that a busy driver can meet (#12026)

Daniel Han88507f8e6426
diff --git a/tests/studio/install/test_nvidia_library_probe.py b/tests/studio/install/test_nvidia_library_probe.py
index af023875213..cd2541af6f6 100644
--- a/tests/studio/install/test_nvidia_library_probe.py
+++ b/tests/studio/install/test_nvidia_library_probe.py
@@ -223,10 +223,21 @@ class TestProbeModule:
)
def test_on_a_real_host_the_library_agrees_with_nvidia_smi(self, monkeypatch):
monkeypatch.delenv("UNSLOTH_NVIDIA_LIBRARY_PROBE", raising = False)
- listing = subprocess.run(["nvidia-smi", "-L"], capture_output = True, text = True, timeout = 60)
+ try:
+ listing = subprocess.run(
+ ["nvidia-smi", "-L"], capture_output = True, text = True, timeout = 60
+ )
+ except (OSError, subprocess.TimeoutExpired) as exc:
+ # No reference to compare against: nvidia-smi is missing, or the driver is too busy
+ # to answer. Either way this says nothing about the library.
+ pytest.skip(f"nvidia-smi gave no listing: {exc}")
if listing.returncode != 0 or "GPU " not in listing.stdout:
pytest.skip("nvidia-smi lists no GPU here")
- inv = PROBE.probe()
+ # This checks what the library reports, not how fast. On a host whose GPUs are busy, NVML
+ # init alone has taken over 50 s, past the runtime's 20 s default, and probe() then answers
+ # None by design so the runtime falls back to nvidia-smi. Give it the budget the listing
+ # above gets, and more, so a slow driver is not read as a disagreement.
+ inv = PROBE.probe(timeout = 180)
assert inv is not None and inv.source == "nvml"
assert len(inv.devices) == sum(
1 for line in listing.stdout.splitlines() if line.startswith("GPU ")