YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix: switch to CPU-only onnxruntime, restore +crt-static for CLI Windows
Louis Beaumont62b727146055
diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.ymlindex bf22773bf..ec186ff3a 100644--- a/.github/workflows/release-cli.yml+++ b/.github/workflows/release-cli.yml@@ -266,12 +266,29 @@ jobs:~/.cargo/git/db/key: windows-cargo-${{ hashFiles('**/Cargo.lock') }}+ - name: Download ONNX Runtime (CPU)+ shell: pwsh+ run: |+ # Pre-download CPU onnxruntime so ort crate finds it via ORT_LIB_LOCATION+ $url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip"+ $zipFile = "onnxruntime-win-x64-1.19.2.zip"+ $extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2"+ Invoke-WebRequest -Uri $url -OutFile $zipFile+ if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }+ 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y+ Write-Host "ONNX Runtime extracted to $extractDir"+ Get-ChildItem "$extractDir/lib" | ForEach-Object { Write-Host $_.Name }+- name: Build CLIenv:CARGO_PROFILE_RELEASE_STRIP: "none"CARGO_PROFILE_RELEASE_PANIC: "abort"CARGO_PROFILE_RELEASE_INCREMENTAL: "false"- RUSTFLAGS: "-C link-arg=/LTCG"+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"+ ORT_STRATEGY: system+ ORT_LIB_LOCATION: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2+ VCPKG_STATIC_LINKAGE: "true"+ KNF_STATIC_CRT: 1run: |cargo build --release --target x86_64-pc-windows-msvc@@ -310,8 +327,13 @@ jobs:$packageDir = "screenpipe-${{ env.VERSION }}-x86_64-pc-windows-msvc"New-Item -Path "$packageDir/bin" -ItemType Directory -ForceCopy-Item "target/x86_64-pc-windows-msvc/release/screenpipe.exe" "$packageDir/bin/"- Copy-Item "target/x86_64-pc-windows-msvc/release/onnxruntime.dll" "$packageDir/bin/"- # Bundle vcruntime DLLs so users don't need MSVC redistributable installed+ # Copy onnxruntime.dll - try target dir first (ort copy-dylibs), fallback to ORT_LIB_LOCATION+ $ortDll = "target/x86_64-pc-windows-msvc/release/onnxruntime.dll"+ if (!(Test-Path $ortDll)) {+ $ortDll = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2/lib/onnxruntime.dll"+ }+ Copy-Item $ortDll "$packageDir/bin/"+ # Bundle vcruntime DLLs for onnxruntime.dll (it uses dynamic CRT)Copy-Item C:\Windows\System32\vcruntime140.dll "$packageDir/bin/" -ForceCopy-Item C:\Windows\System32\vcruntime140_1.dll "$packageDir/bin/" -Force -ErrorAction SilentlyContinueCopy-Item C:\Windows\System32\msvcp140.dll "$packageDir/bin/" -Force -ErrorAction SilentlyContinuediff --git a/crates/screenpipe-audio/build.rs b/crates/screenpipe-audio/build.rsindex 2f3519de2..c16714f38 100644--- a/crates/screenpipe-audio/build.rs+++ b/crates/screenpipe-audio/build.rs@@ -90,20 +90,21 @@ fn install_onnxruntime() {println!("cargo:rustc-flag=-C target-feature=+crt-static");}- let url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-gpu-1.19.2.zip";+ // Use CPU-only onnxruntime — GPU (DirectML) causes issues on Intel integrated GPUs+ let url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip";let client = Client::builder().timeout(Duration::from_secs(300)).build().expect("failed to build client");let resp = client.get(url).send().expect("request failed");let body = resp.bytes().expect("body invalid");- fs::write("./onnxruntime-win-x64-gpu-1.19.2.zip", &body).expect("failed to write");+ fs::write("./onnxruntime-win-x64-1.19.2.zip", &body).expect("failed to write");let unzip_path = find_unzip().expect("could not find unzip executable - please install it via GnuWin32 or add it to PATH",);let status = Command::new(unzip_path)- .args(["-o", "onnxruntime-win-x64-gpu-1.19.2.zip"])+ .args(["-o", "onnxruntime-win-x64-1.19.2.zip"]).status().expect("failed to execute unzip");@@ -111,10 +112,10 @@ fn install_onnxruntime() {panic!("failed to install onnx binary");}let target_dir =- Path::new("../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-gpu-1.19.2");+ Path::new("../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2");if target_dir.exists() {fs::remove_dir_all(target_dir).expect("failed to remove existing directory");}- fs::rename("onnxruntime-win-x64-gpu-1.19.2", target_dir).expect("failed to rename");- println!("cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-gpu-1.19.2/lib");+ fs::rename("onnxruntime-win-x64-1.19.2", target_dir).expect("failed to rename");+ println!("cargo:rustc-link-search=native=../../apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2/lib");}