> For the complete documentation index, see [llms.txt](https://qc-ai-test.gitbook.io/qc-ai-test-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qc-ai-test.gitbook.io/qc-ai-test-docs/device-setup/rb3-gen2-vision-kit.md).

# RB3 Gen 2 Vision Kit

The Qualcomm Dragonwing RB3 Gen 2 Development Kit is a powerful Linux-based development board based around the QCS6490 SoC. It has two built-in cameras, a Kryo™ 670 CPU, Adreno™ 643L GPU and 12 TOPS Hexagon™ 770 NPU. It's available for $599 from a variety of distributors ([buy now](https://www.qualcomm.com/developer/hardware/rb3-gen-2-development-kit)).

![RB3 Gen 2 Vision Kit](/files/rHDjE84TZzmbK55x2Phi)

## Setup

### Installing Ubuntu 24.04

The RB3 Gen 2 Vision Kit comes with the Yocto-based Qualcomm Linux by default. You'll want to switch to Ubuntu 24.04 to follow the tutorials in this documentation.

1. If it's on, turn your RB3 Gen 2 Vision Kit off, and disconnect the power adapter.
2. You'll need to connect the RB3 Gen 2 Vision Kit to your computer using *two* USB cables.
   * Connect the RB3 to your computer using a micro-USB cable (using the port highlighted in yellow):

     ![](/files/V9ZrBpvbpCQ2FkeLocyZ)
   * Connect the RB3 to your computer using an USB-C cable (using the port highlighted in red):

     ![](/files/859oq7hvTu8qKT5ttKqq)
3. While flashing you'll need the 'F\_DL' and 'Power' buttons. They are here:

   <figure><img src="/files/xrcep0NYYdGn67Oup8Fz" alt="F_DL button"><figcaption><p>F_DL button</p></figcaption></figure>

   <figure><img src="/files/yg0F9uhIFgk61KnvK95a" alt="Power button"><figcaption><p>Power button</p></figcaption></figure>
4. Now, depending on the OS on your computer:

{% tabs %}
{% tab title="Windows" %}

1. You need to swap out the Qualcomm USB driver for a WinUSB driver, otherwise you cannot flash the board.
   1. Download and unzip QDL:
      * [Download for x86](https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Device_Loader/Windows/2.3.9.2/QDL_2.3.9.2_Win_x64.zip) (e.g. Intel/AMD processors)
      * [Download for ARM64](https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Device_Loader/Windows/ARM64/2.3.9.2/QDL_2.3.9.2_Win_ARM64.zip) (e.g. Snapdragon processors)
   2. Disconnect the power adapter to your RB3 Gen 2 Vision Kit.
   3. Connect power adapter.
   4. Hold down the 'F\_DL' button, and press the power button for 2 seconds (while you keep holding F\_DL).
   5. In the QDL folder, find `install_driver.bat`. Right-click, and select "Run as administrator".

      ![QDL: install\_driver.bat](/files/9iBqQwLsOPfwv5iTotzl)
   6. This should print something akin to:

      ```
      Total driver packages:  1
      Added driver packages:  1
      Successfully installed: qcserlib.inf
      ```
2. Open a terminal, and run:

   ```bash
   Invoke-WebRequest -Uri https://cdn.edgeimpulse.com/qc-ai-docs/device-setup/rb3-gen2-vision-kit-ubuntu-desktop-24-windows.ps1 -OutFile "rb3-gen2-vision-kit-ubuntu-desktop-24-windows.ps1"
   .\rb3-gen2-vision-kit-ubuntu-desktop-24-windows.ps1
   ```

{% endtab %}

{% tab title="macOS" %}

1. Open a terminal, and run:

   ```bash
   wget https://cdn.edgeimpulse.com/qc-ai-docs/device-setup/rb3-gen2-vision-kit-ubuntu-desktop-24-macos-linux.sh
   bash rb3-gen2-vision-kit-ubuntu-desktop-24-macos-linux.sh
   ```

{% endtab %}

{% tab title="Linux" %}

1. Update your udev rules. Open a terminal and run:

   ```bash
   echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9008", MODE="0664", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-qcom-usb.rules > /dev/null
   sudo systemctl restart udev
   ```
2. Disconnect and reconnect the USB cables to your RB3 development kit.
3. Then, from a terminal, run:

   ```bash
   wget https://cdn.edgeimpulse.com/qc-ai-docs/device-setup/rb3-gen2-vision-kit-ubuntu-desktop-24-macos-linux.sh
   bash rb3-gen2-vision-kit-ubuntu-desktop-24-macos-linux.sh
   ```

{% endtab %}
{% endtabs %}

### Configuring Ubuntu 24

Now that we have Ubuntu 24.04 installed, lets connect your RB3 Gen 2 Vision Kit to the internet.

1. Either:
   * Hook up a display, keyboard, and mouse - and make sure you can open the terminal application on the device.

     > When prompted to login, the default username is `ubuntu` and the default password is also `ubuntu`. You'll need to change these on first login.
   * Or, connect to the device using a serial port. You can either use your favorite serial terminal application (use baud rate 115200) or, on your computer:
     1. Install [Node.js](https://nodejs.org/en) (on Windows: make sure to enable 'Tools for Native Modules').
     2. Install the [Edge Impulse CLI](https://docs.edgeimpulse.com/tools/clis/edge-impulse-cli/installation) by opening a command prompt or terminal window, and running:

        ```bash
        npm install -g edge-impulse-cli
        ```

        > Issues with installing the Edge Impulse CLI? See the [install instructions](https://docs.edgeimpulse.com/tools/clis/edge-impulse-cli/installation).
     3. You can now connect to your board via:

        ```bash
        edge-impulse-serial-terminal

        # [SER] Connecting to COM11 (baud rate 115200)
        # [SER] Connected to COM11. Press CTRL+D to quit.
        ```
     4. Once you are connected to the board, and you don't see any log messages anymore; press `ENTER` and log in with username `ubuntu`, password `ubuntu`:

        ```bash
        # Ubuntu 24.04.3 LTS ubuntu ttyMSM0
        #
        # ubuntu login: ubuntu
        ```

        To disconnect, press `CTRL+D`.
2. From your terminal, set up WiFi:

   ```bash
   # Connect to WiFi
   sudo nmcli dev wifi connect "<WiFi-SSID>" password "<WiFi-password>"

   # Force ntp sync so we get the correct date/time
   sudo systemctl restart systemd-timesyncd.service

   # To verify...
   date
   # ... Should return the current date
   ```
3. *Optional:* If you want to connect over SSH:
   1. Find your IP address:

      ```bash
      sudo apt update && sudo apt install -y net-tools

      ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'

      # 192.168.1.253
      ```
   2. On your host machine (so not on your dev board), open a command prompt or terminal and run:

      ```bash
      ssh ubuntu@192.168.1.253
      ```

      (Replace 192.168.1.253 with the IP you found in the previous step)
   3. *Optional:* Follow [this guide to connect your board to Visual Studio Code via SSH](/qc-ai-test-docs/device-setup/vscode-ssh-setup.md) for code development and deployment.
4. Last, install the USB / Ethernet driver:

   ```bash
   # Download and install the driver
   sudo wget -O /lib/firmware/renesas_usb_fw.mem https://cdn.edgeimpulse.com/qc-ai-docs/drivers/renesas_usb_fw.mem
   sudo mkinitramfs -o /boot/initrd.img-$(uname -r)

   # To verify...
   lsinitramfs /boot/initrd.img-$(uname -r) | grep renesas
   # ... Should list "usr/lib/firmware/renesas_usb_fw.mem"

   # Reboot
   sudo reboot
   ```

{% hint style="warning" %}
**TODO:** The official docs force you to download `renesas_usb_fw.mem` from Renesas. But on RUBIK Pi we can ship it on-device. Figure out if we can host on CDN under the same agreement before publishing these docs.
{% endhint %}

### Installing drivers, AI Engine Direct and the IM-SDK

Now that we have Ubuntu 24.04 installed and connected to a network, let's install GPU drivers and the Qualcomm AI Engine Direct SDK (to run neural networks).

From the terminal or ssh session on your development board, run:

1. Install some base packages:

   ```bash
   sudo apt update
   sudo apt install -y unzip wget curl python3 python3-pip python3-venv software-properties-common
   ```
2. Download and install the AI Engine Direct SDK library and development headers:

   ```bash
   if [ ! -f /etc/apt/sources.list.d/ubuntu-qcom-iot-ubuntu-qcom-ppa-noble.list ]; then
       sudo apt-add-repository -y ppa:ubuntu-qcom-iot/qcom-ppa
   fi

   # Install the AI Engine Direct SDK library and development headers
   sudo apt install -y libqnn1 libsnpe1 libqnn-dev libsnpe-dev
   ```
3. Install OpenCL GPU drivers:

   ```bash
   sudo apt update
   sudo apt install -y clinfo qcom-adreno1

   # Symlink OpenCL library to /usr/lib/
   if [ ! -f /usr/lib/libOpenCL.so ]; then
       sudo ln -s /lib/aarch64-linux-gnu/libOpenCL.so.1.0.0 /usr/lib/libOpenCL.so
   fi

   # Reboot the device
   sudo reboot

   # Verify installation
   clinfo
   # ... Should return
   #     Number of platforms                               1
   #     Platform Name                                   QUALCOMM Snapdragon(TM)
   #     Platform Vendor                                 QUALCOMM
   #     Platform Version                                OpenCL 3.0 QUALCOMM build: 0808.0.7
   ```

## Tips & tricks

### Using the built-in cameras

Your development kit has two built-in cameras, but you can only read data from the cameras using a GStreamer pipeline with the `qtiqmmfsrc` plugin (part of the [IM SDK](/qc-ai-test-docs/running-building-ai-models/im-sdk.md)).

For a Python example, see [qc-ai-test-docs-examples/rb3-builtin-cameras](https://github.com/edgeimpulse/qc-ai-test-docs-examples/tree/master/rb3-builtin-cameras).

Or, to stream camera to data to a file, open a terminal on your device and run:

**Large camera**

```bash
mkdir -p out
gst-launch-1.0 qtiqmmfsrc name=camsrc camera=0 ! video/x-raw,width=1920,height=1080 ! jpegenc ! multifilesink location=out/frame%05d.jpg
```

**Small camera**

```bash
mkdir -p out
gst-launch-1.0 qtiqmmfsrc name=camsrc camera=1 ! video/x-raw,width=1280,height=720 ! jpegenc ! multifilesink location=out/frame%05d.jpg
```

This writes frames to the `out/` directory.

## Troubleshooting

### qdl: unable to open USB device

If you see `qdl: unable to open USB device` when flashing the board (on Windows) then make sure to update the driver using QDL's install\_driver.bat (see above).
