Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/happyme531/ztu_somemodelruntime_ez_rknn_async/llms.txt

Use this file to discover all available pages before exploring further.

EZ RKNN Async is a native extension that must be compiled on (or for) the target Rockchip device. There is no pre-built wheel on PyPI — you build a wheel from source and install it locally.

Requirements

Before building, make sure the following are present on your device:
  • Python 3.7+ with pip
  • Rockchip device with RKNPU2 (RK3588, RK3566, RK3568, etc.)
  • librknnrt.so installed system-wide (provided by the Rockchip RKNN SDK)
  • CMake 3.18+
  • A C++17-capable compiler (GCC 8+ or Clang 7+)
  • pybind11 ≥ 2.10 (installed automatically by the build system)
RKNN SDK version 2.4.1 or later is strongly recommended. If an older version of librknnrt.so is detected at runtime, the library will emit a warning that behavior may be unstable.

Build and install from source

1

Clone the repository

git clone https://github.com/happyme531/ztu_somemodelruntime_ez_rknn_async.git
cd ztu_somemodelruntime_ez_rknn_async
2

Build a wheel

Use pip’s wheel-building mode with scikit-build-core as the build backend. The --no-deps flag skips building dependency wheels, keeping the output directory clean.
python3 -m pip wheel . -w dist --no-deps
CMake 3.18+ is required. The build system picks up the RKNN headers and librknnrt.so from the system include and library paths automatically.
To build with debug symbols for development, add --config-settings=cmake.build-type=Debug to the command above.
3

Install the built wheel

pip install dist/*.whl
This installs the compiled extension along with its Python runtime dependencies (numpy and, on Python 3.7, typing_extensions).
4

Verify the installation

import ztu_somemodelruntime_ez_rknn_async as ez
print(ez.__version__)
print(ez.InferenceSession)
If the import succeeds and prints the version string, the library is installed correctly.

Build dependencies summary

DependencyMinimum versionNotes
Python3.7
CMake3.18Required by scikit-build-core
C++ compilerC++17GCC 8+ or Clang 7+
pybind112.10Fetched automatically if not present
scikit-build-core0.5 (Python < 3.8), 0.7 (Python ≥ 3.8)Build backend
numpy1.21Runtime dependency
typing_extensions4.0Runtime dependency on Python 3.7 only
librknnrt.so2.4.1+ recommendedMust be installed on the device

Troubleshooting

librknnrt.so not found during build Make sure the RKNN SDK runtime library is installed. On most Linux distributions this means the .so file is in /usr/lib or /usr/local/lib. If it is in a non-standard location, set LD_LIBRARY_PATH before building:
export LD_LIBRARY_PATH=/path/to/rknn/lib:$LD_LIBRARY_PATH
CMake version too old The default system CMake on older distributions may be below 3.18. Install a newer version via pip:
pip install cmake
C++17 errors Pass the standard explicitly if your compiler does not default to C++17:
python3 -m pip wheel . -w dist --no-deps \
  --config-settings=cmake.args="-DCMAKE_CXX_STANDARD=17"

Build docs developers (and LLMs) love