Using DeepStack with NVIDIA GPUs

DeepStack GPU Version serves requests 5 - 20 times faster than the CPU version if you have an NVIDIA GPU.

Before you install the GPU Version, you need to follow the steps below.

Step 1: Install Docker

If you already have docker installed, you can skip this step.

bash
sudo apt-get update
sudo apt-get install curl
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Step 2: Setup NVIDIA Drivers

Install the NVIDIA Driver

Nvidia Driver Install

Step 3: Install NVIDIA Container Toolkit

Run the commands below

bash
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

If you run into issues, you can refer to this GUIDE

Step 4: Install DeepStack GPU Version

bash
sudo docker pull deepquestai/deepstack:gpu-2021.06.1

If you are running an old system without modern cpu instructions such as AVX, please use the Legacy System Version

Step 5: RUN DeepStack with GPU Access

Once the above steps are complete, when you run DeepStack, add the args –gpus all

bash
sudo docker run --gpus all -e VISION-SCENE=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack:gpu-2021.06.1

Basic Parameters

–gpus all This enables gpu access to the DeepStack container

-e VISION-SCENE=True This enables the scene recognition API.

-v localstorage:/datastore This specifies the local volume where DeepStack will store all data.

-p 80:5000 This makes DeepStack accessible via port 80 of the machine.

Once installed, run the example scene recognition code to verify your installation is working.

RUN with All APIs

You can run DeepStack with all the APIs enabled. Use the command below

bash
sudo docker run --gpus all -e VISION-SCENE=True -e VISION-DETECTION=True -e VISION-FACE=True -v localstorage:/datastore -p 80:5000 deepquestai/deepstack:gpu-2021.06.1