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++
docker: warn, not stop, on a host CPU without AVX2 (#1584)
Niko12219d64b93a0f0f
diff --git a/docker-entrypoint.sh b/docker-entrypoint.shindex 2950a2571..9df74204d 100755--- a/docker-entrypoint.sh+++ b/docker-entrypoint.sh@@ -6,6 +6,16 @@set -ecd /opt/strata || exit 1+# #1584: the engine in the image is built with AVX2 CPU kernels. A host CPU without AVX2 (Sandy / Ivy Bridge Xeons,+# Bulldozer) runs it into an illegal instruction. A warning, not a stop: recommend, never force (the flags file+# can be wrong in a VM, and a build made on that host may be fine). STRATA_CPUINFO is for the test.+cpuinfo="${STRATA_CPUINFO:-/proc/cpuinfo}"+if [ -r "$cpuinfo" ] && grep -q '^flags' "$cpuinfo" && ! grep -m1 '^flags' "$cpuinfo" | grep -qw avx2; then+ echo "WARNING: this host CPU has no AVX2. The engine in this image is built for CPUs with AVX2, so it may stop" >&2+ echo " with 'illegal instruction' (exit 132). Build the image on this machine (docker build), which compiles the" >&2+ echo " engine for the CPU it runs on, and see docs/INSTALL.md (Older CPUs, experimental) for the older-CPU build." >&2+fi+STRATA_DATA="${STRATA_DATA:-/data}"FAMILY="${FAMILY:-qwen}"MODEL="${MODEL:-IQ2_XS}"diff --git a/tools/test_docker_entrypoint.py b/tools/test_docker_entrypoint.pyindex 4953265ba..824699edd 100644--- a/tools/test_docker_entrypoint.py+++ b/tools/test_docker_entrypoint.py@@ -95,6 +95,26 @@ class Entrypoint(unittest.TestCase):self.assertIn("by-model", out)self.assertIn(f"Config: {self.data}/config/strata-iq3_s.json", out)+ def warning_for(self, flags):+ info = self.tmp / "cpuinfo"+ info.write_text(f"processor : 0+flags : {flags}+")+ (self.data / "config" / "strata-iq3_s.json").write_text('{"args": ["x"]}+')+ env = dict(os.environ, STRATA_DATA=str(self.data), MODEL="IQ3_S", REINSTALL="0", STRATA_CPUINFO=str(info))+ r = subprocess.run([SH, str(self.script)], env=env, capture_output=True, text=True, timeout=60)+ self.assertEqual(r.returncode, 0, r.stderr) # a warning, never a stop (#1584)+ return r.stderr++ def test_a_cpu_without_avx2_is_warned_not_stopped(self):+ err = self.warning_for("fpu sse4_2 avx aes")+ self.assertIn("no AVX2", err)+ self.assertIn("docker build", err)++ def test_a_cpu_with_avx2_gets_no_warning(self):+ self.assertEqual(self.warning_for("fpu sse4_2 avx avx2 fma"), "")+if __name__ == "__main__":unittest.main()