Skip to content
Open
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
103 changes: 103 additions & 0 deletions .github/workflows/build-windows-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Build Windows Linux-CLI Installer

on:
workflow_dispatch:
inputs:
upload_release:
description: 'Upload as a GitHub Release (requires a version tag)'
type: boolean
default: false
push:
branches:
- windows-offline-installer
tags:
- 'linux-cli-v*'

jobs:
build:
name: Build installer (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include:
- arch: x64
runner: windows-latest
- arch: arm64
runner: windows-11-arm
runs-on: ${{ matrix.runner }}
continue-on-error: ${{ matrix.arch == 'arm64' }}

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
architecture: ${{ matrix.arch }}

- name: Install dependencies and compile TypeScript
shell: pwsh
run: |
npm ci
npm run build

- name: Stage installer bundle
shell: pwsh
run: |
& windows-installer/stage.ps1 `
-Arch "${{ matrix.arch }}" `
-NodeVersion "22.15.1"
if ($LASTEXITCODE -gt 1) { exit $LASTEXITCODE }
exit 0

- name: Install NSIS
shell: pwsh
run: choco install nsis --no-progress -y

- name: Build NSIS installer
shell: pwsh
run: |
$version = (Get-Content package.json | ConvertFrom-Json).version
Set-Location windows-installer
New-Item -ItemType Directory -Force output | Out-Null

$makeNsis = $null
$candidates = @(
"$env:ChocolateyInstall\bin\makensis.exe",
"$env:ProgramData\chocolatey\bin\makensis.exe",
"$env:ProgramFiles\NSIS\makensis.exe",
"C:\Program Files (x86)\NSIS\makensis.exe"
)

foreach ($candidate in $candidates) {
if (Test-Path $candidate) {
$makeNsis = $candidate
break
}
}

if (-not $makeNsis) {
$cmd = Get-Command makensis -ErrorAction SilentlyContinue
if ($cmd) { $makeNsis = $cmd.Source }
}

if (-not $makeNsis) {
throw "makensis.exe not found after NSIS install"
}

& $makeNsis /DARCH=${{ matrix.arch }} /DPRODUCT_VERSION=$version installer.nsi

- name: Upload installer artifact
uses: actions/upload-artifact@v4
with:
name: edge-impulse-linux-cli-windows-${{ matrix.arch }}
path: windows-installer/output/edge-impulse-linux-cli-windows-${{ matrix.arch }}-setup.exe
if-no-files-found: error

- name: Upload to GitHub Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.upload_release)
uses: softprops/action-gh-release@v2
with:
files: windows-installer/output/edge-impulse-linux-cli-windows-${{ matrix.arch }}-setup.exe
tag_name: ${{ github.ref_name }}
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,48 @@ Add the library to your application via:
$ npm install edge-impulse-linux
```

## Windows offline installer (for locked-down environments)

For corporate-managed Windows devices where `npm install` is blocked (TLS interception, no build tools, restricted package access), this repo also supports a prebuilt Windows installer artifact via GitHub Actions.

### What this installer includes

* Bundled `node.exe` runtime (no separate Node.js install required)
* Prebuilt `node_modules` from CI (no local `node-gyp` / Python toolchain required)
* Installed CLI shims in PATH:
* `edge-impulse-linux`
* `edge-impulse-linux-runner`
* `edge-impulse-camera-debug`

### End-user requirements

* Windows 10/11 (`x64` or `arm64` artifact)
* Administrator rights to install (writes to `Program Files` and system PATH)
* WSL is not required for installation, but recommended for full Linux CLI behavior

### Important runtime note

This is still the Linux CLI package, packaged for Windows installation. Some commands or hardware flows that depend on Linux-specific behavior or drivers may still require Linux/WSL at runtime.

For full functionality, install WSL first from an elevated Command Prompt:

```
wsl --install
```

### Build and download installer artifacts

Use the workflow in this repository:

* **Actions** → **Build Windows Linux-CLI Installer**

Artifacts produced:

* `edge-impulse-linux-cli-windows-x64`
* `edge-impulse-linux-cli-windows-arm64`

Each artifact zip contains a `.exe` installer.

## Collecting data

Before you can classify data you'll first need to collect it. If you want to collect data from the camera or microphone on your system you can use the Edge Impulse CLI, and if you want to collect data from different sensors (like accelerometers or proprietary control systems) you can do so in a few lines of code.
Expand Down Expand Up @@ -49,6 +91,59 @@ You can pass in options to the CLI. Here are the key ones:

edge-impulse-linux and edge-impulse-linux-runner can be run as a service via a custom AWS IoT Greengrass component(s). When provided with the "--greengrass" option, both services will utilize the AWS IoT Greengrass authentication context (ONLY present when launched as a AWS IoT Greengrass custom component) as well as AWS Secrets Manager to extract the api key to be used to authenticate to a new project. If the authentication context is abscent and/or incorrect, both services will simply ignore the "--greengrass" option that was provided and continue with any of the other provided options normally.

### Snapdragon Hardware Acceleration (Windows ARM64)

The Windows installer for ARM64 devices on Qualcomm Snapdragon platforms includes automatic detection and support for **QNN (Qualcomm Neural Network)** hardware acceleration.

#### What this enables

* Neural network inference via Snapdragon NPU (Neural Processing Unit)
* Optimized DSP (Digital Signal Processing) for audio/signal preprocessing
* Accelerated model compilation to ONNX and TensorFlow Lite formats
* Automatic fallback to CPU mode if acceleration libraries unavailable

#### Supported devices

* Windows 11 ARM64 on Snapdragon processors (X SoC, Gen 3, etc.)
* Qualcomm reference boards (RB3 Gen 2, IQ-9)

#### Checking for Snapdragon acceleration

After installation, run the included detection script to verify acceleration support:

```powershell
# From Command Prompt or PowerShell
%PROGRAMFILES%\EdgeImpulse Linux CLI\bin\detect-snapdragon.ps1
```

Expected output for Snapdragon device:

```
✓ Snapdragon device detected: <processor-name>
✓ QNN runtime available - hardware acceleration enabled
```

If QNN runtime is not detected:

```
ℹ Qualcomm Snapdragon detected: <processor-name>
ℹ QNN runtime not detected - install Qualcomm AI Hub or Snapdragon SDK for acceleration
```

#### Installing QNN runtime

To enable QNN hardware acceleration, install one of:

1. **Qualcomm AI Hub** - Recommended for developers
- Download from https://qualcomm.ai/hub
- Includes QNN SDK and runtime libraries

2. **Snapdragon SDK** - For Snapdragon platform development
- Available via Qualcomm Developer Network
- Includes TensorFlow Lite with QNN delegate support

After installation, the CLI will automatically detect and use QNN for model execution. The system gracefully falls back to CPU inference if QNN libraries are unavailable.

## Classifying data

To classify data (whether this is from the camera, the microphone, or a custom sensor) you'll need a model file. This model file contains all signal processing code, classical ML algorithms and neural networks - and typically contains hardware optimizations to run as fast as possible. To grab a model file:
Expand Down
4 changes: 4 additions & 0 deletions windows-installer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
staging/
output/
# Only ignore generated sub-folder; header.bmp / welcome.bmp are pre-built and committed.
branding/generated/
Binary file added windows-installer/branding/header.bmp
Binary file not shown.
Binary file added windows-installer/branding/welcome.bmp
Binary file not shown.
97 changes: 97 additions & 0 deletions windows-installer/detect-snapdragon.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Snapdragon Hardware Acceleration Detector for Windows ARM64
# This script detects Qualcomm Snapdragon devices and validates QNN (Qualcomm Neural Network) runtime support
# Output: JSON object with device info and QNN availability

param(
[switch]$Json = $false
)

# Detect if running on ARM64 Windows
$isArm64 = (Get-WmiObject -Class Win32_Processor | Select-Object -ExpandProperty Architecture) -eq 12

if (-not $isArm64) {
if ($Json) {
Write-Output (ConvertTo-Json @{
"device" = "x64"
"isSnapdragon" = $false
"hasQnn" = $false
"message" = "Not an ARM64 device"
})
}
else {
Write-Output "Not an ARM64 device (current: $(Get-WmiObject -Class Win32_Processor | Select-Object -ExpandProperty Name))"
}
exit 0
}

# Detect Qualcomm Snappdragon device indicators
$deviceInfo = @{
"device" = "arm64"
"isSnapdragon" = $false
"hasQnn" = $false
"processorName" = ""
"message" = ""
}

try {
$processor = Get-WmiObject -Class Win32_Processor | Select-Object -ExpandProperty Name
$deviceInfo.processorName = $processor

# Check for Qualcomm Snapdragon indicators
if ($processor -like "*Qualcomm*" -or $processor -like "*Snapdragon*") {
$deviceInfo.isSnapdragon = $true
$deviceInfo.message = "Qualcomm Snapdragon detected: $processor"
}
}
catch {
$deviceInfo.message = "Warning: Could not detect processor details (error: $_)"
}

# Check for QNN runtime library in WSL2 (if available)
# This would require WSL with Qualcomm AI Hub or Snapdragon SDK installed
$qnnPaths = @(
"$env:USERPROFILE\.qnn\lib\libQnnTFLiteDelegate.so",
"$env:ProgramFiles\Qualcomm\*\lib\*QNN*",
"C:\Program Files\Qualcomm AI Hub\*\lib\*QNN*"
)

foreach ($path in $qnnPaths) {
if (Test-Path $path) {
$deviceInfo.hasQnn = $true
$deviceInfo.message += " | QNN runtime detected at: $path"
break
}
}

# Check environment variables for Snapdragon SDK
if (Test-Path env:QUALCOMM_SDK_ROOT) {
$deviceInfo.hasQnn = $true
$deviceInfo.message += " | QUALCOMM_SDK_ROOT found"
}

if (Test-Path env:QNN_SDK_ROOT) {
$deviceInfo.hasQnn = $true
$deviceInfo.message += " | QNN_SDK_ROOT found"
}

# Output result
if ($Json) {
Write-Output (ConvertTo-Json $deviceInfo -AsArray)
}
else {
if ($deviceInfo.isSnapdragon) {
Write-Output "✓ Snapdragon device detected: $($deviceInfo.processorName)"
if ($deviceInfo.hasQnn) {
Write-Output "✓ QNN runtime available - hardware acceleration enabled"
}
else {
Write-Output "ℹ QNN runtime not detected - install Qualcomm AI Hub or Snapdragon SDK for acceleration"
}
}
else {
Write-Output "ℹ ARM64 device detected but not confirmed as Snapdragon"
Write-Output " Processor: $($deviceInfo.processorName)"
}
}

exit 0
Loading
Loading