Hardware Acceleration

This page will hopefully make it easier to understand how to accelerate Shinobi with an NVIDIA GPU.

How to Install CUDA drivers

  1. Add the NVIDIA driver repo to your sources list. If you are on Ubuntu server don't be alarmed when the desktop environment appears. This is a side effect of installing NVIDIA drivers apparently.

    sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
    sudo echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" | sudo tee -a /etc/apt/sources.list
    sudo apt update
    sudo apt -y install cuda-drivers
  2. Reboot.

    sudo reboot
  3. Install CUDA Toolkit 9.1

    sudo apt-get -y install cuda-toolkit-9-1
  4. Check the driver status with NVIDIA's utility.

  5. nvidia-smi should show you something like this.

    | NVIDIA-SMI 390.25 Driver Version: 390.25 |
    | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
    | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
    | 0 GeForce GTX 1050 Off | 00000000:01:00.0 Off | N/A |
    | 30% 30C P0 N/A / 75W | 0MiB / 1999MiB | 0% Default |

    | Processes: GPU Memory |
    | GPU PID Type Process name Usage |
    | No running processes found |
  6. Driver not starting? You may need to reboot. If not then you may need to install version 340 instead.

    apt remove nvidia* -y
    apt install nvidia-340 -y

How to Decode an RTSP Stream with NVIDIA Graphics Cards

This was tested on Geforce 9800 GT (Driver Version 340), Geforce GT 710 (Driver Version 390), Geforce GT 1030, and Geforce GTX 1050.

  1. Open the Monitor Settings or click the plus icon to create a new one.

  2. Find the Input section and set Accelerator to Yes.

  3. Set Acceleration Engine to cuvid

  4. Set Video Decoder to H.264 CUVID

  5. Disable JPEG API. Currently the NVIDIA decoder doesn't output JPEG data from an H.264 source. You must disable it or the camera process will crash.

  6. Save and enjoy!

Object Detection with OpenCV and OpenALPR

You can read about Object Detection setup here.