Loading...

Synapse CLI

Build and Deploy

Build and Deploy

Build a Synapse App

synapsectl apps build [APP_DIR] [--skip-build] [--clean]

apps build uses Docker to cross-compile an ARM64 Synapse App and package it as a Debian package under APP_DIR/dist/.

  • APP_DIR defaults to the current directory.
  • --skip-build packages an existing build/aarch64/<app-name> binary.
  • --clean removes build output and performs a complete rebuild.

Deploy a Synapse App

Build, package, and deploy:

synapsectl -u $DEVICE apps deploy [APP_DIR]

Deploy an existing package:

synapsectl -u $DEVICE apps deploy --package dist/example-app_0.1.0_arm64.deb

Deployment calls DeployApp, streaming package metadata and one MiB chunks to the device.

If --uri is omitted, the command builds and reports the local package but does not deploy it.

List Synapse Apps

synapsectl -u $DEVICE apps list

This calls ListApps and displays installed app names and versions.

Build Peripherals

The peripherals group builds and deploys components created with the Axon Peripheral SDK.

synapsectl peripherals build {driver|gateware|both} [PERIPHERAL_DIR] [--clean]
  • driver cross-compiles the peripheral plugin and packages its shared libraries.
  • gateware builds and packages the FPGA bitstream.
  • both produces both packages.
  • PERIPHERAL_DIR defaults to the current directory.
  • --clean cleans the selected build trees first.

Driver builds require Docker and the project's driver Dockerfile. Gateware builds additionally require a Lattice Radiant license through LM_LICENSE_FILE.

Deploy Peripherals

synapsectl -u $DEVICE peripherals deploy \
  {driver|gateware|both} [PERIPHERAL_DIR] [--package PACKAGE]

Without --package, the command builds the selected component before deployment. Deployment reuses DeployApp for peripheral Debian packages. When deploying both, the driver package is installed before the gateware package.

Gateware SDK Pass-Through for Peripherals

synapsectl peripherals gateware <SDK_VERB> [SDK_ARGS...]

This command runs axon-peripheral-sdk inside the gateware container and forwards all remaining arguments verbatim. The SDK defines the available verbs, including project generation, simulation, build, packaging, and board-profile discovery. It uses the current directory as the peripheral project.

See the Axon Peripheral CLI Reference for the complete gateware command set and options.

Deploy Machine Learning Models

deploy-model prepares a .pt, .onnx, or .dlc model and uploads it to the device's reserved /models folder for use by Synapse Apps.

CPU Model

Upload a floating-point ONNX model for CPU execution:

synapsectl -u $DEVICE deploy-model model.onnx --name decoder

A .pt model is first converted to ONNX and may require --input-shape. An ONNX model is uploaded directly. The remote file is /models/<name>.onnx.

A prebuilt .dlc model is uploaded unchanged to /models/<name>.dlc.

Quantized DSP Model

synapsectl -u $DEVICE deploy-model model.onnx \
  --name decoder \
  --quantize \
  --input-list calibration/input-list.txt \
  --snpe-root /opt/qcom/aistack/qairt/2.34.0.250424

Quantization converts the model to an INT8 DLC for DSP execution. It requires Docker, the Qualcomm AI Runtime SDK, and an input-list file containing representative float32 .raw samples. The remote file is /models/<name>.dlc.

Option Purpose
--input-shape D1,D2,...Supply the model input dimensions. Dynamic ONNX dimensions default to 1 when they can be inspected automatically.
--name NAMESet the remote model name. Default: source filename without its extension.
--quantizeConvert to INT8 DLC for DSP execution.
--input-list FILEList representative .raw calibration inputs. Required with --quantize.
--snpe-root PATHSelect the QAIRT/SNPE SDK root. You can instead set SNPE_ROOT.
--forceOverwrite an existing remote model without prompting.
--username USERNAMESFTP user; default scifi-sftp.
-e FILE, --env-file FILEPassword file; default .scienv.
-f, --forget-passwordDo not store a newly entered password.