Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

CUDA 12 driver floor: setup takes it from the engine package, not from a constant (#4247, #4188)

Niko122184c7f43358ac
diff --git a/docs/OLDER_GPUS.md b/docs/OLDER_GPUS.md
index ace14e228..fe112d198 100644
--- a/docs/OLDER_GPUS.md
+++ b/docs/OLDER_GPUS.md
@@ -87,9 +87,11 @@ The choice is kept in the model's config (`"cuda": 12`). Starts and `UPDATE.bat`
Setting the model up again chooses again (add `--cuda 12` to keep a forced choice). A Pascal or Volta card added to a model at a
start (`--gpus`) moves that model to the CUDA 12 engine.
-`--cuda 12` is also the way to run Strata with an NVIDIA driver older than 580. The CUDA 12 engine needs driver 528 or newer on
-Windows and 525 on Linux (`CUDA12_MIN_DRIVER` in `setup.py`); setup's "driver too old" stop says so. The Docker `cuda12` image
-asks for 575 ([DOCKER.md](DOCKER.md)). Drivers that old were not tested here.
+`--cuda 12` is also the way to run Strata with an NVIDIA driver older than 580. The oldest driver the CUDA 12 engine runs on is the
+`min_driver` of its package (575.51 or newer at the moment, as in the Docker `cuda12` image, [DOCKER.md](DOCKER.md)). Setup reads it from
+the installed package or the signed update feed and says it in the "driver too old" stop; `strata update` enforces the same number. NVIDIA's
+own table lets CUDA 12 programs start on older drivers (525 on Linux, 527 on Windows), but the packages are built with CUDA 12.9 and were
+not tested on such drivers, so Strata does not promise that range.
### Mixed cards
diff --git a/setup.py b/setup.py
index 2fdd01e0e..4c7a2009c 100644
--- a/setup.py
+++ b/setup.py
@@ -244,9 +244,11 @@ MIN_DRIVER = 580 # CUDA 13.0
CUDA13_MIN_ARCH = 75 # the oldest compute capability CUDA 13 compiles for (sm_75, RTX 20)
CUDA12_ASSET = "strata-windows-x64-cuda12.zip" if WIN else "strata-linux-x64-cuda12.zip"
CUDA12_WHEELS = ["nvidia-cublas-cu12==12.9.1.4", "nvidia-cuda-runtime-cu12==12.9.79"]
-# CUDA 12.x minor-version compatibility (NVIDIA's table: Linux 525.60.13, Windows 527.41); the wheels match the 12.9.1
-# toolkit the CUDA 12 zip is built with (cuBLAS 12.9.1.4, runtime 12.9.79). Not tested on such an old driver here.
-CUDA12_MIN_DRIVER = 528 if WIN else 525
+# The wheels match the 12.9.1 toolkit the CUDA 12 engine is built with (cuBLAS 12.9.1.4, runtime 12.9.79).
+# CUDA12_COMPAT_DRIVER is NVIDIA's minor-version-compatibility line (Linux 525.60.13, Windows 527.41): under it no CUDA 12 program starts, so
+# setup stops there. It is NOT what setup promises: the ready-made packages are built with CUDA 12.9 and carry their own `min_driver`
+# (575.51 / 576.02), which `strata update` enforces. cuda12_min_driver() reads that from the package or the feed (#4247 #4188).
+CUDA12_COMPAT_DRIVER = 528 if WIN else 525
ENGINE12_DIR = "engine-cuda12"
MIN_ENGINE = (0, 1, 46) # versions compare all numbers; v0.1.46: the 0.2 release engine (UPDATE.bat and setup fetch it from the signed feed, #3469 #3437); v0.1.45: Qwen3.6 parallel requests and pictures, fixes #2346 #2372 #2396; v0.1.44.1: CPUs without AVX2 start again (#2324: an illegal instruction before main in the NVFP4 CPU rows), the CUDA 12.0/12.1 toolkits build (#2322), a crashed engine start is named instead of retried as a GPU runtime start, Mac M2 (#2323); v0.1.44: UD-Q4/Q5/Q6_K_XL and Q8_0 Unsloth files in setup (K-quant experts, MMQ prompt library strata_kq), NVFP4 packs, Qwen3.6-35B-A3B, Intel Arc A-series kernels, the pipelined-decode and latency work; v0.1.43.1: the adaptive overlap no longer collapses decode on pinned-host desktops (#1964 #1975), Windows PLE mmap stall (#1984), pinned prompt uploads (#1996), the I/O watchdog allowance; v0.1.43: adaptive-tier copies overlap on CUDA, P100 (sm_60) kernel tables, RDNA4 (gfx1200/gfx1201) defaults (route tail skip, measured PCIe share, 16K prompt chunks, fused IQ3 prompt experts); v0.1.42.1: the GGUF-in-place file tier on Windows unmaps every shard, dual-socket starts judge each NUMA node and STRATA_DROP_CACHE_ON_EXIT, tools/strata_bench.py; v0.1.42: STRATA_ROUTE_TAIL_SKIP=7 default on CUDA (+13-16% decode), the AMD 2-GPU checkpoint fix (H13), Phase 2 fixes and opt-ins; v0.1.41.1 (folded into 0.1.42): the #1576 card order, #1616 stage size, #1595 CPU share, #1630/#1607 Windows HIP chunk cap and commit-limit warning, #1603 parallel-request bookkeeping; v0.1.41: CPU prefill share on by default (NVIDIA, chunks < 1024), --batch-groups auto, the file tier read in batches on Windows, Pascal decode fix, per-arch tables; v0.1.40.3: the #1357 MTP router guard, the #1376 Windows HIP cache floor, #461 runtime DLLs, Intel A750 first-request fix; v0.1.40.2: F4 verify windows, the Linux file tier (#1194), the stager wait (#1057), #1264/#1201/#1139 fixes, opt-in CPU share (#1282), Intel Arc; v0.1.40: --resident-experts on a layer split with the split+resident variant (#848), --kv k8v4 with KV streaming (#711); v0.1.39: the #577 file-tier regression fixed, the OpenAI Responses API (#451, Codex), a reply stuck on one token ended (#606), the head before the arena (#620), effort_position (#458), --vram-reserve hot resize opt-in (#533), PR batch; v0.1.38: prompts faster (one gather per expert group #372, the first chunk's PLE rows beside layer 0 #374, DeltaNet three heads per thread #413), --kv q4_0 prompts on tensor cores (#452), Q5_0 experts on the GPU (#473), IQ4_XS on AVX-2 (#415), unbuffered expert loading on Windows (#357 #362), --peer-device (#531), a 6 GB card starts (#496), PR batch; v0.1.37: a silent engine is restarted (#481), Windows AMD counts the desktop's VRAM (#380 #377 #497), a steadier PCIe probe (#485), fixes #496 #495 #498 #505 #493; v0.1.36: a cancelled prompt logged as read so far (#471), the draft-head hint (#474), UPDATE.bat (#475), --expert-profile-save (#477); v0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB (#467), fixes #460 #459 #446 #447 #457 #448 #444; v0.1.34: AMD on Windows (a ready-made HIP engine), an MCP server for AI assistants (tools/strata_mcp.py), a shorter README; v0.1.33: a portable image encoder again (#411 #412), setup recommends instead of forcing (#406 #403 #364 #384), fixes #352 #365 #369 #371 #375 #393 #408 #414; v0.1.32: split prompts faster (#340), AMD router +12%, Unsloth Q4 in setup, faster Q4 prompts, #326/#327/#342/#344 fixes, PR batch; v0.1.31: Unsloth UD-Q4_K_XL (experimental), GGUF-in-place low-RAM mode, Windows GGUF load 2x, server race + tokenizer fixes, AMD intrinsics; v0.1.30: short prompts faster (streaming from 1024 tokens), resident low-RAM variant, multi-GPU session carve, RDNA4; v0.1.29: sampled answers faster (split top-k), #154 correctness fixes; v0.1.28: the expert cache reserves the draft head, a cancelled request no longer fails the next; v0.1.27: RTX 20 (sm_75) in the ready-made engine, the HIP build without CUDA headers; v0.1.26: the draft layer's prompt pass in batches; v0.1.25: faster prompts (grouping off the copy engine, fused hyper-connection kernels), AMD HIP backend, --kv k8v4; v0.1.24: long prompts faster (QSA select on tensor cores); v0.1.23: image requests honor sampling, 8 GB cards start, batched verify window; v0.1.22: faster prompts (tensor-core attention), multi-GPU across images/steering/KV streaming; v0.1.21: multi-GPU layer split (--gpus); v0.1.20: system-prompt checkpoint, PCIe probe, hit rate; v0.1.19: penalties
# KV bytes per context token and attention layer: 8-bit 1056, rotated 4-bit 576, hybrid K8V4 (8-bit K, 4-bit V) 816
@@ -1645,6 +1647,35 @@ def named_gpus(gpu, gpus) -> list:
return []
+_CUDA12_FLOORS: dict = {}
+
+
+def cuda12_min_driver(feed: bool = False) -> tuple[int, str, str]:
+ """(driver major, the package's figure such as "576.02", where it came from): the oldest NVIDIA driver the CUDA 12 engine runs on, read
+ from the engine package (installed, else - with `feed` - the signed feed, else the figure the packages carry) and not from a constant
+ of setup's own. Remembered for the run. Only a setup run asks the feed (a few seconds at most, once); a plain call reads the disk."""
+ got = _CUDA12_FLOORS.get(True) or _CUDA12_FLOORS.get(feed)
+ if got:
+ return got
+ from strata_control import driver_floor
+ roots = [engine_component.components_dir(), home() / "engine-feed"]
+ source = None
+ if feed and not acquisition.is_forbidden():
+ try:
+ from strata_cli import update_cmd
+ source = update_cmd._feed_source(argparse.Namespace(feed=None), home())
+ except Exception: # noqa: BLE001 - no feed address: the built-in figure
+ source = None
+ try:
+ from strata_control import targets
+ platform_name = targets.host_platform()
+ except Exception: # noqa: BLE001
+ platform_name = ""
+ figure, where = driver_floor.cuda12_floor(platform_name, roots=roots, feed_source=source)
+ _CUDA12_FLOORS[feed] = got = (driver_floor.major(figure), figure, where)
+ return got
+
+
def cuda_choice(archs, cuda=None, driver=None):
"""The CUDA toolkit of one model's engine: (12 or 13, why). 13 (the ready-made engine) unless a card is older
than CUDA 13 supports (Pascal / Volta: CUDA 13 cannot compile for them) - one engine runs per model, so its oldest
@@ -1660,12 +1691,24 @@ def cuda_choice(archs, cuda=None, driver=None):
if old:
return 12, (f"sm_{old[0]} is older than CUDA 13 supports (it dropped Pascal and Volta): this model runs the "
"experimental CUDA 12 engine")
- if driver and CUDA12_MIN_DRIVER <= int(driver) < MIN_DRIVER: # #3843: a driver too old for CUDA 13 still runs the CUDA 12 engine
+ if driver and CUDA12_COMPAT_DRIVER <= int(driver) < MIN_DRIVER: # #3843: a driver too old for CUDA 13 still runs the CUDA 12 engine
return 12, (f"the NVIDIA driver {driver} is older than CUDA 13 needs ({MIN_DRIVER}): this model runs the CUDA 12 engine "
- f"(it works with driver {CUDA12_MIN_DRIVER} or newer; a newer driver from https://www.nvidia.com/drivers gives the CUDA 13 engine)")
+ f"(a newer driver from https://www.nvidia.com/drivers gives the CUDA 13 engine)")
return 13, None
+def cuda12_driver_warning(driver) -> str | None:
+ """A plain warning when the NVIDIA driver is older than the ready-made CUDA 12 engine package needs, or None. The number is the package's
+ own (cuda12_min_driver), the same one `strata update` enforces, so setup no longer says "works" where the update says "no engine" (#4247 #4188).
+ Recommend, never force: setup goes on (an engine compiled here, or one the person brings, may still run)."""
+ floor, figure, where = cuda12_min_driver()
+ if not driver or int(driver) >= floor:
+ return None
+ return (f"the NVIDIA driver {driver} is older than the ready-made CUDA 12 engine package needs ({figure}, {where}): `strata update` will not "
+ "install that package on this PC. Update the driver from https://www.nvidia.com/drivers"
+ + ("; setup compiles the engine here instead, which can run on an older driver" if not WIN else ""))
+
+
def engine_dir(toolkit=13) -> Path:
"""The folder of the engine a model runs: engine/ (CUDA 13, or HIP), engine-cuda12/ (the experimental one)."""
return ROOT / (ENGINE12_DIR if int(toolkit) == 12 else "engine")
@@ -9182,10 +9225,15 @@ def main() -> int:
cuda_tk, why = cuda_choice(gpu["archs"], a.cuda, driver_major(gpu)) # one engine per model: its oldest card decides
if why:
(warn if cuda_tk == 13 or str(a.cuda) == "12" else ok)(f"CUDA {cuda_tk}: {why}")
- min_driver = CUDA12_MIN_DRIVER if cuda_tk == 12 else MIN_DRIVER
+ min_driver = CUDA12_COMPAT_DRIVER if cuda_tk == 12 else MIN_DRIVER
if driver_major(gpu) < min_driver:
- fail(f"the NVIDIA driver is too old ({gpu['driver']}; {min_driver} or newer is needed)",
+ fail(f"the NVIDIA driver is too old ({gpu['driver']}; {min_driver} or newer is needed)"
+ + ("" if cuda_tk == 12 else f" (the CUDA 12 engine package needs {cuda12_min_driver()[1]} or newer, {cuda12_min_driver()[2]})"),
"update it with the NVIDIA App or from https://www.nvidia.com/drivers, restart, and run this again")
+ if cuda_tk == 12:
+ cuda12_min_driver(feed=True) # the CUDA 12 package's driver floor: the installed package, else the signed feed (#4247)
+ if note := cuda12_driver_warning(driver_major(gpu)):
+ warn(note)
if gpu["vram_gb"] < 11:
warn("less than 12 GB of " + ("GPU memory (this APU's carve-out + shared memory)" if gpu.get("uma") else "VRAM")
+ ": Strata will run, but most experts stay on the CPU and it will be slow")
diff --git a/strata_control/driver_floor.py b/strata_control/driver_floor.py
new file mode 100644
index 000000000..a6944296a
--- /dev/null
+++ b/strata_control/driver_floor.py
@@ -0,0 +1,93 @@
+"""The oldest NVIDIA driver the CUDA 12 engine package runs on, taken from the package's own metadata (#4247, #4188).
+
+Setup used to say "the CUDA 12 engine works from driver 528 (525 on Linux)", a number copied from NVIDIA's minor-version-compatibility table,
+while the signed feed's cuda12 packages (built with CUDA 12.9) carry `min_driver` 575.51 / 576.02 and `strata update` refuses them below
+that: a PC on driver 556 was told its engine would work and then told the feed had no engine for it. The floor is now read from
+the package that would run:
+
+1. an installed cuda12 package of this platform (the components folder, setup's own engine-feed folder): its manifest's `min_driver`;
+2. else the signed feed (best effort, a few seconds, never an error): the newest cuda12 package of this platform;
+3. else FALLBACK, the figure the shipped packages carry today (packaging/ENGINE-COMPONENT.md).
+
+Nothing here refuses anything: the callers say the number, and say where it came from.
+"""
+from __future__ import annotations
+
+import threading
+from pathlib import Path
+
+#: What the cuda12 packages carry (packaging/ENGINE-COMPONENT.md: min_driver nvidia 575.51). Only used when no package or feed can be read.
+FALLBACK = "575.51"
+VARIANT = "cuda12"
+FEED_SECONDS = 10.0
+
+
+def major(version: str | None) -> int:
+ """The leading number of a driver version ("576.02" -> 576); 0 when there is none."""
+ try:
+ return int(str(version or "").strip().split(".")[0])
+ except ValueError:
+ return 0
+
+
+def _key(version: str) -> tuple:
+ return tuple(int(p) if p.isdigit() else 0 for p in str(version).replace("-", ".").split("."))
+
+
+def _floor_of(packages, platform: str, variant: str):
+ """The `min_driver` (nvidia) of the newest package of `variant` for `platform`: items with .version, .platform, .backend, .variant, .min_driver."""
+ best = None
+ for item in packages:
+ if item.backend != "cuda" or item.variant != variant or (platform and item.platform != platform):
+ continue
+ need = (item.min_driver or {}).get("nvidia")
+ if not need or not major(need):
+ continue
+ if best is None or _key(item.version) > _key(best.version):
+ best = item
+ return None if best is None else str(best.min_driver["nvidia"])
+
+
+def installed(roots, platform: str, variant: str = VARIANT) -> str | None:
+ """The floor of a cuda12 package already on this PC, from its manifest (no network)."""
+ from strata_control import engine_component as ec
+ found = []
+ for root in roots or ():
+ try:
+ components, _problems = ec.scan(Path(root))
+ except Exception: # noqa: BLE001 - a folder that cannot be read has no answer
+ continue
+ found.extend(components)
+ return _floor_of(found, platform, variant)
+
+
+def from_feed(source: str, platform: str, variant: str = VARIANT, *, seconds: float = FEED_SECONDS) -> str | None:
+ """The floor the signed feed gives a cuda12 package of this platform; None when the feed cannot be read in `seconds` (offline, no key,
+ a feed with no such package). Runs the read on a thread so a hung connection never holds setup up."""
+ answer: list = []
+
+ def read() -> None:
+ try:
+ from strata_control import feed as feedmod
+ from strata_control import signing
+ loaded = feedmod.fetch(source, signing.load_trusted_keys())
+ answer.append(_floor_of(loaded.engine, platform, variant))
+ except Exception: # noqa: BLE001 - the floor is a convenience, never a reason to stop
+ answer.append(None)
+
+ worker = threading.Thread(target=read, daemon=True)
+ worker.start()
+ worker.join(seconds)
+ return answer[0] if answer else None
+
+
+def cuda12_floor(platform: str, *, roots=(), feed_source: str | None = None) -> tuple[str, str]:
+ """(floor, where it came from): "576.02", "as the signed update feed says"."""
+ got = installed(roots, platform)
+ if got:
+ return got, "as the installed engine package says"
+ if feed_source:
+ got = from_feed(feed_source, platform)
+ if got:
+ return got, "as the signed update feed says"
+ return FALLBACK, "the figure the published CUDA 12 packages carry"
diff --git a/tests/terminal/test_driver_floor_028.py b/tests/terminal/test_driver_floor_028.py
new file mode 100644
index 000000000..9dc03b784
--- /dev/null
+++ b/tests/terminal/test_driver_floor_028.py
@@ -0,0 +1,130 @@
+"""The CUDA 12 driver floor comes from the engine package, not from a constant of setup's own (#4247, #4188 part 1). Nothing here starts an
+engine, downloads anything or reads the real profile."""
+from __future__ import annotations
+
+import time
+import unittest
+from types import SimpleNamespace
+from unittest import mock
+
+import setup as S
+from strata_control import driver_floor as DF
+
+
+def package(version: str, need: str | None, *, variant: str = "cuda12", platform: str = "windows-x86_64", backend: str = "cuda"):
+ return SimpleNamespace(version=version, platform=platform, backend=backend, variant=variant, min_driver={"nvidia": need} if need else {})
+
+
+class DriverFloor(unittest.TestCase):
+ def test_the_floor_is_the_newest_cuda12_package_of_this_platform(self):
+ packages = [package("0.1.49", "570.00"), package("0.1.50", "576.02"), package("0.1.50", "580.65", variant="cuda13"),
+ package("0.1.51", "575.51", platform="linux-x86_64"), package("0.1.52", None)]
+ self.assertEqual(DF._floor_of(packages, "windows-x86_64", "cuda12"), "576.02")
+ self.assertEqual(DF._floor_of(packages, "linux-x86_64", "cuda12"), "575.51")
+ self.assertEqual(DF._floor_of(packages, "windows-x86_64", "cuda13"), "580.65")
+ self.assertIsNone(DF._floor_of([package("0.1.50", "580.65", variant="cuda13")], "windows-x86_64", "cuda12"))
+ self.assertIsNone(DF._floor_of([package("0.1.50", "580.65", backend="hip")], "windows-x86_64", "cuda13"))
+
+ def test_an_installed_package_answers_before_the_feed_is_asked(self):
+ with mock.patch("strata_control.engine_component.scan", return_value=([package("0.1.50", "576.02")], [])), \
+ mock.patch.object(DF, "from_feed", side_effect=AssertionError("the feed must not be asked")):
+ self.assertEqual(DF.cuda12_floor("windows-x86_64", roots=["/x"], feed_source="https://feed"),
+ ("576.02", "as the installed engine package says"))
+
+ def test_the_feed_answers_when_no_package_is_installed(self):
+ feed = SimpleNamespace(engine=(package("0.1.50", "576.02"), package("0.1.50", "580.65", variant="cuda13")))
+ with mock.patch("strata_control.engine_component.scan", return_value=([], [])), \
+ mock.patch("strata_control.feed.fetch", return_value=feed), \
+ mock.patch("strata_control.signing.load_trusted_keys", return_value={"k": b"x"}):
+ self.assertEqual(DF.cuda12_floor("windows-x86_64", roots=["/x"], feed_source="https://feed"),
+ ("576.02", "as the signed update feed says"))
+
+ def test_nothing_readable_gives_the_published_figure_and_never_an_error(self):
+ with mock.patch("strata_control.engine_component.scan", side_effect=OSError("no folder")), \
+ mock.patch("strata_control.feed.fetch", side_effect=RuntimeError("offline")):
+ got = DF.cuda12_floor("windows-x86_64", roots=["/x"], feed_source="https://feed")
+ self.assertEqual(got[0], DF.FALLBACK)
+ self.assertEqual(DF.major(DF.FALLBACK), 575)
+ self.assertEqual(DF.cuda12_floor("linux-x86_64"), (DF.FALLBACK, got[1]), "no roots and no feed: the figure, without touching anything")
+
+ def test_a_feed_that_hangs_does_not_hold_setup_up(self):
+ def hang(*a, **k):
+ time.sleep(3)
+ t0 = time.monotonic()
+ with mock.patch("strata_control.feed.fetch", side_effect=hang), mock.patch("strata_control.signing.load_trusted_keys", return_value={"k": b"x"}):
+ self.assertIsNone(DF.from_feed("https://feed", "windows-x86_64", seconds=0.2))
+ self.assertLess(time.monotonic() - t0, 2.0)
+
+ def test_major(self):
+ self.assertEqual([DF.major(v) for v in ("576.02", "560", " 575.51 ", "", None, "x")], [576, 560, 575, 0, 0, 0])
+
+
+class SetupUsesThePackagesFloor(unittest.TestCase):
+ def floor(self, figure: str, where: str = "as the installed engine package says"):
+ return mock.patch.object(S, "cuda12_min_driver", return_value=(DF.major(figure), figure, where))
+
+ def test_setup_no_longer_says_the_cuda12_engine_works_from_528(self):
+ """#4247 #4188: setup said 'it works with driver 528 or newer' while the feed package needed 576.02 and the update refused it."""
+ with self.floor("576.02"):
+ tk, why = S.cuda_choice([86], None, 556)
+ self.assertEqual(tk, 12, "the choice itself is as before: a driver too old for CUDA 13 takes the CUDA 12 engine")
+ self.assertNotIn("528", why)
+ self.assertNotIn("works with driver", why)
+
+ def test_a_driver_under_the_packages_floor_gets_a_warning_with_the_packages_own_number(self):
+ with self.floor("576.02"):
+ note = S.cuda12_driver_warning(556)
+ self.assertIn("576.02", note)
+ self.assertIn("as the installed engine package says", note)
+ self.assertIn("556", note)
+ self.assertIn("strata update", note)
+ self.assertIsNone(S.cuda12_driver_warning(576))
+ self.assertIsNone(S.cuda12_driver_warning(591))
+ self.assertIsNone(S.cuda12_driver_warning(0), "driver unknown: nothing to say")
+
+ def test_a_package_with_a_lower_floor_lowers_what_setup_says_too(self):
+ with self.floor("550.54"):
+ self.assertIsNone(S.cuda12_driver_warning(556))
+ self.assertIn("550.54", S.cuda12_driver_warning(535))
+
+ def test_the_linux_warning_adds_that_a_locally_built_engine_can_run_older(self):
+ with self.floor("575.51"), mock.patch.object(S, "WIN", False):
+ self.assertIn("compiles the engine here", S.cuda12_driver_warning(535))
+ with self.floor("575.51"), mock.patch.object(S, "WIN", True):
+ self.assertNotIn("compiles the engine here", S.cuda12_driver_warning(535))
+
+ def test_the_choice_between_the_engines_is_unchanged(self):
+ with self.floor("576.02"):
+ self.assertEqual(S.cuda_choice([86], None, 580), (13, None))
+ self.assertEqual(S.cuda_choice([86], None, 0), (13, None))
+ self.assertEqual(S.cuda_choice([86], None, 500), (13, None), "under NVIDIA's own CUDA 12 line: setup stops with the driver message")
+ self.assertEqual(S.cuda_choice([70], None, 0)[0], 12)
+ self.assertEqual(S.cuda_choice([86], "12")[0], 12)
+
+ def test_what_stops_setup_is_nvidias_own_line_not_a_promise(self):
+ self.assertEqual(S.CUDA12_COMPAT_DRIVER, 528 if S.WIN else 525)
+ self.assertFalse(hasattr(S, "CUDA12_MIN_DRIVER"))
+
+ def test_cuda12_min_driver_reads_the_installed_package_and_remembers_it(self):
+ with mock.patch.dict(S._CUDA12_FLOORS, clear=True), \
+ mock.patch("strata_control.engine_component.scan", return_value=([package("0.1.50", "576.02", platform=_host())], [])):
+ self.assertEqual(S.cuda12_min_driver(), (576, "576.02", "as the installed engine package says"))
+ self.assertEqual(S.cuda12_min_driver(), (576, "576.02", "as the installed engine package says"))
+
+ def test_a_plain_call_never_asks_the_feed_but_a_setup_run_may(self):
+ with mock.patch.dict(S._CUDA12_FLOORS, clear=True), mock.patch("strata_control.engine_component.scan", return_value=([], [])), \
+ mock.patch.object(DF, "from_feed", return_value="576.02") as feed, mock.patch.object(S.acquisition, "is_forbidden", return_value=False):
+ self.assertEqual(S.cuda12_min_driver()[1], DF.FALLBACK)
+ feed.assert_not_called()
+ self.assertEqual(S.cuda12_min_driver(feed=True)[1], "576.02")
+ self.assertEqual(S.cuda12_min_driver()[1], "576.02", "the answer from the feed is the one kept")
+ self.assertEqual(feed.call_count, 1)
+
+
+def _host() -> str:
+ from strata_control import targets
+ return targets.host_platform()
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tools/test_setup_older_gpus.py b/tools/test_setup_older_gpus.py
index 99ec6bcf9..51d0544a5 100644
--- a/tools/test_setup_older_gpus.py
+++ b/tools/test_setup_older_gpus.py
@@ -208,6 +208,7 @@ class Install(unittest.TestCase):
extra = [mock.patch.object(setup, "get_prebuilt", fake_prebuilt(calls)),
mock.patch.object(setup, "pip_cuda_libs", lambda tk=13: libs.append(tk)),
mock.patch.object(setup, "OLD_GPUS", None),
+ mock.patch.object(setup, "cuda12_min_driver", lambda feed=False: (575, "575.51", "the published figure")), # never the real feed
mock.patch.dict(os.environ, {"STRATA_EXPERIMENTAL_SM60": "", "STRATA_CUDA": "", **(env or {})})]
code, out, cfg, asked = install(ram, found, argv, extra=extra)
return code, out, cfg, calls, libs
@@ -244,6 +245,8 @@ class Install(unittest.TestCase):
def test_a_p40_with_an_older_driver(self):
code, out, cfg, calls, _ = self.run_setup(95.0, [P40], argv_for("qwen", "IQ3_XXS"))
self.assertEqual(code, 0, out[-3000:]) # driver 535: enough for CUDA 12
+ self.assertIn("575.51", out) # #4247: said with the package's own figure, and as a warning, not a stop
+ self.assertNotIn("works with driver 528", out)
self.assertEqual(calls, [12])
def test_a_newer_card_beside_a_v100_is_unchanged(self):