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

The linux-aarch64 platform: engine packages, Control (Terminal) and the signed feed for the DGX Spark

Niko1221f436dba81b19
diff --git a/packaging/build_cuda_linux_aarch64.sh b/packaging/build_cuda_linux_aarch64.sh
new file mode 100644
index 000000000..2ba4d305f
--- /dev/null
+++ b/packaging/build_cuda_linux_aarch64.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# Build the Linux ARM64 CUDA engine packages for the release feed: the Qwen engine package and the separate DeepSeek engine package
+# for the NVIDIA DGX Spark (GB10, sm_121).
+#
+# COMMIT=<40 hex> packaging/build_cuda_linux_aarch64.sh
+#
+# Run it on the Spark (arm64 Linux, CUDA 13.0 toolkit, a Python 3 venv with requirements.txt and requirements-build.txt, cmake and
+# ninja on PATH; PYTHON=<that python>). It runs spark/build_engine.sh, then makes two packages in $OUT (default ./out-engine-cuda13-aarch64):
+# <ver>-linux-aarch64-cuda-cuda13/ strata, libstrata_kq.so, strata-vision, strata-dsv41 and the CUDA libraries (feed member "engine")
+# dsv41/<ver>-linux-aarch64-cuda-cuda13/ strata-dsv41 and the CUDA libraries (feed member "dsv41")
+# Nothing is signed or uploaded: sign with packaging/feed_tool.py (sign-package, then pack-engine; --prefix strata-dsv41 for the second).
+#
+# PKGVER is the package version (default: the version in CMakeLists.txt); COMMIT names the source commit in the build id and is required
+# for a tree copy without .git. The packages need glibc 2.39 or newer (Ubuntu 24.04, DGX OS 7): they are built on the Spark itself; there
+# is no older arm64 chroot to build in.
+set -eu
+repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd -P)
+py=${PYTHON:-python3}
+out=${OUT:-$repo/out-engine-cuda13-aarch64}
+mindriver=580.65
+case "$(uname -s)-$(uname -m)" in
+ Linux-aarch64|Linux-arm64) ;;
+ *) echo "build_cuda_linux_aarch64.sh: this builds on arm64 Linux (the DGX Spark)" >&2; exit 2 ;;
+esac
+cd "$repo"
+ver=${PKGVER:-$(sed -n 's/^[[:space:]]*project([^)]*VERSION[[:space:]]*\([0-9][0-9.]*\).*/\1/p' CMakeLists.txt | head -1)}
+commit=${COMMIT:-$(git rev-parse HEAD 2>/dev/null || true)}
+[ -n "$commit" ] || { echo "build_cuda_linux_aarch64.sh: set COMMIT=<hex> (no .git here)" >&2; exit 2; }
+export COMMIT=$commit
+stage=$(mktemp -d "${TMPDIR:-/tmp}/strata-engine-stage.XXXXXX")
+trap 'rm -rf "$stage"' EXIT
+OUT=$stage/engine BUILD_VISION=${BUILD_VISION:-1} BUILD_DSV41=1 sh spark/build_engine.sh
+cudafull=$(sed -n 's/.*"cuda": "\([^"]*\)".*/\1/p' "$stage/engine/BUILD.json")
+id="release-${ver}-cuda13-${cudafull}-aarch64-$(printf '%s' "$commit" | cut -c1-12)"
+mkdir -p "$out/dsv41"
+# the Qwen engine package: strata and the DeepSeek engine beside it (as the Linux x86_64 cuda13 package carries it)
+"$py" packaging/package_engine.py --src "$stage/engine" --backend cuda --version "$ver" --out "$out" --arch sm_121 --arch compute_121 \
+ --min-driver nvidia=$mindriver --variant cuda13 --platform linux-aarch64 --build-id "$id" --require-dsv41 \
+ --include SYSTEM-LIBS.txt --include 'libstrata_kq*'
+# the DeepSeek package on its own: its program, BUILD.json and the same CUDA libraries
+ds=$stage/dsv41
+mkdir -p "$ds"
+cp "$stage/engine/strata-dsv41" "$stage/engine/BUILD.json" "$stage/engine/SYSTEM-LIBS.txt" "$ds/"
+for f in "$stage"/engine/*.so.*; do cp "$f" "$ds/"; done
+"$py" packaging/package_engine.py --src "$ds" --backend cuda --version "$ver" --out "$out/dsv41" --arch sm_121 --arch compute_121 \
+ --min-driver nvidia=$mindriver --variant cuda13 --platform linux-aarch64 --build-id "$id" --entrypoint strata-dsv41 \
+ --include SYSTEM-LIBS.txt
+for d in "$out"/*/ "$out"/dsv41/*/; do
+ [ -f "$d/engine-component.json" ] || continue
+ "$py" packaging/package_engine.py --verify "$d"
+ "$py" packaging/binary_deps.py "$d"
+done
+echo "built: $out"
diff --git a/packaging/feed_tool.py b/packaging/feed_tool.py
index 303491864..bfb51a5bf 100644
--- a/packaging/feed_tool.py
+++ b/packaging/feed_tool.py
@@ -235,7 +235,7 @@ def build_feed(out: Path, *, key: dict, sequence: int, channel: str = "stable",
return document
-TAURI_TARGET_NAMES = tuple(feedmod.TAURI_TARGETS.values()) + ("linux-aarch64",)
+TAURI_TARGET_NAMES = tuple(feedmod.TAURI_TARGETS.values())
def _default_app_pubkey() -> str:
diff --git a/packaging/install.sh b/packaging/install.sh
index df6b41e0a..420ff4427 100644
--- a/packaging/install.sh
+++ b/packaging/install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Strata Terminal: one-line installer for Linux and macOS.
+# Strata Terminal: one-line installer for Linux (x86_64, and ARM64 on the NVIDIA DGX Spark) and macOS (Apple silicon).
#
# curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh
#
@@ -55,9 +55,9 @@ main() {
case "$os-$arch" in
Linux-x86_64|Linux-amd64) platform=linux-x86_64 ;;
Darwin-arm64|Darwin-aarch64) platform=macos-arm64 ;;
- Linux-aarch64|Linux-arm64) die "this computer ($os $arch) has an ARM processor. Strata needs an NVIDIA or AMD graphics card and has no engine for ARM Linux, so it could not run a model here. Use a Linux PC with an Intel or AMD processor (x86_64) and one of those cards." ;;
+ Linux-aarch64|Linux-arm64) platform=linux-aarch64 ;; # the NVIDIA DGX Spark (GB10); the note below says so for any other ARM computer
Darwin-x86_64) die "this Mac has an Intel processor. Strata for Mac needs Apple silicon (M1 or newer), so it could not run a model here." ;;
- *) die "this computer ($os $arch) has no Strata Terminal. Supported: Linux x86_64 with an NVIDIA or AMD card, macOS on Apple silicon (Windows: use install.ps1)." ;;
+ *) die "this computer ($os $arch) has no Strata Terminal. Supported: Linux x86_64 with an NVIDIA or AMD card, Linux ARM64 on an NVIDIA DGX Spark, macOS on Apple silicon (Windows: use install.ps1)." ;;
esac
gpu=""
if command -v nvidia-smi >/dev/null 2>&1; then
@@ -72,6 +72,12 @@ main() {
fi
say "Strata Terminal installer"
say " This computer: $os $arch ($platform)${gpu:+, graphics: $gpu}"
+ if [ "$platform" = linux-aarch64 ]; then # recommend, never force: the Terminal installs on any ARM Linux, its engine is for one machine
+ case "$gpu" in
+ *GB10*) ;;
+ *) say " Note: Strata's engine for ARM Linux is built and tested on the NVIDIA DGX Spark (GB10) only. This computer reports ${gpu:-no NVIDIA graphics}: the Terminal installs, but 'strata launch' may find no engine for it." ;;
+ esac
+ fi
say " Release folder: $FEED"
# ---- 2. download and check
diff --git a/packaging/lock_wheels.py b/packaging/lock_wheels.py
index 30f8788dd..de9290c77 100644
--- a/packaging/lock_wheels.py
+++ b/packaging/lock_wheels.py
@@ -35,6 +35,9 @@ TARGETS = {
"linux-x86_64": {"platforms": ["manylinux2014_x86_64", "manylinux_2_17_x86_64", "manylinux_2_28_x86_64",
"manylinux_2_34_x86_64", "linux_x86_64"],
"env": {"sys_platform": "linux", "platform_system": "Linux", "os_name": "posix"}},
+ "linux-aarch64": {"platforms": ["manylinux2014_aarch64", "manylinux_2_17_aarch64", "manylinux_2_28_aarch64",
+ "manylinux_2_34_aarch64", "linux_aarch64"],
+ "env": {"sys_platform": "linux", "platform_system": "Linux", "os_name": "posix"}},
"darwin-arm64": {"platforms": ["macosx_11_0_arm64", "macosx_12_0_arm64", "macosx_13_0_arm64",
"macosx_14_0_arm64"],
"env": {"sys_platform": "darwin", "platform_system": "Darwin", "os_name": "posix"}},
diff --git a/packaging/locks/runtime-linux-aarch64-cp312.txt b/packaging/locks/runtime-linux-aarch64-cp312.txt
new file mode 100644
index 000000000..f5d9f62e3
--- /dev/null
+++ b/packaging/locks/runtime-linux-aarch64-cp312.txt
@@ -0,0 +1,50 @@
+# Hash-pinned runtime packages for the linux-aarch64 terminal archive (CPython 3.12, cp312).
+# Made by packaging/lock_wheels.py from requirements.txt + requirements-monitor.txt; installed at BUILD time with
+# pip install --require-hashes --no-deps --only-binary=:all: -r <this file>
+# and never on the user's PC. To change a package: edit requirements.txt, run lock_wheels.py, review the diff.
+certifi==2026.10.19 \
+ --hash=sha256:42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b
+charset-normalizer==3.5.1 \
+ --hash=sha256:4582c27e8c889d64811987b5967fbd3ae0c823fe1fd933b543d55ac20bb475fa
+idna==3.20 \
+ --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c
+jinja2==3.1.6 \
+ --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67
+linkify-it-py==2.2.0 \
+ --hash=sha256:3adc40eb5af300b2605fcfdb968c24e1d780a90f1f2221af7c15e5111e94d443
+markdown-it-py==4.2.0 \
+ --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a
+markupsafe==3.0.3 \
+ --hash=sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d
+mdit-py-plugins==0.6.1 \
+ --hash=sha256:214c82fb2ac524472ab6a5bcab1de80f73b50443e187f401bfd77efbc7c6481d
+mdurl==0.1.2 \
+ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8
+numpy==2.5.3 \
+ --hash=sha256:76c2c1e6bfa5c84adc6434dfbf013aa92096a7985221762c8f11fedfd20fff58
+pillow==12.3.0 \
+ --hash=sha256:d9c7f76c0673154f044e9d78c8655fb4213f6ca31a836df48b40fe5d187717b9
+platformdirs==4.13.6 \
+ --hash=sha256:21fc198fb09f3e78cadcdfd8a6ae4fd65cadc64a3cba78b694321c2996114a3e
+psutil==7.2.2 \
+ --hash=sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e
+pygments==2.21.0 \
+ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9
+pyyaml==6.0.3 \
+ --hash=sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28
+regex==2026.9.10 \
+ --hash=sha256:4c66d54042a14a503907d81861b8a5235e6d1f03d4fbc1d8767f652eaf957ac1
+requests==2.34.2 \
+ --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0
+rich==15.0.0 \
+ --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb
+textual==8.2.8 \
+ --hash=sha256:267375fd402dc8d981457212efa71f0e3365fd17bba144ba9bb3ed7563cb374a
+tqdm==4.70.1 \
+ --hash=sha256:c293e525e6fef9c20e8728fd4612df02a0aa31bb5fe91ecd93e123b1b7bffa73
+truststore==0.10.5 \
+ --hash=sha256:9aaaedaefaf06d8b206278cf8b5012bc897f485a874503501e12d776df78951c
+typing-extensions==4.16.0 \
+ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8
+urllib3==2.8.0 \
+ --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3
diff --git a/packaging/make_local_feed.py b/packaging/make_local_feed.py
index 4fb4bb394..932af4229 100644
--- a/packaging/make_local_feed.py
+++ b/packaging/make_local_feed.py
@@ -4,12 +4,12 @@
python packaging/make_local_feed.py --out FEED --terminal strata-terminal-0.1.45-linux-x86_64.tar.gz \
--engine /path/to/components/engine/0.1.45-linux-x86_64-cuda [--engine ...] \
- [--keys KEYDIR] [--url http://127.0.0.1:8099] [--sequence 1]
+ [--dsv41 /path/to/a/DeepSeek/engine/package ...] [--keys KEYDIR] [--url http://127.0.0.1:8099] [--sequence 1]
python -m http.server 8099 --bind 127.0.0.1 --directory FEED # serve it (foreground; stop it with Ctrl+C)
What it writes into FEED (the folder a person would host):
strata-feed.json + .sig the signed feed (Ed25519, the key in KEYDIR, made once, never inside a git checkout)
- control/*, engine/* the Terminal (as a "control" package) and each engine package, archived
+ control/*, engine/*, dsv41/* the Terminal (as a "control" package), each engine package and each DeepSeek engine package (--dsv41), archived
install-manifest.txt one line per platform for install.sh / install.ps1: platform version url sha256 size (written by feed_tool build-feed)
install.sh, install.ps1 the one-line installers with this feed's address filled in (--url)
test-trust.json the PUBLIC test key: `STRATA_UPDATE_TRUSTED_KEYS=<this file>` lets this build trust the feed
@@ -57,6 +57,7 @@ def main(argv=None) -> int:
ap.add_argument("--out", type=Path, required=True)
ap.add_argument("--terminal", type=Path, action="append", default=[], help="a terminal archive (.tar.gz or .zip); repeat per platform")
ap.add_argument("--engine", type=Path, action="append", default=[], help="an engine package folder (with engine-component.json)")
+ ap.add_argument("--dsv41", type=Path, action="append", default=[], help="a DeepSeek engine package folder (the feed's dsv41 member)")
ap.add_argument("--keys", type=Path, default=None, help="folder for the test key (default: <out>/../feed-test-keys)")
ap.add_argument("--url", default="http://127.0.0.1:8099", help="the address this feed will be served at (baked into install.sh/.ps1)")
ap.add_argument("--sequence", type=int, default=1)
@@ -72,6 +73,8 @@ def main(argv=None) -> int:
shutil.rmtree(out, ignore_errors=True)
(out / "engine").mkdir(parents=True)
(out / "control").mkdir(parents=True)
+ if a.dsv41:
+ (out / "dsv41").mkdir(parents=True)
version = a.version
with tempfile.TemporaryDirectory(prefix="strata-feed-") as tmp:
tmpdir = Path(tmp)
@@ -82,7 +85,8 @@ def main(argv=None) -> int:
v = version or (folder / "VERSION").read_text(encoding="utf-8").strip()
version = v
platform = ("windows-x86_64" if (folder / "python" / "python.exe").exists() else
- "macos-arm64" if ("darwin" in term.name or "macos" in term.name) else "linux-x86_64") # the feed's own platform names
+ "macos-arm64" if ("darwin" in term.name or "macos" in term.name) else
+ "linux-aarch64" if "aarch64" in term.name else "linux-x86_64") # the feed's own platform names
fmt = "zip" if platform.startswith("windows") else "tar.gz"
entry = ft.pack_control(folder, out / "control", version=v, platform=platform, fmt=fmt)
print(f"control {platform} {v}: {entry['size'] // 1048576} MB")
@@ -93,8 +97,15 @@ def main(argv=None) -> int:
entry = ft.pack_engine(copy, out / "engine")
print(f"engine {entry['platform']}-{entry['backend']} {entry['version']}: {entry['size'] // 1048576} MB")
shutil.rmtree(copy.parent, ignore_errors=True)
+ for n, pkg in enumerate(a.dsv41):
+ copy = tmpdir / f"d{n}" / pkg.name
+ shutil.copytree(pkg, copy, symlinks=True)
+ ft.sign_package(copy, key)
+ entry = ft.pack_engine(copy, out / "dsv41", url_prefix="dsv41/", prefix="strata-dsv41")
+ print(f"deepseek engine {entry['platform']}-{entry['backend']} {entry['version']}: {entry['size'] // 1048576} MB")
+ shutil.rmtree(copy.parent, ignore_errors=True)
ft.build_feed(out, key=key, sequence=a.sequence, channel=a.channel, engine_dir=out / "engine" if a.engine else None,
- control_dir=out / "control" if a.terminal else None)
+ control_dir=out / "control" if a.terminal else None, dsv41_dir=out / "dsv41" if a.dsv41 else None)
base = a.url.rstrip("/")
for name in ("install.sh", "install.ps1"):
text = (ROOT / "packaging" / name).read_text(encoding="utf-8").replace(RELEASE_FEED, base)
diff --git a/packaging/package_terminal.py b/packaging/package_terminal.py
index 55b29b1ac..41fce5037 100644
--- a/packaging/package_terminal.py
+++ b/packaging/package_terminal.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-"""Build the self-contained Strata Terminal distribution for Windows x64, Linux x86_64 or macOS arm64.
+"""Build the self-contained Strata Terminal distribution for Windows x64, Linux x86_64, Linux aarch64 (the DGX Spark) or macOS arm64.
The requirement this exists for (checklist P04, and the owner's rule that starting or serving never fetches Python
packages from the internet): a user installs the terminal without Desktop, and needs no development checkout, no
@@ -76,6 +76,11 @@ PYTHON_PINS = {
"sha256": "5864001bf969db329fadc2b654c4878c6027d170c6bd77e28f88666260bcaf63",
"python": "python/bin/python3", "archive": "tar.gz",
},
+ "linux-aarch64": {
+ "file": f"cpython-{PYTHON_VERSION}+{PBS_RELEASE}-aarch64-unknown-linux-gnu-install_only.tar.gz",
+ "sha256": "b342ccfb577fda349d0237c98b24848234ca767c10f034628a5ff9fc858d662f",
+ "python": "python/bin/python3", "archive": "tar.gz",
+ },
"darwin-arm64": {
"file": f"cpython-{PYTHON_VERSION}+{PBS_RELEASE}-aarch64-apple-darwin-install_only.tar.gz",
"sha256": "83dcb04777c798bd95f3687acf9ae84b09860272ee6bdfb05be8bcf9447f75b8",
@@ -138,6 +143,8 @@ def host_target() -> str:
return "windows-x86_64"
if sys.platform.startswith("linux") and machine in ("x86_64", "amd64"):
return "linux-x86_64"
+ if sys.platform.startswith("linux") and machine in ("aarch64", "arm64"):
+ return "linux-aarch64"
if sys.platform == "darwin" and machine in ("arm64", "aarch64"):
return "darwin-arm64"
raise SystemExit(f"no terminal target for {sys.platform}/{machine}")
@@ -333,7 +340,7 @@ def main() -> int:
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--out", required=True, help="directory to write the archive into")
ap.add_argument("--target", choices=sorted(PYTHON_PINS), default=None,
- help="windows-x86_64, linux-x86_64 or darwin-arm64 (default: this machine's)")
+ help="windows-x86_64, linux-x86_64, linux-aarch64 or darwin-arm64 (default: this machine's)")
ap.add_argument("--version", default=None, help="version label (default: read from the source)")
ap.add_argument("--skip-deps", action="store_true",
help="skip the locked install (layout checks only; the result is NOT distributable)")
diff --git a/strata_control/feed.py b/strata_control/feed.py
index eb0e78352..89e02b052 100644
--- a/strata_control/feed.py
+++ b/strata_control/feed.py
@@ -33,9 +33,9 @@ SCHEMA_VERSION = 1
FEED_NAME = "strata-feed.json"
SIGNATURE_SUFFIX = ".sig"
FORMATS = ("tar.gz", "tar.xz", "zip")
-PLATFORMS = ("windows-x86_64", "linux-x86_64", "macos-arm64", "macos-x86_64")
-#: Tauri's names for the same platforms.
-TAURI_TARGETS = {"windows-x86_64": "windows-x86_64", "linux-x86_64": "linux-x86_64",
+PLATFORMS = ("windows-x86_64", "linux-x86_64", "linux-aarch64", "macos-arm64", "macos-x86_64")
+#: Tauri's names for the same platforms (no desktop app is built for linux-aarch64: the entry only keeps the name parsable).
+TAURI_TARGETS = {"windows-x86_64": "windows-x86_64", "linux-x86_64": "linux-x86_64", "linux-aarch64": "linux-aarch64",
"macos-arm64": "darwin-aarch64", "macos-x86_64": "darwin-x86_64"}
_VERSION = re.compile(r"\d+\.\d+\.\d+(?:\.\d+)?")
_HEX64 = re.compile(r"[0-9a-f]{64}")
diff --git a/strata_control/targets.py b/strata_control/targets.py
index f6b82b19f..9b8c000bf 100644
--- a/strata_control/targets.py
+++ b/strata_control/targets.py
@@ -22,7 +22,7 @@ class ComponentError(RuntimeError):
#: is explicit that Windows SYCL and Intel Macs are not supported rather than merely untested.
BACKEND_MATRIX: dict[str, tuple[str, ...]] = {
"metal": ("macos-arm64",),
- "cuda": ("windows-x86_64", "linux-x86_64"),
+ "cuda": ("windows-x86_64", "linux-x86_64", "linux-aarch64"), # linux-aarch64: the NVIDIA DGX Spark (GB10, sm_121) only
"hip": ("windows-x86_64", "linux-x86_64"),
"sycl": ("linux-x86_64",),
"cpu": ("macos-arm64", "macos-x86_64", "windows-x86_64", "linux-x86_64"),
@@ -36,6 +36,8 @@ def host_platform() -> str:
machine = platform.machine().lower()
arch = {"arm64": "arm64", "aarch64": "arm64",
"x86_64": "x86_64", "amd64": "x86_64"}.get(machine, machine)
+ if system == "linux" and arch == "arm64":
+ return "linux-aarch64" # Linux names its ARM64 machines as uname does (the Tauri target and the Python build too); a Mac stays macos-arm64
return f"{system}-{arch}"
diff --git a/tests/terminal/test_linux_aarch64.py b/tests/terminal/test_linux_aarch64.py
new file mode 100644
index 000000000..7ace729d9
--- /dev/null
+++ b/tests/terminal/test_linux_aarch64.py
@@ -0,0 +1,113 @@
+"""Linux on ARM64 (the NVIDIA DGX Spark, 0.2.7.1): the platform name, the CUDA engine package for it, and the release tools that make
+the Terminal and the engine packages for it. Nothing here needs an ARM machine; tests/terminal/test_release_matrix.py holds the feed
+selection rows."""
+from __future__ import annotations
+
+import re
+import sys
+import unittest
+from pathlib import Path
+from unittest import mock
+
+ROOT = Path(__file__).resolve().parents[2]
+sys.path.insert(0, str(ROOT))
+sys.path.insert(0, str(ROOT / "packaging"))
+
+from strata_control import engine_component as ec # noqa: E402
+from strata_control import feed as feedmod # noqa: E402
+from strata_control import targets # noqa: E402
+import feed_tool # noqa: E402
+import lock_wheels # noqa: E402
+import package_terminal # noqa: E402
+
+
+def host(system: str, machine: str) -> str:
+ with mock.patch.object(targets.platform, "system", return_value=system), mock.patch.object(targets.platform, "machine", return_value=machine):
+ return targets.host_platform()
+
+
+class PlatformName(unittest.TestCase):
+ def test_linux_arm64_is_linux_aarch64_and_nothing_else_changed(self):
+ self.assertEqual(host("Linux", "aarch64"), "linux-aarch64")
+ self.assertEqual(host("Linux", "arm64"), "linux-aarch64")
+ self.assertEqual(host("Linux", "x86_64"), "linux-x86_64")
+ self.assertEqual(host("Windows", "AMD64"), "windows-x86_64")
+ self.assertEqual(host("Darwin", "arm64"), "macos-arm64") # a Mac keeps its name
+ self.assertEqual(host("Darwin", "x86_64"), "macos-x86_64")
+
+ def test_cuda_is_committed_to_on_linux_aarch64_and_no_other_backend_is(self):
+ self.assertTrue(targets.backend_supported("cuda", "linux-aarch64")[0])
+ for backend in ("hip", "sycl", "metal", "cpu"):
+ self.assertFalse(targets.backend_supported(backend, "linux-aarch64")[0], backend)
+ # the rows that were there are still there
+ self.assertTrue(targets.backend_supported("cuda", "linux-x86_64")[0])
+ self.assertTrue(targets.backend_supported("hip", "linux-x86_64")[0])
+ self.assertTrue(targets.backend_supported("metal", "macos-arm64")[0])
+
+ def test_the_feed_knows_the_platform(self):
+ self.assertIn("linux-aarch64", feedmod.PLATFORMS)
+ self.assertEqual(feedmod.TAURI_TARGETS["linux-aarch64"], "linux-aarch64")
+ self.assertEqual(feedmod.PLATFORMS[:2], ("windows-x86_64", "linux-x86_64"))
+
+
+class GB10Cards(unittest.TestCase):
+ def test_sm_121_code_covers_a_gb10_and_only_a_12_x_card(self):
+ archs = ("sm_121", "compute_121")
+ self.assertTrue(ec.arch_covers(archs, ["sm_121"]))
+ self.assertFalse(ec.arch_covers(archs, ["sm_120"])) # machine code is for the card's own minor or a newer one; PTX needs >= 121
+ self.assertFalse(ec.arch_covers(archs, ["sm_86"]))
+ self.assertTrue(ec.arch_native(archs, ["sm_121"]))
+
+
+class ReleaseTools(unittest.TestCase):
+ def test_the_terminal_has_a_pinned_interpreter_for_linux_aarch64(self):
+ pin = package_terminal.PYTHON_PINS["linux-aarch64"]
+ self.assertIn("aarch64-unknown-linux-gnu-install_only.tar.gz", pin["file"])
+ self.assertRegex(pin["sha256"], r"^[0-9a-f]{64}$")
+ self.assertNotEqual(pin["sha256"], package_terminal.PYTHON_PINS["linux-x86_64"]["sha256"])
+ self.assertTrue(pin["url"].startswith(package_terminal.PBS_BASE) and "%2B" in pin["url"])
+ self.assertEqual(pin["python"], "python/bin/python3")
+
+ def test_host_target_names_linux_arm64(self):
+ with mock.patch.object(package_terminal.sys, "platform", "linux"), mock.patch.object(package_terminal.platform, "machine", return_value="aarch64"):
+ self.assertEqual(package_terminal.host_target(), "linux-aarch64")
+ with mock.patch.object(package_terminal.sys, "platform", "linux"), mock.patch.object(package_terminal.platform, "machine", return_value="x86_64"):
+ self.assertEqual(package_terminal.host_target(), "linux-x86_64")
+
+ def test_the_runtime_lock_for_linux_aarch64_is_made_the_same_way_and_is_complete(self):
+ spec = lock_wheels.TARGETS["linux-aarch64"]
+ self.assertTrue(all(p.endswith("aarch64") for p in spec["platforms"]))
+ self.assertEqual(spec["env"], lock_wheels.TARGETS["linux-x86_64"]["env"])
+ lock = ROOT / "packaging" / "locks" / "runtime-linux-aarch64-cp312.txt"
+ self.assertTrue(lock.is_file(), "run packaging/lock_wheels.py --target linux-aarch64 on the Spark")
+ names = package_terminal.lock_names(lock)
+ x86 = package_terminal.lock_names(ROOT / "packaging" / "locks" / "runtime-linux-x86_64-cp312.txt")
+ self.assertEqual(set(names), set(x86), "the same packages as the x86_64 Linux lock")
+ text = lock.read_text(encoding="utf-8")
+ self.assertEqual(len(re.findall(r"^[A-Za-z0-9_.-]+==", text, re.M)), len(names))
+ hashed = re.findall(r"^[A-Za-z0-9_.-]+==\S+ \\\n(?:\s+--hash=sha256:[0-9a-f]{64}(?: \\)?\n?)+", text, re.M)
+ self.assertEqual(len(hashed), len(names), "every package of the lock names the SHA-256 of its wheel")
+
+ def test_pack_control_takes_the_platform(self):
+ parser_choices = feedmod.PLATFORMS
+ self.assertIn("linux-aarch64", parser_choices)
+ # the installers' one-line manifest wants tar.gz for every non-Windows platform
+ self.assertTrue(feed_tool.feedmod.PLATFORMS is feedmod.PLATFORMS)
+
+ def test_install_sh_installs_on_linux_arm64_and_says_what_the_engine_is_for(self):
+ text = (ROOT / "packaging" / "install.sh").read_text(encoding="utf-8")
+ self.assertIn("Linux-aarch64|Linux-arm64) platform=linux-aarch64", text)
+ self.assertNotIn("has no engine for ARM Linux", text)
+ self.assertIn("GB10", text)
+ self.assertIn("Linux-x86_64|Linux-amd64) platform=linux-x86_64", text) # unchanged
+ self.assertIn("Darwin-x86_64) die", text)
+
+ def test_the_spark_build_script_is_lf_and_names_the_platform(self):
+ raw = (ROOT / "spark" / "build_engine.sh").read_bytes()
+ self.assertNotIn(b"\r", raw)
+ self.assertIn(b'linux-aarch64', raw)
+ self.assertIn(b"-DSTRATA_PORTABLE=ON", raw)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tests/terminal/test_release_matrix.py b/tests/terminal/test_release_matrix.py
index d6aab3114..6f53b10aa 100644
--- a/tests/terminal/test_release_matrix.py
+++ b/tests/terminal/test_release_matrix.py
@@ -39,6 +39,7 @@ RELEASE = [
pkg("linux-x86_64", "hip", "rx7900", ("gfx1100", "gfx1101", "gfx1102")),
pkg("linux-x86_64", "hip", "halo", ("gfx1151",)),
pkg("linux-x86_64", "hip", "rx6000", ("gfx1030", "gfx1031")),
+ pkg("linux-aarch64", "cuda", "cuda13", ("sm_121", "compute_121"), "580.65"), # the NVIDIA DGX Spark (GB10), 0.2.7.1
pkg("linux-x86_64", "sycl", "", ("intel-arc",)), # the Intel Arc (A and B series) engine, GPU code JIT-compiled
pkg("macos-arm64", "metal", "", ("apple-gpu",)),
]
@@ -66,6 +67,7 @@ class ReleaseSelection(unittest.TestCase):
self.pick(pc("linux-x86_64", "hip", gfx=["gfx1100"]))[0], # RX 7900 XTX
self.pick(pc("linux-x86_64", "hip", gfx=["gfx1151"]))[0], # Ryzen AI Max (Strix Halo)
self.pick(pc("linux-x86_64", "hip", gfx=["gfx1031"]))[0], # RX 6700 XT
+ self.pick(pc("linux-aarch64", "cuda", "580.173", ["sm_121"]))[0], # DGX Spark (GB10)
self.pick(pc("linux-x86_64", "sycl"))[0], # Arc A750 / B580 / Pro B70
self.pick(pc("macos-arm64", "metal"))[0],
}
@@ -82,6 +84,19 @@ class ReleaseSelection(unittest.TestCase):
self.assertEqual(self.pick(pc("linux-x86_64", "cuda", "575.51", ["sm_75"]))[0][2], "cuda12")
self.assertEqual(self.pick(pc("linux-x86_64", "cuda", "580.65", ["sm_75"]))[0][2], "cuda13")
+ def test_the_dgx_spark_gets_the_aarch64_build_and_no_other_pc_does(self):
+ self.assertEqual(self.pick(pc("linux-aarch64", "cuda", "580.173", ["sm_121"]))[0], ("linux-aarch64", "cuda", "cuda13"))
+ for hw in (pc("linux-x86_64", "cuda", "590.10", ["sm_120"]), pc("linux-x86_64", "cuda", "590.10", ["sm_121"]),
+ pc("windows-x86_64", "cuda", "590.10", ["sm_121"])):
+ self.assertNotEqual(self.pick(hw)[0][0], "linux-aarch64", hw)
+ got, why = self.pick(pc("linux-aarch64", "cuda", "580.173", ["sm_86"])) # an arm64 server with an A-series card: no machine code for it
+ self.assertIsNone(got)
+ self.assertTrue(any("sm_121" in r for r in why))
+ got, why = self.pick(pc("linux-aarch64", "cuda", "570.10", ["sm_121"])) # the driver is too old
+ self.assertIsNone(got)
+ self.assertTrue(any("580.65" in r for r in why))
+ self.assertIsNone(self.pick(pc("linux-aarch64", "hip", gfx=["gfx1201"]))[0]) # no AMD engine for arm64 Linux
+
def test_a_driver_that_is_too_old_gets_no_engine_and_a_reason(self):
got, why = self.pick(pc("windows-x86_64", "cuda", "551.00", ["sm_86"]))
self.assertIsNone(got)