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.

sudo apt-get update
sudo apt-get install curl
curl -fsSL -o && sh

Step 2: Setup NVIDIA Drivers

Install the NVIDIA Driver

GUIDE: Nvidia Driver Install

Step 3: Install NVIDIA Docker

The native docker engine does not support GPU access from containers, however nvidia-docker2modifies your docker install to support GPU access.

Run the commands below to modify the docker engine

curl -s -L | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

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

Step 4: Install DeepStack GPU Version

Legacy System Version
sudo docker pull deepquestai/deepstack:gpu

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 –rm –runtime=nvidia

sudo docker run --rm --runtime=nvidia -e VISION-SCENE=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack:gpu

Basic Parameters

--rm --runtime=nvidia This enables gpu access to the DeepStack container

-e VISION-SCENE=True This enables the scene recognition API, all apis are disabled by default.

-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.

Step 6: Activate DeepStack

The first time you run DeepStack, you need to activate it following the process below.

Once you initiate the run command above, visit localhost:80 in your browser. The interface below will appear.

Get an activation key from , paste it in the box and click Activate Now. Once activated, the interface below will appear.

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