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: CUDA 13.2's nvcc for an RTX 50 card (sm_120) is passed over for an older 13.x, or warned about (#892, #968)

Niko1221efe783990539
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index bed32455c..942f8ec59 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -91,6 +91,12 @@ This is the NVIDIA driver, not Strata: the report shows the same wedge with othe
RTX 4080 SUPER). Try another driver (a Studio one, or an older one) and a lower power limit; if it only happens with
`--spec 4`, `--spec 0` avoids the verify window while you wait for a driver fix.
+**An RTX 50 card (a source build with CUDA 13.2) answers with nonsense, or reads prompts wrongly (#892, #968).**
+CUDA 13.2's compiler (nvcc 13.2.51) miscompiles some of the engine's kernels for sm_120: on our RTX 5070 the IQ2_S and IQ3_S
+products are wrong (relative error 0.5 to 1.0 in the tests) with 13.2 and right with 13.0. The ready-made engine is built
+with 13.0. If you compile it yourself, use CUDA 13.0 or 13.1 (it can sit next to 13.2: `STRATA_NVCC=<path to its nvcc>`);
+setup warns when it finds 13.2 for such a card, and takes an older 13.x when one is installed.
+
**Pictures are refused, or slow.**
"this server was started without the vision encoder": the model was set up for text only - run setup again with
`--vision gpu` (or `--vision cpu`). Pictures that take several seconds (about 3 s at 300 image tokens on 8 cores, more with more tokens) are read by the encoder on the CPU; `--vision gpu`
diff --git a/setup.py b/setup.py
index cbb6030f0..e3d6aad82 100644
--- a/setup.py
+++ b/setup.py
@@ -2636,6 +2636,29 @@ def pip_cuda_libs(toolkit=13) -> None:
pip_install(CUDA_WHEELS, "NVIDIA CUDA libraries (cuBLAS, CUDA runtime; ~0.4 GB)")
+CUDA_SM120_SUSPECT = (13, 2) # #892 #968: nvcc 13.2.51 for sm_120 made garbage answers (IQ1_S / IQ2_S / IQ3_S) and prompts
+ # (K-quant MMQ) that the same source compiled with 13.0.88 answers correctly (llama.cpp hit it too)
+
+
+def sm120_nvcc(nvcc, cuda_v, archs):
+ """#892 / #968: CUDA 13.2's nvcc for an RTX 50 card (sm_120). Returns (nvcc, cuda_v): an older 13.x toolkit when one is
+ installed and the user did not name a compiler (STRATA_NVCC), else the one found, with a warning that says what to
+ do. Recommends, never forces: a user who picked 13.2 keeps it."""
+ if not nvcc or cuda_v != CUDA_SM120_SUSPECT or max(archs) < 120:
+ return nvcc, cuda_v
+ if not os.environ.get("STRATA_NVCC"):
+ alt, alt_v = find_nvcc(below=CUDA_SM120_SUSPECT)
+ if alt and alt_v and alt_v >= (13, 0):
+ ok(f"CUDA {alt_v[0]}.{alt_v[1]} is used for the RTX 50 card (sm_120): CUDA 13.2's compiler made wrong answers "
+ "there (#892, #968); STRATA_NVCC=<nvcc> picks another")
+ return alt, alt_v
+ warn("CUDA 13.2's compiler (nvcc) made garbage prompts and answers for RTX 50 cards (sm_120) in two reports "
+ "(#892, #968): the same source compiled with CUDA 13.0 or 13.1 is right. If the engine answers with "
+ "nonsense, install CUDA 13.0 next to it (https://developer.nvidia.com/cuda-toolkit-archive) and set "
+ "STRATA_NVCC to its nvcc; the ready-made engine is built with 13.0")
+ return nvcc, cuda_v
+
+
def install_build_tools(gpu, yes):
"""The compiler and the CUDA toolkit, installed for the user (asks once). Returns (nvcc, vcvars)."""
archs = [int(x) for x in gpu.get("archs", [gpu["arch"]])]
@@ -2663,6 +2686,7 @@ def install_build_tools(gpu, yes):
if nvcc is None or cuda_v < need_cuda:
missing.append("the NVIDIA CUDA Toolkit 13.0")
if not missing:
+ nvcc, cuda_v = sm120_nvcc(nvcc, cuda_v, archs)
ok(f"build tools present (CUDA {cuda_v[0]}.{cuda_v[1]})")
return nvcc, vcvars
say(" The engine has to be compiled for your PC, which needs: " + " and ".join(missing) + ".")
@@ -2708,6 +2732,7 @@ def install_build_tools(gpu, yes):
fail("the C++ build tools did not install", "install them by hand (README.md) and run it again")
if nvcc is None or cuda_v < need_cuda:
fail("the CUDA Toolkit did not install", "install it from https://developer.nvidia.com/cuda-downloads, then run it again")
+ nvcc, cuda_v = sm120_nvcc(nvcc, cuda_v, archs)
ok(f"build tools installed (CUDA {cuda_v[0]}.{cuda_v[1]})")
return nvcc, find_vcvars(cuda_v) if WIN else None
diff --git a/tools/test_setup_choices.py b/tools/test_setup_choices.py
index 4c7892890..ded23e80d 100644
--- a/tools/test_setup_choices.py
+++ b/tools/test_setup_choices.py
@@ -277,6 +277,27 @@ class ExperimentalSm60(unittest.TestCase):
got, seen = self.tools([86, 120], lambda below: ("nvcc13", (13, 0)))
self.assertEqual((got[0], seen), ("nvcc13", [None])) # the default: unchanged
+ def test_cuda_132_on_sm120(self):
+ """#892 / #968: nvcc 13.2 for an RTX 50 card: an older 13.x is taken when there is one, else a warning; never an
+ error, and no other card or toolkit is touched."""
+ def nvcc(below):
+ return ("nvcc130", (13, 0)) if below == (13, 2) else ("nvcc132", (13, 2))
+
+ got, seen = self.tools([120], nvcc)
+ self.assertEqual(got[0], "nvcc130")
+ self.assertEqual(seen, [None, (13, 2)])
+ with mock.patch.dict(os.environ, {"STRATA_NVCC": "x"}): # the user's own pick is kept
+ got, seen = self.tools([120], nvcc)
+ self.assertEqual((got[0], seen), ("nvcc132", [None]))
+ only132 = lambda below: (None, None) if below == (13, 2) else ("nvcc132", (13, 2))
+ with mock.patch.object(setup, "warn") as warn: # nothing older: the one found, with a warning
+ got, _ = self.tools([120], only132)
+ self.assertEqual(got[0], "nvcc132")
+ self.assertIn("#892", warn.call_args[0][0])
+ for archs in ([86], [89, 86]): # not an sm_120 card: as before
+ got, seen = self.tools(archs, nvcc)
+ self.assertEqual((got[0], seen), ("nvcc132", [None]))
+
def test_pascal_without_cuda_12_stops(self):
for archs in ([61], [70, 120]):
with self.subTest(archs=archs), self.assertRaises(SystemExit):