Skip to content

Commit 84f6043

Browse files
committed
Summary: Add the Cross compilation Script for RPi (4 & 5) for Linux host machine
Test Plan: examples/raspberry_pi/setup.sh pi5 ... [100%] Linking CXX executable llama_main [100%] Built target llama_main [SUCCESS] LLaMA runner built successfully ==== Verifying Build Outputs ==== [INFO] Checking required binaries... [SUCCESS] ✓ llama_main (6.1M) [SUCCESS] ✓ libllama_runner.so (4.0M) [SUCCESS] ✓ libextension_module.a (89K) - static library [SUCCESS] All required binaries built successfully! ==== Setup Complete! ==== ✓ ExecuTorch cross-compilation setup completed successfully! 📦 Built binaries: • llama_main: /home/sidart/working/executorch/cmake-out/examples/models/llama/llama_main • libllama_runner.so: /home/sidart/working/executorch/cmake-out/examples/models/llama/runner/libllama_runner.so • libextension_module.a: Statically linked into llama_main ✅ • Bundled libraries: /home/sidart/working/executorch/cmake-out/bundled-libs/ 📋 Next steps: 1. Copy binaries to your Raspberry Pi pi5: scp /home/sidart/working/executorch/cmake-out/examples/models/llama/llama_main pi@<rpi-ip>:~/ scp /home/sidart/working/executorch/cmake-out/examples/models/llama/runner/libllama_runner.so pi@<rpi-ip>:~/ scp -r /home/sidart/working/executorch/cmake-out/bundled-libs/ pi@<rpi-ip>:~/ 2. Copy shared libraries to system location: sudo cp libllama_runner.so /lib/ # Only this one needed! sudo ldconfig 3. Dry run to check for GLIBC or other issues: ./llama_main --help # Ensure there are no GLIBC or other errors before proceeding. 4. Download your model and tokenizer: # Refer to the official documentation for exact details. 5. Run ExecuTorch with your model: ./llama_main --model_path ./model.pte --tokenizer_path ./tokenizer.model --seq_len 128 --prompt "What is the meaning of life ?" 🎯 Deployment Summary: 📁 Files to copy: 2 (llama_main + libllama_runner.so) 🏗️ Extension module: Built-in (no separate .so needed) 🔧 Toolchain saved at: /home/sidart/working/executorch/arm-toolchain/arm-gnu-toolchain-14.3.rel1-x86_64-aarch64-none-linux-gnu 🔧 CMake toolchain file: /home/sidart/working/executorch/arm-toolchain-pi5.cmake Happy inferencing! 🚀
1 parent 45336ce commit 84f6043

File tree

8 files changed

+623
-1
lines changed

8 files changed

+623
-1
lines changed
File renamed without changes.

examples/rpi/pico2/README.md renamed to examples/raspberry_pi/pico2/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
This document outlines the steps required to run a simple Add Module on the Pico2 microcontroller using executorch.
33

44
## (Pre-requisistes) Prepare the Environment for Arm
5-
1. See <a href="https://docs.pytorch.org/executorch/main/tutorial-arm.html#set-up-the-developer-environment"/> for instructions on setting up the environment for Arm.
5+
6+
1. Setup executorch development environment, Also see <a href="https://docs.pytorch.org/executorch/main/tutorial-arm-ethos-u.html#software"/> for instructions on setting up the environment for Arm.
67
2. Make sure you have the toolchain configured correctly.
8+
79
```bash
810
which arm-none-eabi-gcc
911
--> return something like executorch/examples/arm/ethos-u-scratch/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc
@@ -22,9 +24,11 @@ executorch/examples/rpi/build_firmware_pico.sh --model=<path_to_model.pte>
2224
```
2325

2426
### Flash Firmware
27+
2528
Hold the BOOTSEL button on the Pico2 and connect it to your computer; it will mount as RPI-RP2. Copy the executorch_pico.uf2 file to this drive.
2629

2730
### Verify Execution
31+
2832
Check that the Pico2's LED blinks 10 times at 500 ms interval to confirm successful firmware execution.
2933
The Pico2's LED should blink 10 times at 500 ms intervals, indicating successful firmware execution. If connected via serial, you should see:
3034

@@ -34,7 +38,9 @@ Output: 13.000000, 136.000000, 24.000000, 131.000000
3438
```
3539

3640
### Debugging via Serial Terminal
41+
3742
On macOS or Linux, open a serial terminal with:
43+
3844
```bash
3945
screen /dev/tty.usbmodem1101 115200
4046
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)