All skills
nvidia avatar

/deepstream-dev

@6d03410
by NVIDIA Corporationnvidia/skills3.5k stars
424

NVIDIA DeepStream SDK development with Python pyservicemaker API. Use when building video analytics pipelines, GStreamer-based video processing, TensorRT inference integration, object detection/tracking, or Kafka/message broker integration.

Use this Skill: https://skilld.dev/gh/nvidia/skills/deepstream-dev

This session only. Nothing lands on disk.

referencesdocker_containers.md

≈2.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

DeepStream Docker Containers Reference

Overview

DeepStream Docker images are hosted on the NVIDIA NGC container registry (nvcr.io). They package all SDK dependencies (GStreamer, TensorRT, CUDA, models, sample streams) and require the NVIDIA Container Toolkit (nvidia-container-toolkit) for GPU access.


Available Containers

dGPU (x86_64)

Container Pull Command Description
Samples docker pull nvcr.io/nvidia/deepstream:9.1-samples-multiarch Runtime libraries, GStreamer plugins, reference apps, sample streams, models, configs. Best for running demos and deploying applications.
Triton docker pull nvcr.io/nvidia/deepstream:9.1-triton-multiarch Everything in samples + Triton Inference Server and dependencies + development environment. Use when Triton-based inference is needed or building custom DeepStream applications.

Jetson (ARM64/aarch64)

Container Pull Command Description
Samples docker pull nvcr.io/nvidia/deepstream:9.1-samples-multiarch Runtime libraries, GStreamer plugins, reference apps, sample streams, models, configs. Deployment only — does not support development inside the container.
Triton docker pull nvcr.io/nvidia/deepstream:9.1-triton-multiarch Samples contents + devel libraries + Triton Inference Server backends.

dGPU on ARM (GH200, GB200, SBSA)

Container Pull Command Description
Triton ARM SBSA docker pull nvcr.io/nvidia/deepstream:9.1-triton-sbsa-dgx-spark Triton Inference Server + development environment for ARM SBSA platforms.

Choosing the Right Image

Use Case Recommended Image
Running sample apps / demos 9.1-samples-multiarch
pyservicemaker Python applications 9.1-triton-multiarch
Triton Inference Server required 9.1-triton-multiarch
Custom Dockerfile base image 9.1-samples-multiarch (minimal) or 9.1-triton-multiarch (with Triton)

NGC Authentication

Pulling images requires NGC authentication:

# 1. Get an API key from https://ngc.nvidia.com
# 2. Log in to the NGC registry
docker login nvcr.io
# Username: $oauthtoken
# Password: <YOUR_NGC_API_KEY>

Installing pyservicemaker Inside the Container

The pyservicemaker Python wheel is bundled in the container but NOT pre-installed. You must install it explicitly:

pip install /opt/nvidia/deepstream/deepstream/service-maker/python/pyservicemaker*.whl \
    pyyaml

In a Dockerfile:

RUN pip install --break-system-packages \
    /opt/nvidia/deepstream/deepstream/service-maker/python/pyservicemaker*.whl \
    pyyaml

Note: The --break-system-packages flag is needed on Ubuntu 24.04 (Python 3.12) to install into the system Python environment. Alternatively, use a virtual environment.

Installing pyservicemaker in a Python Virtual Environment

If pyservicemaker code runs from a venv, install the bundled wheel into that venv first:

python3 -m venv venv
source venv/bin/activate
pip install /opt/nvidia/deepstream/deepstream/service-maker/python/pyservicemaker*.whl \
    pyyaml
pip install -r requirements.txt

Running Containers

Prerequisites

  1. Docker: Install docker-ce via official instructions
  2. NVIDIA Container Toolkit: Install via install guide
  3. NVIDIA Driver: 590+ for dGPU

Basic Run (with display)

export DISPLAY=:0
xhost +si:localuser:root

docker run -it --rm \
    --gpus all \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix/:/tmp/.X11-unix \
    nvcr.io/nvidia/deepstream:9.1-triton-multiarch

Headless Run (no display)

docker run -it --rm \
    --gpus all \
    nvcr.io/nvidia/deepstream:9.1-triton-multiarch

For headless mode, use fakesink instead of nveglglessink/nv3dsink in your pipeline, or output to a file with filesink.

Run with Custom Video File

docker run -it --rm \
    --gpus all \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix/:/tmp/.X11-unix \
    -v /path/to/videos:/data \
    nvcr.io/nvidia/deepstream:9.1-triton-multiarch

Building Custom Docker Images

Use a DeepStream image as the base for your application:

FROM nvcr.io/nvidia/deepstream:9.1-triton-multiarch

# Install pyservicemaker
RUN pip install --break-system-packages \
    /opt/nvidia/deepstream/deepstream/service-maker/python/pyservicemaker*.whl \
    pyyaml

# Copy application files
WORKDIR /app
COPY my_app.py .
COPY my_config.yml .

# Enable video driver libraries at runtime (encode/decode)
ENV NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES},video

ENTRYPOINT ["python3", "my_app.py"]

Build and Run

# Build
docker build -t my-ds-app .

# Run with display
docker run --rm --gpus all \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    my-ds-app

# Run with RTSP source (no display needed)
docker run --rm --gpus all \
    my-ds-app rtsp://camera-ip/stream

Additional Packages

DeepStream containers do not include certain multimedia libraries by default. Install them if needed:

Audio/Codec Support

# Run the bundled install script for common multimedia packages
/opt/nvidia/deepstream/deepstream/user_additional_install.sh

# Or install specific packages manually
apt-get install -y gstreamer1.0-libav gstreamer1.0-plugins-good \
    gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly

ffmpeg (for sample video preparation scripts)

apt-get install --reinstall libflac8 libmp3lame0 libxvidcore4 ffmpeg

Kafka Support (librdkafka)

apt-get install -y librdkafka-dev

Tracker Support (libmosquitto)

apt-get install -y libmosquitto1

Important Paths Inside the Container

Path Contents
/opt/nvidia/deepstream/deepstream/ DeepStream SDK root
/opt/nvidia/deepstream/deepstream/samples/models/ Sample models (Primary_Detector, Secondary_*, etc.)
/opt/nvidia/deepstream/deepstream/samples/streams/ Sample video streams (e.g., sample_1080p_h264.mp4)
/opt/nvidia/deepstream/deepstream/samples/configs/ Sample configuration files
/opt/nvidia/deepstream/deepstream/lib/ DeepStream libraries (GStreamer plugins, protocol adapters)
/opt/nvidia/deepstream/deepstream/lib/gst-plugins/ GStreamer plugin .so files
/opt/nvidia/deepstream/deepstream/service-maker/python/ pyservicemaker wheel file

Environment Variables

Variable Purpose Example
GST_PLUGIN_PATH GStreamer plugin search path /opt/nvidia/deepstream/deepstream/lib/gst-plugins
LD_LIBRARY_PATH Shared library search path /opt/nvidia/deepstream/deepstream/lib:$LD_LIBRARY_PATH
GST_DEBUG GStreamer debug log level 3 (INFO) or nvinfer:5 (plugin-specific)
NVIDIA_DRIVER_CAPABILITIES GPU capabilities exposed ${NVIDIA_DRIVER_CAPABILITIES},video
DISPLAY X11 display for rendering sinks :0

Common Docker Issues

ModuleNotFoundError: No module named 'pyservicemaker'

Cause: The wheel is bundled but not installed.

Fix: Add to Dockerfile:

RUN pip install --break-system-packages \
    /opt/nvidia/deepstream/deepstream/service-maker/python/pyservicemaker*.whl \
    pyyaml

Display sinks fail with Could not open display

Cause: X11 forwarding not configured.

Fix: Pass display environment and socket:

docker run --rm --gpus all \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    my-ds-app

Or use fakesink / filesink for headless operation.

Pipeline exits early during non-interactive docker exec

Cause: Running without stdin can attach /dev/null; the GLib main loop may observe EOF and stop after the first frames.

Fix: Use docker exec -i for non-interactive pipeline scripts:

docker exec -i ds python3 /app/pipeline.py http://localhost:8080/sample.mp4

If the application must run without inherited stdin, install a pipe before importing pyservicemaker:

import os
_pipe_r, _pipe_w = os.pipe()
os.dup2(_pipe_r, 0)
os.close(_pipe_r)

Failed to load plugin ... libnvds_kafka_proto.so

Cause: librdkafka not installed (not bundled in the container).

Fix: Add to Dockerfile:

RUN apt-get update && apt-get install -y librdkafka-dev && rm -rf /var/lib/apt/lists/*

Warning about audio decoder not available

Cause: Multimedia codec packages removed in DeepStream containers.

Fix:

RUN /opt/nvidia/deepstream/deepstream/user_additional_install.sh

Source: SKILL.md on GitHub

No alerts26d3 checks · Risk SAFE
  • Gen Agent Trust Hub26d

    The deepstream-dev skill is a comprehensive development resource for building video analytics pipelines with the NVIDIA DeepStream SDK. It provides extensive documentation, configuration examples, and best practices. All behaviors identified, including external model downloads and dependency installation, are standard and legitimate requirements for the SDK's functionality.

  • Socket26d

    No alerts

  • Snyk26d

    Risk: LOW · No issues

Signed by skilld at 6d03410. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
owner
NVIDIA CORPORATION
metadata
{
  "author": "NVIDIA CORPORATION <info@nvidia.com>"
}
service
deepstream
Other metadata
version
1.1.1
reviewed
2026-04-24

README badge

README badge for nvidia/skills/deepstream-dev