# M.2 Setup

### Linux Kernel Driver Installation

Hosts that have DeGirum Orca PCI Express card installed need a driver to enable its functionality. The driver is distributed as a source package via a DeGirum APT software repository. It can be built automatically after download. To download, build, and install the driver please perform the following steps:

{% stepper %}
{% step %}
Install prerequisites:

{% code overflow="wrap" %}

```bash
sudo apt install curl dkms mokutil
```

{% endcode %}
{% endstep %}

{% step %}
Download DeGirum public key:

* Ubuntu 20.04:

{% code overflow="wrap" %}

```bash
wget -O - -q http://assets.degirum.com/apt-repo/DeGirum.gpg.key | sudo apt-key add -
```

{% endcode %}

* Ubuntu 22.04 and Ubuntu 24.04:

{% code overflow="wrap" %}

```bash
curl -fsSL http://assets.degirum.com/apt-repo/DeGirum.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/degirum.gpg
```

{% endcode %}
{% endstep %}

{% step %}
Add DeGirum software repository to APT sources configuration file:

* Ubuntu 20.04:

{% code overflow="wrap" %}

```bash
echo deb [arch=amd64,arm64] https://assets.degirum.com/apt-repo ORCA main | sudo tee -a /etc/apt/sources.list
```

{% endcode %}

* Ubuntu 22.04:

{% code overflow="wrap" %}

```bash
echo deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/degirum.gpg] https://assets.degirum.com/apt-repo ORCA main | sudo tee -a /etc/apt/sources.list
```

{% endcode %}

* Ubuntu 24.04:

{% code overflow="wrap" %}

```bash
echo 'Types: deb
URIs: https://assets.degirum.com/apt-repo
Suites: ORCA
Components: main
Architectures: amd64 arm64
Signed-By: /usr/share/keyrings/degirum.gpg' | sudo tee /etc/apt/sources.list.d/degirum.sources
```

{% endcode %}
{% endstep %}

{% step %}
Update package information from configured sources:

{% code overflow="wrap" %}

```bash
sudo apt update
```

{% endcode %}
{% endstep %}

{% step %}
Download and build DeGirum Linux driver package:

{% code overflow="wrap" %}

```bash
sudo -E apt install cdapci-dkms
```

{% endcode %}
{% endstep %}

{% step %}
Either perform reboot or execute the following command to load the driver:

{% code overflow="wrap" %}

```bash
sudo modprobe cdapci
```

{% endcode %}
{% endstep %}

{% step %}
If secure boot is enabled, the installer prompts you to add the certificate used to sign the driver to MOK.\
Follow the on-screen instructions and continue with the target boot.
{% endstep %}
{% endstepper %}

### Linux Kernel Driver Troubleshooting

{% stepper %}
{% step %}
Verify that Orca PCIe device is recognized by the system. Run the following command:

{% code overflow="wrap" %}

```bash
sudo lspci | grep accelerators
```

{% endcode %}
{% endstep %}

{% step %}
If the PCIe device is not recognized, ensure it is securely connected and that the green LED is flashing. If the light is off, contact DeGirum support for assistance.
{% endstep %}

{% step %}
Verify that Orca Kernel Driver is installed. Run the following command:

{% code overflow="wrap" %}

```bash
sudo lsmod | grep cda
```

{% endcode %}
{% endstep %}

{% step %}
If the driver is not installed, reinstall it as described in the [Linux Kernel Driver Installation](#linux-kernel-driver-installation) section.
{% endstep %}

{% step %}
Verify permissions. Ensure a `dg_orca` group exists and the current user belongs to it:

{% code overflow="wrap" %}

```bash
cat /etc/group | grep dg_orca && groups | grep dg_orca
```

{% endcode %}

If the group exists but the user is not a member, add the user via:

{% code overflow="wrap" %}

```bash
sudo -E usermod -a -G dg_orca <username>
```

{% endcode %}
{% endstep %}

{% step %}
If you installed DeGirum AI Server then verify AI Server operation:

{% code overflow="wrap" %}

```bash
degirum sys-info --host <hostname or IP>
```

{% endcode %}

Check for the `ORCA` section in the output. If it is missing, reinstall the server following the [AI Server Configuration guide](https://docs.degirum.com/pysdk/user-guide-pysdk/setting-up-an-ai-server).
{% endstep %}

{% step %}
Run the following command to combine the above checks:

{% code overflow="wrap" %}

```bash
sudo lspci | grep accelerators && sudo lsmod | grep cda && cat /etc/group | grep dg_orca && groups | grep dg_orca
```

{% endcode %}
{% endstep %}
{% endstepper %}

### Windows Kernel Driver Installation

Hosts that have DeGirum Orca PCI Express card installed need a driver to enable its functionality. The driver is distributed as a Zip archive.

{% stepper %}
{% step %}
Download the driver: [Orca Windows Driver](https://assets.degirum.com/orca-driver.zip)
{% endstep %}

{% step %}
Unpack the ORCA driver .zip file. This can be done with Windows explorer.
{% endstep %}

{% step %}
Start Device Manager. Open the Power User menu by right-clicking on the Start button (or by pressing Win+X), then click "Device Manager".
{% endstep %}

{% step %}
Find "PCI Device" under "Other devices".
{% endstep %}

{% step %}
Right-click on "PCI Device", then select "Update driver".
{% endstep %}

{% step %}
Choose "Browse my computer for drivers".
{% endstep %}

{% step %}
Click "Browse…", then navigate to the folder that contains the driver files unpacked in Step 1. Check "Include subfolders". Then, click "Next".
{% endstep %}
{% endstepper %}

### Kernel Driver Installation for Other Operating Systems

Kernel driver support for other operating systems is under development. This document will be updated when kernel drivers for other operating systems will be released.
