Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,16 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: bash tools/release/promoted-bins.sh "$RAEA_PROMOTED_FROM" target/dist
# ONNX Runtime as Microsoft builds it (MIT), beside raea.exe, which loads it when a model first runs (#110): the
# static runtime ort links by default is built for AVX2 and stopped raea.exe at start on CPUs without it
- name: ONNX Runtime (tools/release/onnxruntime.sh)
run: bash tools/release/onnxruntime.sh target/dist
# which DLLs raea needs from the machine (the CRT's come from the VC++ redistributable)
- name: What raea.exe imports
run: |
{ echo '### what raea.exe, raea_bundle.dll and raea-perceive.exe import'; echo '```'
{ echo '### what raea.exe, raea_bundle.dll, raea-perceive.exe and onnxruntime.dll import'; echo '```'
dumpbin=$(ls "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/MSVC/*/bin/HostX64/x64/dumpbin.exe | head -1)
"$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll target/dist/raea-perceive.exe | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
"$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll target/dist/raea-perceive.exe target/dist/onnxruntime.dll | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
echo '```'; } | tee -a "$GITHUB_STEP_SUMMARY" || true
# release.sh's checks render on Mesa's lavapipe (software Vulkan, MIT; on the runner only, never in the zip): the
# runner has no GPU, and WARP, Windows' own software DX12, crashes compiling one of Bevy's compute shaders there
Expand Down
27 changes: 19 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/manual/whats-new/0.1.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`.
first.
- Agents' npm tools and MCP servers start without a shell, and their arguments arrive as written in folders with
spaces or letters outside ASCII.
- raea starts on a PC whose processor has no AVX2, such as an Intel Core from 2011 or 2012 (#110). The ONNX Runtime
raea linked was built for newer processors and stopped raea.exe before it did anything. raea now loads Microsoft's
own build when a model first runs, and it picks its code for the processor it finds.

**Local models with nothing installed first.** Stable Audio Open's sound effects, matchmove (`raea track`),
Gaussian splats (`raea splat train`), liquids and TokenSynth's instruments set themselves up on a Mac, Windows or
Expand Down
6 changes: 6 additions & 0 deletions systems/columns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ half = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"

# Windows x64: ONNX Runtime is loaded from onnxruntime.dll beside the executable when a model first runs, never linked
# in (#110; tools/release/onnxruntime.sh ships Microsoft's build). The static runtime ort downloads is built for AVX2, and
# its static initializers ran before main, so raea.exe stopped at start on any CPU without AVX2 or BMI2.
[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies]
ort = { version = "=2.0.0-rc.13", features = ["load-dynamic"] }
6 changes: 6 additions & 0 deletions systems/index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ objc2-app-kit = { version = "0.3", default-features = false, features = ["std",
block2 = "0.6"
# a file kept only in iCloud (cloud.rs): its picture from Quick Look, without downloading the original
objc2-quick-look-thumbnailing = { version = "0.3", default-features = false, features = ["std", "block2", "objc2-core-foundation", "objc2-core-graphics", "QLThumbnailGenerator", "QLThumbnailGenerationRequest", "QLThumbnailRepresentation"] }

# Windows x64: ONNX Runtime is loaded from onnxruntime.dll beside the executable when a model first runs, never linked
# in (#110; tools/release/onnxruntime.sh ships Microsoft's build). The static runtime ort downloads is built for AVX2, and
# its static initializers ran before main, so raea.exe stopped at start on any CPU without AVX2 or BMI2.
[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies]
ort = { version = "=2.0.0-rc.13", features = ["load-dynamic"] }
6 changes: 6 additions & 0 deletions systems/ml/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ half = "2"
anyhow = "1"
# models fetched once from Hugging Face into the model cache (models.rs)
ureq = "2"

# Windows x64: ONNX Runtime is loaded from onnxruntime.dll beside the executable when a model first runs, never linked
# in (#110; tools/release/onnxruntime.sh ships Microsoft's build). The static runtime ort downloads is built for AVX2, and
# its static initializers ran before main, so raea.exe stopped at start on any CPU without AVX2 or BMI2.
[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies]
ort = { version = "=2.0.0-rc.13", features = ["load-dynamic"] }
6 changes: 6 additions & 0 deletions systems/song/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ ndarray = { version = "0.15", optional = true }
# Core ML on Apple only: ort has no prebuilt runtime with it elsewhere (the link fails)
[target.'cfg(target_vendor = "apple")'.dependencies]
ort = { version = "=2.0.0-rc.13", features = ["coreml"] }

# Windows x64: ONNX Runtime is loaded from onnxruntime.dll beside the executable when a model first runs, never linked
# in (#110; tools/release/onnxruntime.sh ships Microsoft's build). The static runtime ort downloads is built for AVX2, and
# its static initializers ran before main, so raea.exe stopped at start on any CPU without AVX2 or BMI2.
[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies]
ort = { version = "=2.0.0-rc.13", features = ["load-dynamic"] }
6 changes: 6 additions & 0 deletions systems/speech/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ ort = { version = "=2.0.0-rc.13", features = ["half"] }
anyhow = "1"
serde_json = "1"
tokenizers = { version = "0.23", default-features = false, features = ["onig"] }

# Windows x64: ONNX Runtime is loaded from onnxruntime.dll beside the executable when a model first runs, never linked
# in (#110; tools/release/onnxruntime.sh ships Microsoft's build). The static runtime ort downloads is built for AVX2, and
# its static initializers ran before main, so raea.exe stopped at start on any CPU without AVX2 or BMI2.
[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies]
ort = { version = "=2.0.0-rc.13", features = ["load-dynamic"] }
10 changes: 8 additions & 2 deletions tools/release-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ api=$(cat "$check"/raea/bin/* | grep -aoE '(api|sign)\.raea\.io|RAEA_(SIGN|GEN)_
keys=$(grep -rlE 'sk-or-v1-[0-9a-f]{20}|sk-ant-[A-Za-z0-9_-]{20}|(^|[^A-Za-z0-9+/])AKIA[0-9A-Z]{16}([^A-Za-z0-9+/=]|$)|BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY' "$check/raea" 2>/dev/null | head -5 || true)
[ -z "$keys" ] || fail "key-shaped text in: $keys"
# Windows: our binaries only. Any other DLL, or a file named like the CRT, the SDK or DirectX's redistributables, is
# Microsoft's and isn't ours to ship
ms=$(cd "$check/raea" && find . -type f \( -iname '*.dll' ! -path './bin/raea_bundle.dll' -o -iname 'vcruntime*' -o -iname 'msvcp*' -o -iname 'ucrtbase*' -o -iname 'api-ms-win*' -o -iname 'concrt*' -o -iname 'vccorlib*' -o -iname '*.lib' -o -iname '*.pdb' -o -iname 'd3dcompiler*' -o -iname 'dxcompiler*' -o -iname 'dxil*' \) | head -5)
# Microsoft's and isn't ours to ship. The one exception is ONNX Runtime's onnxruntime.dll, which Microsoft publishes
# under MIT, shipped with its licence (#110: tools/release/onnxruntime.sh)
ms=$(cd "$check/raea" && find . -type f \( -iname '*.dll' ! -path './bin/raea_bundle.dll' ! -path './bin/onnxruntime.dll' -o -iname 'vcruntime*' -o -iname 'msvcp*' -o -iname 'ucrtbase*' -o -iname 'api-ms-win*' -o -iname 'concrt*' -o -iname 'vccorlib*' -o -iname '*.lib' -o -iname '*.pdb' -o -iname 'd3dcompiler*' -o -iname 'dxcompiler*' -o -iname 'dxil*' \) | head -5)
[ -z "$ms" ] || fail "files that aren't ours: $ms"
if [ -f "$check/raea/bin/raea.exe" ]; then
for f in onnxruntime.dll onnxruntime-LICENSE.txt onnxruntime-ThirdPartyNotices.txt; do
[ -f "$check/raea/bin/$f" ] || fail "bin/$f is missing: raea.exe loads ONNX Runtime from it, and its licence goes with it (#110)"
done
fi
echo "release: $archive checked: an unpacked copy rendered a frame and checked an app on both targets with RAEA_NO_TREE=1"
rm -rf "$check"
6 changes: 6 additions & 0 deletions tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ Wayland; Xvfb on a server, as raea app check does there too), libxkbcommon-x11,
loader (Debian and Ubuntu: apt install libxkbcommon-x11-0 libxcursor1 libxi6 libxrandr2 libx11-xcb1 libvulkan1)." > "$stage/README" ;;
windows-x86_64)
cp "$bin/raea.exe" "$bin/raea_bundle.dll" "$bin/raea-perceive.exe" "$bin/raea-rune-host.exe" "$bin/raea-page-host.exe" "$stage/bin/"
# ONNX Runtime as Microsoft builds it (MIT), which raea.exe and raea-perceive.exe load when a model first runs (#110),
# with its licence and notices; tools/release/onnxruntime.sh put them beside the build
for f in onnxruntime.dll onnxruntime-LICENSE.txt onnxruntime-ThirdPartyNotices.txt; do
[ -f "$bin/$f" ] || { echo "release.sh: $bin has no $f (tools/release/onnxruntime.sh $bin)" >&2; exit 1; }
cp "$bin/$f" "$stage/bin/"
done
# the C runtime isn't in the zip (ort's ONNX Runtime needs its DLLs, and they're Microsoft's to ship): the VC++
# redistributable, which most Windows machines already have, provides it
printf '%s\r\n' "raea $version for Windows x86_64 (Windows 10 or 11, a DirectX 12 or Vulkan GPU driver; with no GPU, Mesa's lavapipe and WGPU_BACKEND=vulkan)." \
Expand Down
28 changes: 28 additions & 0 deletions tools/release/onnxruntime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Windows x64's ONNX Runtime as Microsoft builds it (the Microsoft.ML.OnnxRuntime package on NuGet, MIT): onnxruntime.dll,
# its LICENSE and its ThirdPartyNotices.txt, put in DEST beside raea.exe for tools/release.sh to pack.
#
# raea.exe loads it when a model first runs (ort's load-dynamic on Windows x64, #110). It used to link the static runtime
# ort downloads, which is built for AVX2: its static initializers ran before main, so raea.exe stopped at start on every
# CPU without AVX2 and BMI2 (an Ivy Bridge, a Celeron), whatever was asked of it. Microsoft's runtime picks its kernels
# by the CPU it finds; it loads and opens raea's models under Intel's emulator as an Ivy Bridge and a Sandy Bridge.
# 1.28.0 is the runtime the static build was (ort-sys 2.0.0-rc.13's ms@1.28.0); ort asks for API 17 or newer.
# tools/release/onnxruntime.sh DEST
set -euo pipefail
die() { echo "onnxruntime: $*" >&2; exit 1; }
dest=${1:?DEST}
v=1.28.0
# the package's sha256; its sha512 is the one NuGet records for it (packageHash)
sum=769d1d3ea8ab6cd69f737c9dd4d4462aa4ad0ccfa106eaf506efc40d7bead5db
url=https://api.nuget.org/v3-flatcontainer/microsoft.ml.onnxruntime/$v/microsoft.ml.onnxruntime.$v.nupkg
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
curl -fsSL --retry 5 --retry-all-errors --connect-timeout 30 -o "$tmp/ort.nupkg" "$url" || die "couldn't download $url"
got=$( (sha256sum "$tmp/ort.nupkg" 2>/dev/null || shasum -a 256 "$tmp/ort.nupkg") | cut -d' ' -f1)
[ "$got" = "$sum" ] || die "Microsoft.ML.OnnxRuntime $v is $got, not the $sum pinned here"
unzip -q -o "$tmp/ort.nupkg" runtimes/win-x64/native/onnxruntime.dll LICENSE ThirdPartyNotices.txt -d "$tmp/x"
mkdir -p "$dest"
cp "$tmp/x/runtimes/win-x64/native/onnxruntime.dll" "$dest/onnxruntime.dll"
cp "$tmp/x/LICENSE" "$dest/onnxruntime-LICENSE.txt"
cp "$tmp/x/ThirdPartyNotices.txt" "$dest/onnxruntime-ThirdPartyNotices.txt"
echo "onnxruntime: Microsoft.ML.OnnxRuntime $v's onnxruntime.dll ($(wc -c < "$dest/onnxruntime.dll" | tr -d ' ') bytes) and its notices in $dest"
Loading