This document prepares a Fedora x86_64 Linux computer to build the QNX AI Camera sample and a custom traffic-warning application using:
- QNX SDP 8.0
- QNX Sensor Framework camera APIs
- TensorFlow Lite
- OpenCV
- Raspberry Pi running QNX OS 8.0
The libraries and application are cross-compiled on the Fedora computer. SSH/SCP are used only to copy files to the Raspberry Pi and run them.
Note on host OS: The upstream AI Camera App project officially tests on Ubuntu, but this workspace is set up and verified on Fedora. The steps below are Fedora-specific and include fixes for host-package differences (notably a newer CMake and a missing
patchtool) that the Ubuntu instructions do not need.
Each developer needs:
- An x86_64 Fedora computer
- A
myQNXaccount - A valid QNX SDP 8.0 license
- QNX Software Center for Linux
- QNX SDP 8.0 installed locally
- Access to the QNX Raspberry Pi over SSH
- Git and standard C/C++ build tools
- At least 20 GB of free disk space
- Preferably 16 GB or more RAM
QNX SDP and its license files are proprietary. Do not copy another developer's
qnx800directory or license files. Every developer must install and activate QNX through their own authorized account.
-
Create or sign in to a
myQNXaccount: -
Make sure a QNX SDP 8.0 license is deployed to that account.
- Organization users: ask the organization's QNX license administrator.
- Students, hobbyists, and non-commercial users can check:
-
In the myQNX License Manager:
- Accept the license agreement.
- Deploy the license to your own user account.
-
Download QNX Software Center for Linux:
-
Run the downloaded installer:
cd ~/Downloads
chmod +x qnx-setup-*-linux.run
./qnx-setup-*-linux.run- Launch QNX Software Center and sign in using the licensed myQNX account.
Using QNX Software Center, create a QNX SDP 8.0 installation.
Recommended installation directory:
~/qnx800
Install these packages into the same SDP installation:
com.qnx.qnx800.target.sf.camapi
com.qnx.qnx800.target.sf.base
com.qnx.qnx800.target.mm.aoi
com.qnx.qnx800.target.mm.mmf.core
com.qnx.qnx800.target.screen.img_codecs
These provide the camera APIs, QNX Sensor Framework components, multimedia support, and Screen image codecs required by the AI Camera App and OpenCV port.
After installation, confirm this file exists:
ls ~/qnx800/qnxsdp-env.shIf QNX was installed somewhere else, use that path in all later commands.
Heads-up — target Python version. The current QNX SDP 8.0 ships Python 3.13 in its target sysroot (
$QNX_TARGET/usr/include/python3.13,libpython3.13.so), but thebuild-filesports are pinned to Python 3.11. This mismatch does not need to be solved, because the C++ AI Camera App does not use any Python bindings — see Section 7, which disables the bindings entirely.
sudo dnf install -y \
git make cmake gcc gcc-c++ gcc-gfortran \
python3.11 python3.11-devel python3-pip \
ninja-build pkgconf-pkg-config \
patch
patchis required and easy to miss. The TensorFlow Lite build applies patches to third-party dependencies (e.g.pthreadpool). Fedora does not installpatchby default, and without it the TFLite build fails withpatch: command not found(exit 127).
Verify:
git --version
cmake --version
python3.11 --version
patch --versionCMake note. Recent Fedora ships CMake 4.x, which has removed compatibility with the very old
cmake_minimum_requiredversions used by some TFLite dependencies (FP16,pthreadpool). The build will fail at configure time withCompatibility with CMake < 3.5 has been removed. This is fixed by installing an older CMake into the project virtualenv in Section 6 — do not attempt to downgrade the system CMake.
Create the workspace:
mkdir -p ~/qnx_workspace
cd ~/qnx_workspaceClone the AI Camera sample:
git clone --depth 1 \
https://gitlab.com/qnx/projects/ai-camera-app.gitClone the QNX port build files:
git clone --depth 1 \
https://github.com/qnx-ports/build-files.gitClone the QNX TensorFlow fork using a shallow clone:
git clone \
--depth 1 \
--single-branch \
--no-tags \
--branch qnx_v2.16.1 \
https://github.com/qnx-ports/tensorflow.gitClone OpenCV, NumPy, and muslflt:
git clone --depth 1 https://github.com/qnx-ports/opencv.git
git clone --depth 1 https://github.com/qnx-ports/numpy.git
git clone --depth 1 https://github.com/qnx-ports/muslflt.gitInitialize NumPy submodules:
cd ~/qnx_workspace/numpy
git submodule update --init --recursive
cd ~/qnx_workspaceThe workspace must look like this:
~/qnx_workspace/
├── ai-camera-app/
├── build-files/
├── muslflt/
├── numpy/
├── opencv/
└── tensorflow/
Do not rename these directories. The build files expect this sibling-directory layout.
cd ~/qnx_workspace
python3.11 -m venv env
source env/bin/activate
python -m pip install --upgrade pip
python -m pip install \
"Cython==0.29.35" \
wheel requests pybind11Install an older CMake into the virtualenv (fixes the CMake 4.x incompatibility from Section 4). Because the venv's bin is first on PATH while it is active, this CMake takes precedence over the system one during the build:
python -m pip install "cmake<4"
cmake --version # should now report 3.31.x while the venv is activeWhenever opening a new terminal for this project, reactivate the venv:
source ~/qnx_workspace/env/bin/activateThe AI Camera App is a C++ program. It links libtensorflow-lite.so and OpenCV's C++ modules and does not use numpy or any Python bindings (see ai-camera-app/common.mk LIBS). The stock ports, however, try to build the numpy / TFLite / OpenCV Python bindings, which require Python 3.11 headers on the QNX target — the exact thing the SDP no longer ships (see the note in Section 3).
The fix is to disable the Python bindings in the three ports. This removes the need for any target Python (3.11 or 3.13) and lets the build proceed. All three edits are reversible.
NumPy is only an input to the TFLite/OpenCV Python bindings. Skip its build step. The provided scripts/build_all.sh in this workspace already does this — if you are wiring up your own script, replace the NumPy build step with a no-op.
Edit build-files/ports/tensorflow/common.mk. Gate the Python-binding steps behind a flag that defaults to off, so tflite_all builds only the C++ library:
# TFLITE_PYTHON=true also builds the Python bindings (needs target numpy + python3.x headers).
# Default false: the ai-camera-app is C++ and only needs libtensorflow-lite.so.
TFLITE_PYTHON ?= false
tflite_all:
@mkdir -p build
cd build && cmake $(CMAKE_ARGS) $(QNX_PROJECT_ROOT)/tensorflow/lite/
cd build && make all $(MAKE_ARGS)
ifeq ($(TFLITE_PYTHON),true)
cd build && make _pywrap_tensorflow_interpreter_wrapper $(MAKE_ARGS)
BUILD_DIR=$(PWD)/build/python_loader CMAKE_BUILD_DIR=$(PWD)/build $(QNX_PROJECT_ROOT)/tensorflow/lite/tools/pip_package/build_pip_package_with_cmake.sh nto
mkdir -p $(INSTALL_ROOT)/$(CPUVARDIR)/$(PREFIX)/lib/python3.11/site-packages && cp -r $(PWD)/build/python_loader/tflite_runtime $(PWD)/build/python_loader/tflite_runtime.egg-info $(INSTALL_ROOT)/$(CPUVARDIR)/$(PREFIX)/lib/python3.11/site-packages
endifEdit build-files/ports/opencv/common.mk and flip these CMake flags:
-DBUILD_opencv_python3=OFF \
-DBUILD_opencv_python_bindings_generator=OFF \
-DOPENCV_PYTHON_INSTALL_TARGET=OFF \To re-enable the Python bindings later, you must provide a matching target Python (3.11) + a cross-built numpy, then set
TFLITE_PYTHON=trueand flip the OpenCV flags back toON.
Run:
source ~/qnx800/qnxsdp-env.shVerify:
echo "$QNX_HOST"
echo "$QNX_TARGET"
which qcc
qcc -Vgcc_ntoaarch64leQNX_HOST and QNX_TARGET must not be empty, and qcc must be found inside the QNX SDP installation.
Whenever opening a new terminal, run both:
source ~/qnx_workspace/env/bin/activate
source ~/qnx800/qnxsdp-env.sh
scripts/build_all.shsources~/qnx800/qnxsdp-env.shitself, so you do not have to source it manually before running the script. You still need the venv active (for the older CMake).
With the venv active and the fixes from Section 7 applied:
cd ~/qnx_workspace
JOBS=4 ./scripts/build_all.shThe script builds in this order (NumPy is intentionally skipped):
1. flatc (native host FlatBuffers compiler)
2. TensorFlow Lite (C++ library only)
3. muslflt
4. OpenCV (C++ modules, no Python)
5. ai-camera-app
JOBS controls parallelism. Use JOBS=4 for the first build unless the host has plenty of RAM; TFLite and OpenCV are memory-hungry.
On success the application binary is at:
~/qnx_workspace/ai-camera-app/nto/aarch64/o.le/ai-camera-app
Replace PI_IP with the target address:
ssh qnxuser@PI_IPOn the Pi, check:
uname -a
uname -mThe target should be an AArch64 QNX system.
Return to the host:
exitThe Pi is used to run the software. TensorFlow Lite, OpenCV, and the application are built on Fedora.
The QNX Raspberry Pi image already contains the required camera and Sensor Framework setup.
Do not reinstall the Sensor Framework using apk. Doing so may break the provided image and require reflashing it.
The Camera Module 3 startup entry must be enabled in:
/etc/startup/post_startup.sh
Follow the Raspberry Pi image or event instructions for the exact camera configuration. On the provided Raspberry Pi 5 setup, use the camera connector nearest the USB ports.
Package commands such as these run on the QNX Pi, not on Fedora:
sudo apk update
sudo apk list
sudo apk add <package>Do not use them to reinstall camera or sensor-framework components.
The setup is complete when all of these succeed on the Fedora host:
test -d ~/qnx_workspace/ai-camera-app
test -d ~/qnx_workspace/build-files
test -d ~/qnx_workspace/tensorflow
test -d ~/qnx_workspace/opencv
test -d ~/qnx_workspace/numpy
test -d ~/qnx_workspace/muslflt
source ~/qnx_workspace/env/bin/activate
source ~/qnx800/qnxsdp-env.sh
python --version # Python 3.11.x
cmake --version # 3.31.x (from the venv)
patch --version # present
qcc -Vgcc_ntoaarch64leExpected result:
- Python 3.11 virtual environment is active
- CMake 3.x (from the venv) shadows the system CMake 4.x
patchis installed- QNX SDP variables are loaded
- The AArch64 QNX compiler is available
- All six source repositories exist
- The port build fixes from Section 7 are applied
- SSH access to the QNX Pi works
patch: command not found/Error 127during the TFLite build — installpatch(Section 4).Compatibility with CMake < 3.5 has been removed— the system CMake 4.x is being used; activate the venv and installcmake<4(Section 6). If a build dir was already configured with CMake 4.x, delete it (rm -rfthe port'snto-*/buildandflatc-native-build) so it reconfigures with the older CMake.Cannot compile 'Python.h'during a NumPy or Python-binding build — you are building a Python binding against a target Python that is not present (SDP ships 3.13, ports expect 3.11). Apply the Section 7 fixes to disable the bindings.
- QNX AI Camera App:
- QNX SDP 8.0 installation guide:
- TensorFlow Lite QNX port:
- OpenCV QNX port: