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++

setup: Maxwell gets a warning with the build recipe, not an env switch (#3218)

Niko1221c966d7ad8988
diff --git a/docs/OLDER_GPUS.md b/docs/OLDER_GPUS.md
index 88036809c..080d9ee7a 100644
--- a/docs/OLDER_GPUS.md
+++ b/docs/OLDER_GPUS.md
@@ -55,8 +55,9 @@ cmake --build build -j
```
CMake prints a warning for sm_52 and goes on. A release build still needs sm_75 or newer, and without `STRATA_EXPERIMENTAL_SM60=ON`
-the build stops as before. For `setup.py` to list a Maxwell card as usable, set `STRATA_EXPERIMENTAL_SM52=1`; setup warns and uses
-the CUDA 12 path. If you try it, please post a short chat and one code answer from the card.
+the build stops as before. `setup.py` does not install an engine for a Maxwell card, because none of the ready-made engines holds
+code for it. On a PC with only Maxwell cards it lists the card as not supported, prints this recipe as a warning and stops. If you
+try the build, please post a short chat and one code answer from the card.
## NVIDIA: the CUDA 12 engine
diff --git a/setup.py b/setup.py
index de04c5971..7723eb598 100644
--- a/setup.py
+++ b/setup.py
@@ -1548,12 +1548,27 @@ def experimental_sm60() -> bool:
def sm60_card(arch) -> bool:
- """Pascal (6.x) and Volta (7.0) cards; Maxwell 5.2 (#3218) only for a tester who set STRATA_EXPERIMENTAL_SM52=1,
- because the ready-made CUDA 12 engine holds no sm_52 code: a Maxwell card is built from source, by that tester."""
- a = int(arch)
- if a == 52:
- return os.environ.get("STRATA_EXPERIMENTAL_SM52", "").strip() == "1"
- return 60 <= a <= 70
+ return 60 <= int(arch) <= 70
+
+
+def maxwell_card(arch) -> bool:
+ """#3218: Maxwell (5.x). No ready-made engine holds code for it; it is a source build (docs/OLDER_GPUS.md)."""
+ return 50 <= int(arch) < 60
+
+
+def maxwell_note(found) -> str:
+ """#3218: what to tell a PC whose only NVIDIA cards are Maxwell: setup cannot install an engine for it, and a
+ source build exists. Empty when there is no Maxwell card. A warning with the way forward, never a switch: setup
+ does not route a Maxwell card to an engine that holds no code for it."""
+ cards = [g for g in found if maxwell_card(g["arch"])]
+ if not cards:
+ return ""
+ names = ", ".join(f"GPU {g['index']} ({g['name']})" for g in cards)
+ return (f"{names}: Maxwell (compute capability {cc(cards[0])}). No ready-made Strata engine holds code for it, so "
+ "setup cannot install one. One reporter built the engine from source for two Quadro M6000 with a CUDA 12.x "
+ "toolkit (cmake -B build -G Ninja -DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES=52) and saw about "
+ "22 tokens a second with a 1-bit Qwen3.8-Flash-Next; nobody has checked the answer text yet. Steps and "
+ "caveats: docs/OLDER_GPUS.md. A card of the RTX 20 series or newer runs the ready-made engine")
def old_gpus_opt_in(found, named=(), cuda=None, other=False):
@@ -1622,7 +1637,8 @@ def gpu_problem(g, together=False):
if int(g["arch"]) < 75 and not (sm60_card(g["arch"]) and experimental_sm60()):
return (f"not supported - older than the RTX 20 series (compute capability {cc(g)}; Strata needs 7.5 or "
"newer" + ("; experimental: choose it with --gpu " + str(g["index"]) + " (the CUDA 12 engine, "
- "docs/OLDER_GPUS.md)" if sm60_card(g["arch"]) else "") + ")")
+ "docs/OLDER_GPUS.md)" if sm60_card(g["arch"]) else
+ "; Maxwell only runs from a source build, docs/OLDER_GPUS.md" if maxwell_card(g["arch"]) else "") + ")")
if together and g["vram_gb"] < SPLIT_MIN_VRAM_GB - 0.5:
return (f"not supported together with other GPUs - {g['vram_gb']:.0f} GB of VRAM (a card sharing the model "
f"needs {SPLIT_MIN_VRAM_GB} GB or more)")
@@ -8886,11 +8902,9 @@ def main() -> int:
if OLD_GPUS and a.backend != "hip":
warn(f"older NVIDIA GPUs (Pascal / Volta) can be used ({OLD_GPUS}): experimental, through a second engine "
"built with CUDA 12 (docs/OLDER_GPUS.md)")
- if any(int(g["arch"]) == 52 for g in found):
- warn("a Maxwell card (compute capability 5.2) has no fast half-precision path; it was tested by one reporter "
- "only, on a source build (-DSTRATA_EXPERIMENTAL_SM60=ON, CUDA 12.x). Check that the answer text reads "
- "correctly (docs/OLDER_GPUS.md)")
nv_ok = any(gpu_problem(g) is None for g in found)
+ if not nv_ok and not amd_ok and a.backend != "hip" and maxwell_note(found): # #3218: a warning with the way forward
+ warn(maxwell_note(found))
hip = a.backend == "hip" or (a.backend is None and not nv_ok and bool(amd_ok))
if a.backend is None and nv_ok and amd_ok:
# both kinds of card: asked (a first run on such a PC used to take NVIDIA without mentioning the Radeon)
diff --git a/tools/test_setup_older_gpus.py b/tools/test_setup_older_gpus.py
index f66d121ef..99ec6bcf9 100644
--- a/tools/test_setup_older_gpus.py
+++ b/tools/test_setup_older_gpus.py
@@ -88,24 +88,33 @@ class OptIn(unittest.TestCase):
self.assertIn("only kind", setup.old_gpus_opt_in([V100]))
self.assertIsNone(setup.old_gpus_opt_in([V100], other=True)) # an AMD card it can use instead
self.assertIsNone(setup.old_gpus_opt_in([card(0, "GTX 980", 4.0, "52")]))
- # #3218: Maxwell only for a tester who sets STRATA_EXPERIMENTAL_SM52=1 (the default stays unchanged)
+ # #3218: a Maxwell card is never routed to the CUDA 12 engine (it holds no sm_52 code), with or without a switch
m6000 = card(0, "Quadro M6000", 24.0, "52")
- self.assertFalse(setup.sm60_card("52"))
self.assertTrue(setup.sm60_card("60") and setup.sm60_card("70") and not setup.sm60_card("75"))
+ self.assertFalse(setup.sm60_card("52"))
self.assertIn("not supported", setup.gpu_problem(m6000))
+ self.assertIn("Maxwell only runs from a source build", setup.gpu_problem(m6000))
self.assertNotIn("experimental: choose it", setup.gpu_problem(m6000))
- with mock.patch.dict(os.environ, {"STRATA_EXPERIMENTAL_SM52": "1"}):
- self.assertTrue(setup.sm60_card("52"))
- self.assertFalse(setup.sm60_card("50"))
- self.assertIn("experimental: choose it", setup.gpu_problem(m6000))
- self.assertIn("only kind", setup.old_gpus_opt_in([m6000]))
- self.assertIsNone(setup.old_gpus_opt_in([rtx, m6000])) # a newer card keeps winning
- self.assertEqual(setup.cuda_choice([52])[0], 12)
- with mock.patch.dict(os.environ, {"STRATA_EXPERIMENTAL_SM60": "1"}):
- self.assertIsNone(setup.gpu_problem(m6000)) # warned, not refused
+ self.assertIsNone(setup.old_gpus_opt_in([m6000]))
+ for env in ({"STRATA_EXPERIMENTAL_SM60": "1"}, {"STRATA_EXPERIMENTAL_SM52": "1"}):
+ with mock.patch.dict(os.environ, env):
+ self.assertFalse(setup.sm60_card("52"))
+ self.assertIn("not supported", setup.gpu_problem(m6000))
+ self.assertIsNone(setup.old_gpus_opt_in([m6000]))
+ self.assertIsNone(setup.old_gpus_opt_in([m6000], named=[0], cuda="12")) # naming it does not admit it either
with mock.patch.dict(os.environ, {"STRATA_EXPERIMENTAL_SM60": "1"}):
self.assertEqual(setup.old_gpus_opt_in([rtx, v100]), "STRATA_EXPERIMENTAL_SM60=1")
+ def test_maxwell_note_is_a_warning_with_the_recipe(self):
+ m6000 = card(0, "Quadro M6000", 24.0, "52")
+ note = setup.maxwell_note([m6000, {**m6000, "index": 1}])
+ self.assertIn("GPU 0 (Quadro M6000), GPU 1 (Quadro M6000)", note)
+ self.assertIn("-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES=52", note)
+ self.assertIn("docs/OLDER_GPUS.md", note)
+ self.assertNotIn("STRATA_EXPERIMENTAL_SM52", note) # no switch the user has to set
+ self.assertEqual(setup.maxwell_note([V100, P40]), "")
+ self.assertEqual(setup.maxwell_note([]), "")
+
def test_named(self):
self.assertEqual(setup.named_gpus(None, "0,2"), [0, 2])
self.assertEqual(setup.named_gpus(1, None), [1])
@@ -212,6 +221,26 @@ class Install(unittest.TestCase):
self.assertIn("sm_70 is older than CUDA 13 supports", out)
self.assertIn("experimental", out)
+ def test_a_maxwell_pc_is_warned_with_the_recipe_and_gets_no_engine(self):
+ """#3218: no ready-made engine holds sm_52 code, so none is installed; the way forward is printed, with or
+ without any switch (a user never has to set one)."""
+ m6000 = card(0, "Quadro M6000", 24.0, "52")
+ for env in (None, {"STRATA_EXPERIMENTAL_SM60": "1"}, {"STRATA_EXPERIMENTAL_SM52": "1"}):
+ with self.subTest(env=env):
+ code, out, cfg, calls, libs = self.run_setup(95.0, [m6000], argv_for("qwen", "IQ3_XXS"), env)
+ self.assertNotEqual(code, 0, out[-3000:])
+ self.assertEqual((calls, libs), ([], []))
+ self.assertIsNone(cfg)
+ self.assertIn("Maxwell (compute capability 5.2)", out)
+ self.assertIn("-DCMAKE_CUDA_ARCHITECTURES=52", out)
+ self.assertIn("docs/OLDER_GPUS.md", out)
+
+ def test_a_maxwell_card_beside_a_newer_one_is_not_a_warning(self):
+ rtx = card(0, "NVIDIA GeForce RTX 3090", 24.0, "86")
+ code, out, cfg, calls, _ = self.run_setup(95.0, [rtx, card(1, "GTX 980", 4.0, "52")], argv_for("qwen", "IQ3_XXS"))
+ self.assertEqual((code, calls), (0, [13]), out[-3000:])
+ self.assertNotIn("Maxwell (compute capability", out)
+
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