RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /Edge AI: Mobile and IoT
  6. /Ch. 2
Edge AI: Mobile and IoT

02. Raspberry Pi Setup

Chapter 2 of 18 · 20 min
KEY INSIGHT

Thermal management and storage quality determine Raspberry Pi deployment reliability more than compute performance.

Raspberry Pi serves as the standard entry point for edge AI experimentation. The Pi 4 Model B with 4GB RAM provides a reproducible baseline: 64-bit ARM Cortex-A72, VideoCore VI GPU with 1 TOPS throughput, and USB 3.0 storage interface. This configuration runs most quantized models at interactive speeds.

Initial setup requires flashing a 64-bit operating system. Ubuntu Server 22.04 LTS outperforms Raspberry Pi OS for ML workloads due to optimized BLAS libraries and better compiler toolchain support. The flashing command:

# Download Ubuntu Server 22.04 LTS 64-bit
wget https://cdimage.ubuntu.com/ubuntu-server/jammy/daily-bootleg/zCuZnvLAUFBZbdmtJrkjLS6aGJKqdpVGa_los_3.04.2023.img.xz
# Flash to SD card (replace /dev/sdX with actual device)
xzcat zCuZnvLAUFBZbdmtJrkjLS6aGJKqdpVGa_los_3.04.2023.img.xz | sudo dd of=/dev/sdX bs=4M status=progress

After initial boot, configure config.txt to enable hardware video encoding if using camera inputs. Add these lines to /boot/firmware/config.txt:

# Enable hardware codecs
start_x=1
gpu_mem=128

Memory allocation deserves serious attention. Setting gpu_mem=128 reserves 128MB for GPU operations—necessary for camera pipelines but reduces available RAM. For pure CPU inference with 4GB total RAM, gpu_mem=16 suffices.

Common post-installation failures include thermal throttling and SD card corruption. The Pi 4 throttles at 80°C core temperature, dropping from 1.5GHz to 1.0GHz. Installing a heatsink and fan drops sustained operating temperature by 15-20°C. SD card corruption manifests as filesystem errors appearing weeks after deployment—always use high-endurance industrial SD cards (Samsung Pro Endurance or similar) for production.

Python environment setup requires separate virtualenv for ML dependencies to avoid system package conflicts:

sudo apt update && sudo apt install -y python3.10-venv libgomp1
python3 -m venv ~/venv-ml
source ~/venv-ml/bin/activate
pip install --upgrade pip setuptools wheel
pip install numpy scipy onnxruntime quantization-lib

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Configure a Raspberry Pi 4 with Ubuntu Server, verify CPU governor settings (cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor), and install a 64-bit Python ML environment.

← Chapter 1
Edge AI Overview
Chapter 3 →
ONNX Runtime