Skip to content

Commit c64df86

Browse files
Merge pull request #7 from brightsign/fix-librknnrt
Fix librknnrt
2 parents cabc6c8 + 58e8841 commit c64df86

File tree

6 files changed

+174
-294
lines changed

6 files changed

+174
-294
lines changed

.claude/settings.local.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,15 @@
7878
"Bash(source:*)",
7979
"Bash(./run_yolox_test.sh:*)",
8080
"Bash(./brightsign-x86_64-cobra-toolchain-9.1.52.sh:*)",
81-
"Bash(nm:*)"
81+
"Bash(nm:*)",
82+
"Bash(git stash pop:*)",
83+
"Bash(gh release create:*)",
84+
"Bash(gh auth:*)",
85+
"Bash(git stash push:*)",
86+
"Bash(git push:*)",
87+
"Bash(git config:*)",
88+
"Bash(git remote set-url:*)",
89+
"Bash(ssh:*)"
8290
],
8391
"deny": []
8492
}

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Python CV development extension for BrightSign digital signage players (embedded
66

77
__Provides__: Python 3.8, OpenCV, PyTorch, ONNX, RKNN toolkit, scientific computing stack and an extensible Python development environment
88

9-
__Target__: Enterprise edge CV applications (audience analytics, interactive displays, retail analytics)
9+
__Target__: Enterprise edge CV applications (audience analytics, interactive displays, retail analytics)
1010

1111
__Key requirement__: x86_64 development host (Apple Silicon incompatible due to RKNN toolchain)
1212

@@ -62,12 +62,20 @@ __Time__: 60-90 min | __Prerequisites__: Docker, git, x86_64 host, BrightSign pl
6262
# Build extension (30-60 min)
6363
git clone git@github.com:brightsign/python-cv-dev-extension.git
6464
cd python-cv-dev-extension
65+
66+
```
67+
68+
```bash
6569
./setup && ./build --extract-sdk
6670

6771
# Package (5 min)
6872
./brightsign-x86_64-cobra-toolchain-*.sh -d ./sdk -y
6973
./package
7074

75+
```
76+
77+
```bash
78+
7179
# Deploy & validate
7280
# Transfer .zip via DWS, install via SSH, then:
7381
export PLAYER_IP=${PLAYER_IP:-192.168.1.100} # Replace with your player IP
@@ -759,7 +767,7 @@ if [ ! -d "sdk/sysroots/aarch64-oe-linux/usr/lib/python3.8/site-packages/torch"
759767
fi
760768
```
761769

762-
**Note**: The Rockchip RKNN runtime library (`librknnrt.so`) and Python packages are automatically included through BitBake recipes - no manual patching required.
770+
**Note**: The Rockchip RKNN runtime library (`librknnrt.so`) is automatically downloaded during SDK installation. Python packages are included through BitBake recipes.
763771

764772
### Docker Image Management
765773

@@ -832,7 +840,7 @@ python3 -c "import cv2, pandas, torch, numpy; print('Core packages working')"
832840

833841
The extension provides packages through two mechanisms:
834842

835-
**✅ SDK-Built Packages (Always Available)**
843+
__✅ SDK-Built Packages (Always Available)__
836844
These are built into the extension and available immediately after sourcing `setup_python_env`:
837845

838846
```python

bsoe-recipes/meta-bs/recipes-open/librknnrt/librknnrt_2.3.2.bb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# NOTE: This recipe is currently unused as librknnrt.so is downloaded manually
2+
# during SDK installation (similar to the reference project approach).
3+
# The manual download approach is simpler and more reliable for this binary-only library.
4+
15
SUMMARY = "RKNN Runtime Library for Rockchip NPU"
26
DESCRIPTION = "Runtime library for executing RKNN models on Rockchip NPU hardware"
37
HOMEPAGE = "https://github.com/airockchip/rknn-toolkit2"

build

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,28 @@ if [ $? -eq 0 ]; then
229229
echo "✅ SDK extracted to ${SCRIPT_DIR}/${SDK_BASENAME}"
230230
# Clean up the copy in srv
231231
rm -f "$SDK_FILE"
232+
233+
# Also install and patch SDK if requested
234+
echo "Installing SDK to ./sdk directory..."
235+
if "${SCRIPT_DIR}/${SDK_BASENAME}" -d "${SCRIPT_DIR}/sdk" -y; then
236+
echo "✅ SDK installed to ./sdk"
237+
238+
# Patch SDK with Rockchip libraries (same as reference project)
239+
echo "Adding librknnrt.so to SDK..."
240+
cd "${SCRIPT_DIR}/sdk/sysroots/aarch64-oe-linux/usr/lib"
241+
if [ ! -f "librknnrt.so" ]; then
242+
if wget -q https://github.com/airockchip/rknn-toolkit2/raw/v2.3.2/rknpu2/runtime/Linux/librknn_api/aarch64/librknnrt.so; then
243+
echo "✅ librknnrt.so downloaded to SDK"
244+
else
245+
echo "⚠️ Failed to download librknnrt.so - continuing anyway"
246+
fi
247+
else
248+
echo "✅ librknnrt.so already present in SDK"
249+
fi
250+
cd "${SCRIPT_DIR}"
251+
else
252+
echo "⚠️ SDK installation failed - SDK installer is available for manual installation"
253+
fi
232254
else
233255
echo "❌ SDK file not found in /srv directory"
234256
echo " Expected: ${SCRIPT_DIR}/srv/brightsign-x86_64-*-toolchain-*.sh"

0 commit comments

Comments
 (0)