This document is modified from https://github.com/mathklk/realsense_raspberry_pi4 to be compatible with Ubuntu 24.04 on the Raspberry Pi 5.
- Raspberry Pi 5 Model B 8GB
- Intel Realsense D435
- Ubuntu 24.04
- Start by updating, upgrading, and installing dependencies and tools:
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install automake libtool vim cmake libusb-1.0-0-dev libx11-dev xorg-dev libglu1-mesa-devsudo apt-get install clang
sudo apt-get install libtbb-dev* Create a new `udev` rule:
```bash
cd ~
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
- Apply the change:
sudo udevadm control --reload-rules && udevadm trigger- Modify the library path by adding the following line to the
.bashrcfile:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATHApply the change:
source ~/.bashrccd ~
git clone --depth=1 -b v3.10.0 https://github.com/google/protobuf.git
cd protobuf
./autogen.sh
./configure
make -j$(nproc)
sudo make install
cd python
export LD_LIBRARY_PATH=../src/.libs
python3 setup.py build --cpp_implementation
python3 setup.py test --cpp_implementation
sudo python3 setup.py install --cpp_implementation
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=3
sudo ldconfig
protoc --versionChange default C/C++ compiler to clang (#9962)
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cd ~/librealsense
mkdir build && cd build
sudo cmake .. -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=Release -DFORCE_LIBUVC=true
sudo make -j4
sudo make installcd ~/librealsense/build
sudo cmake .. -DBUILD_PYTHON_BINDINGS=bool:true -DPYTHON_EXECUTABLE=$(which python3)
sudo make -j4
sudo make install- Change the default compiler back to gcc
unset CC
unset CXX
- Modify the Python path:
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.12/dist-packages:/home/$(whoami)/librealsense/build/Release- Persist the change:
echo 'export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.12/dist-packages:/home/$(whoami)/librealsense/build/Release' >> ~/.bashrc
source ~/.bashrcsudo apt-get install python3-opengl
sudo -H pip3 install pyopengl
sudo -H pip3 install pyopengl_accelerate- Require display and desktop user to access realsense-viewer
realsense-viewer( Script : https://github.com/mathklk/realsense_raspberry_pi4 )
- Download the example python script from this repo
cd ~
wget https://raw.githubusercontent.com/mathklk/realsense_raspberry_pi4/master/example.py
chmod +x example.py- Run the script (requires a desktop environment to show the image)
-
In this video, I use a Raspberry Pi 5 with 8GB RAM running Ubuntu 24.04 and an HDMI capture device to stream the display to OBS on my notebook .
-
Hardware
- Raspberry Pi 5 Model B 8GB
- Intel Realsense D435
- HDMI Capture (Display on notebook with OBS Studio)

