Quick answers to common questions about the BrightSign Python CV Extension.
Short answer: No, Apple Silicon (ARM64) is not compatible.
Why: The RKNN toolkit (required for NPU support) only provides x86_64 model compilation tools. Cross-compiling from ARM64 to ARM64 is not supported by Rockchip.
Solutions:
- Use an Intel/AMD Mac or PC
- Use x86_64 cloud VM (AWS EC2, Google Cloud, Azure)
- Use Docker Desktop with x86_64 emulation (slow but works)
Cloud VM recommendation: AWS EC2 t3.xlarge (4 vCPU, 16GB RAM, ~$0.16/hour)
No, same limitation as Apple Silicon. The RKNN toolkit requires x86_64 architecture for model compilation.
Use a cloud VM:
# Example: AWS EC2 instance
aws ec2 run-instances \
--image-id ami-xxxxxx \ # Ubuntu 22.04 x86_64
--instance-type t3.xlarge \
--key-name your-key
# SSH in and build normally
ssh -i your-key.pem ubuntu@<instance-ip>
git clone ... && cd python-cv-dev-extension
./check-prerequisites # Should pass on x86_64 instanceReasons:
- Cross-compilation: Building ARM64 binaries on x86_64 host
- Large source tree: BrightSign OS is ~20GB
- Complex dependencies: Python + OpenCV + PyTorch + RKNN
- First build compiles everything: ~200+ packages
Subsequent builds are faster (5-15 min) because BitBake caches compiled packages.
Tips to speed up:
- Build incrementally:
./build python3-opencvinstead of full SDK - Use
--cleanonly when necessary - Don't run
--distcleanunless absolutely needed - Use SSD instead of HDD
- Allocate more CPU cores to Docker
Yes, allocate more resources to Docker:
Docker Desktop (Mac/Windows):
- Settings → Resources
- Increase CPUs: 4-8 cores recommended
- Increase Memory: 8-16GB recommended
- Enable "Use the new Virtualization framework" (Mac)
Linux:
- Docker uses all available resources by default
- Ensure host has adequate resources (16GB+ RAM)
Breakdown:
- Docker image: ~20GB (includes BrightSign OS source)
- Build artifacts: ~20GB (BitBake work directories)
- SDK: ~10GB (extracted cross-compiler + libraries)
- Packages: ~1GB (output zip files)
- Total: ~51GB
Space-saving tip: Delete old build artifacts after successful builds:
./build --distclean # Cleans tmp directories
rm -f *.zip # Delete old packagesBitBake is the build tool used by OpenEmbedded/Yocto to cross-compile embedded Linux systems.
Why needed: BrightSign OS is built with OpenEmbedded, so we use the same build system to create compatible packages.
You don't need to learn BitBake for basic usage - the ./build script handles it for you.
Development Package (pydev-*.zip):
- Installed to
/usr/local/pydev/ - Volatile - lost on reboot
- Quick to deploy (no reboot needed)
- Use for: Testing, development, iteration
Production Package (ext_pydev-*.zip):
- Installed as system extension to
/var/volatile/bsext/ext_pydev/ - Persistent - survives reboots
- Auto-starts on boot
- Requires reboot to activate
- Use for: Production deployments, final release
Recommendation: Use development packages during development, switch to production when stable.
Method 1: Via DWS (Diagnostic Web Server):
- Download firmware: OS 9.1.79.3
- Extract the
.bsfwfile from zip - Navigate to
http://<player-ip>:8080 - Go to "Software Updates" tab
- Upload
.bsfwfile - Reboot player
Method 2: Via Serial Console:
- Connect serial cable (115200 bps, n-8-1)
- Interrupt boot (Ctrl-C within 3 seconds)
- Follow on-screen firmware update instructions
Verify version after update:
ssh brightsign@<player-ip>
cat /etc/version # Should show 9.1.79.3 or laterShort answer: Older OS versions don't include the NPU runtime library.
Technical details:
- RKNN toolkit requires
librknnrt.soat/usr/lib/librknnrt.so - OS 9.1.79.3+ includes this library in the system image
- Older versions would need complex binary patching workarounds
If you can't upgrade: Extension will install but NPU features won't work. CPU-only Python/OpenCV will still function.
Warning: Only unsecure development/test players, never production units.
Via serial console:
# Connect serial (115200 bps, n-8-1)
# Press Ctrl-C during boot to interrupt
=> console on
=> reboot
# On next boot, interrupt again
=> setenv SECURE_CHECKS 0
=> envsave
=> rebootVerify:
ssh brightsign@<player-ip> # Should connect without issuesMost common reason: User scripts are disabled by default for security.
Fix:
- Enable via DWS registry at
http://<player-ip>:8080 - Go to Registry tab
- Enter:
registry write extension bsext-pydev-enable-user-scripts true - Reboot player
Other reasons:
- Scripts not executable:
chmod +x /storage/sd/python-init/*.sh - Scripts in wrong location: Must be in
/storage/sd/python-init/ - Script errors: Check
/var/log/bsext-pydev.logfor errors
Complete troubleshooting: See docs/troubleshooting-user-init.md for comprehensive diagnostics covering all 21+ failure points.
Directly: No, only shell scripts (.sh files) can execute from /storage/sd/ (noexec mount).
Workaround: Shell script calls Python:
#!/bin/bash
# 02_my_python_script.sh
# Source Python environment
source /var/volatile/bsext/ext_pydev/sh/setup_python_env
# Run Python script (store .py files elsewhere)
python3 /usr/local/my_script.py
# Or inline Python
python3 << 'EOF'
import torch
print(f"PyTorch version: {torch.__version__}")
EOFSee user-init/templates/python_wrapper.sh for a complete template.
Process:
- Extension reads
/storage/sd/python-init/requirements.txton startup - Runs
pip3 install --break-system-packages -r requirements.txt - Packages install to
/usr/local/lib/python3.8/site-packages(volatile) - Installation log saved to
/storage/sd/python-init/requirements-install.log
Limitations:
- Only PyPI packages with pre-compiled ARM64 wheels will work
- Player has no build tools (no cmake, gcc, etc.)
- Packages requiring compilation will fail
Check if package has ARM64 wheel:
# On your dev machine
pip index versions <package-name> | grep -i arm
# Or check PyPI page → "Download files" → look for aarch64/arm64 wheelsNPU: Neural Processing Unit - hardware accelerator for AI/ML inference.
Benefits:
- 10x faster inference vs CPU
- Lower power consumption
- Real-time object detection/segmentation
- Offloads CPU for other tasks
Example: YOLOX object detection
- CPU: ~100ms per frame
- NPU: ~10ms per frame
Yes! The extension provides full Python 3.8 + OpenCV + NumPy + PyTorch even without NPU.
What works without NPU:
- OpenCV image processing
- NumPy numerical computing
- PyTorch CPU inference
- All standard Python libraries
What requires NPU:
- RKNN model inference
- Model zoo examples
- NPU-accelerated models (
.rknnfiles)
Problem: Official model_zoo examples use full rknn-toolkit2 which has:
- Hardcoded
/usr/lib64/paths (BrightSign uses/usr/lib/) - Designed for x86_64 hosts, not ARM64 embedded targets
Solution: We provide py_utils compatibility wrapper that:
- Uses
RKNNLiteinstead (designed for embedded ARM64) - Handles API differences automatically
- Makes model_zoo examples "just work"
Usage:
# Just copy the wrapper before running examples
cp -r /usr/local/pydev/examples/py_utils \
/usr/local/rknn_model_zoo/examples/yolox/python/
# Then run normally
python3 yolox.py --model_path model.rknn ...Official sources:
-
RKNN Model Zoo: https://github.com/airockchip/rknn_model_zoo
- 50+ pre-trained models
- YOLOX, YOLOv5, YOLOv8, RetinaFace, etc.
- Download from Releases page
-
Rockchip GitHub: https://github.com/rockchip-linux/rknn-toolkit2
- Example models in
examples/directory
- Example models in
-
Convert your own:
- Use
rknn-toolkit2on x86_64 host to convert ONNX/PyTorch models - See RKNN documentation for conversion process
- Use
Problem: Recipe for package doesn't exist in BrightSign OS or your recipes.
Solution:
-
Check if package is in BrightSign OS:
./build --interactive # Inside container: bitbake-layers show-recipes | grep python3-XXX
-
If missing, create recipe in
bsoe-recipes/meta-bs/recipes-devtools/python/ -
See docs/building.md for recipe development
Problem: Player is secured (SECURE_CHECKS=1)
Solution: Unsecure player via serial console (see above)
Verify:
ssh brightsign@<player-ip>
# Should connect and show BrightSign promptDiagnosis:
# On player
source /var/volatile/bsext/ext_pydev/sh/setup_python_env
# Check Python path
python3 -c "import sys; print('\n'.join(sys.path))"
# Try importing
python3 -c "import XXX"Common causes:
- Package not in SDK: Add to build (see docs/building.md)
- Environment not sourced: Always
source sh/setup_python_envfirst - Wrong Python: Make sure using
/usr/bin/python3.8from extension - Package failed to install: Check requirements install log
Quick method:
# Copy uninstall script to safe location first
cp /var/volatile/bsext/ext_pydev/uninstall.sh /tmp/
chmod +x /tmp/uninstall.sh
# Run uninstall
/tmp/uninstall.sh
# Reboot
rebootManual method:
# Stop extension
/var/volatile/bsext/ext_pydev/bsext_init stop
# Unmount and remove
umount /var/volatile/bsext/ext_pydev
rm -rf /var/volatile/bsext/ext_pydev
lvremove --yes /dev/mapper/bsos-ext_pydev
# Reboot
rebootSee docs/building.md for complete guide.
Quick summary:
- Create BitBake recipe in
bsoe-recipes/meta-bs/recipes-devtools/python/ - Use existing recipes as templates
- Validate recipe:
./check-recipe-syntax.py recipe.bb - Build:
./build python3-<package> - Rebuild SDK and repackage
Development package: Yes, files in /usr/local/pydev/ are writable
Production extension: No, mounted read-only from LVM volume
To update production: Deploy new version and reinstall
- Fork the repository
- Make changes
- Test thoroughly
- Submit pull request
See CONTRIBUTING.md (if it exists) for detailed guidelines.
- Incremental builds: Build only changed packages
- Don't clean unnecessarily: Avoid
--distcleanunless needed - Allocate more resources: More CPU/RAM to Docker
- Use SSD: Much faster than HDD for builds
- Cache Docker image: Reuse
bsoe-buildimage across projects
Minimum: 2GB (built into XT-5 hardware) No configuration needed: BrightSign manages memory automatically
Extension uses:
- Python runtime: ~50MB
- Libraries: ~200MB
- Models in memory: Varies (YOLOX ~100MB)
Yes, but:
- Be mindful of memory usage
- NPU can only run one model at a time
- Use multiprocessing carefully (limited CPU cores)
Example: Run background model inference + HTTP server
from multiprocessing import Process
def run_inference():
# NPU inference loop
pass
def run_server():
# HTTP server
pass
if __name__ == '__main__':
p1 = Process(target=run_inference)
p2 = Process(target=run_server)
p1.start()
p2.start()- Documentation: README.md, QUICKSTART.md, docs/
- Issues: GitHub Issues
- Workflows: WORKFLOWS.md
- Troubleshooting: docs/troubleshooting.md