Skip to content

Commit 6fdeefb

Browse files
committed
Update to 1.2.2 Release
This release is compatible with DeepStream SDK 8.0 - Ubuntu 24.04 - Python 3.12 - DeepStream SDK 8.0 Attached are the pipwheels for the Python bindings for x86 and Jetson. Features: - Updated build system using PyPA to support pip 24.2+ - Support and instructions for virtual environment - Multiple bug fixes Notes: - deepstream-ssd-parser app has been removed - Numpy 2.x is not currently supported
1 parent cb7fd9c commit 6fdeefb

File tree

69 files changed

+856
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+856
-469
lines changed

FAQ.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
- [Pipeline unable to perform at real time](#pipeline-unable-to-perform-at-real-time)
1414
- [Triton container problems with multi-GPU setup](#triton-container-problems-with-multi-gpu-setup)
1515
- [ModuleNotFoundError: No module named 'pyds'](#modulenotfounderror-no-module-named-pyds)
16+
- [error: externally-managed-environment](#error-externally-managed-environment)
17+
- [Running deepstream-segmentation app on x86 with mjpeg streams](#running-deepstream-segmentation-app-on-x86-with-mjpeg-streams)
1618

1719
<a name="faq11"></a>
1820
### App causes Jetson Orin Nano to freeze and reboot
@@ -166,4 +168,45 @@ The pyds wheel installs the pyds.so library where all the pip packages are store
166168
Command to install the pyds wheel is:
167169
```bash
168170
$ pip3 install ./pyds-1.2.0*.whl
171+
```
172+
173+
<a name="faq9"></a>
174+
### error: externally-managed-environment
175+
Python 3.12 requires a virtual environment to install and import pip packages. To create a virtual environment for pyds:
176+
```
177+
sudo apt install python3-venv
178+
179+
# Create a venv for pyds
180+
python3 -m venv pyds
181+
# Activate the environment
182+
source ./pyds/bin/activate
183+
```
184+
185+
<a name="faq12"></a>
186+
### Running deepstream-segmentation app on x86 with mjpeg streams
187+
There is a current limitation in deepstream-segmentation app. When mjpeg streams are used on x86, the app hangs. However, there is a workaround. Please apply below patch to the app and it should work with mjpeg as well as jpeg streams on x86:
188+
```
189+
diff --git a/apps/deepstream-segmentation/deepstream_segmentation.py b/apps/deepstream-segmentation/deepstream_segmentation.py
190+
index ec38b1c..13c28f9 100755
191+
--- a/apps/deepstream-segmentation/deepstream_segmentation.py
192+
+++ b/apps/deepstream-segmentation/deepstream_segmentation.py
193+
@@ -168,7 +168,7 @@ def main(args):
194+
195+
# Use nvdec for hardware accelerated decode on GPU
196+
print("Creating Decoder \n")
197+
- decoder = Gst.ElementFactory.make("nvjpegdec", "nvjpeg-decoder")
198+
+ decoder = Gst.ElementFactory.make("nvv4l2decoder", "nvjpeg-decoder")
199+
if not decoder:
200+
sys.stderr.write(" Unable to create NvJPEG Decoder \n")
201+
202+
@@ -214,6 +214,9 @@ def main(args):
203+
204+
print("Playing file %s " % args[2])
205+
source.set_property('location', args[2])
206+
+ if platform_info.is_integrated_gpu() and ("mjpeg" in args[2] or "mjpg" in args[2]):
207+
+ print ("setting decoder mjpeg property")
208+
+ decoder.set_property('mjpeg', 1)
209+
210+
streammux.set_property('width', 1920)
211+
streammux.set_property('height', 1080)
169212
```

HOWTO.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ This guide provides resources for DeepStream application development in Python.
99
* [Pipeline Construction](#pipeline_construction)
1010
* [MetaData Access](#metadata_access)
1111
* [Image Data Access](#imagedata_access)
12-
* [Custom Inference Output Parsing](apps/deepstream-ssd-parser/custom_parser_guide.md)
1312
* [FAQ and Troubleshooting](FAQ.md)
1413

1514
<a name="prereqs"></a>
1615
## Prerequisites
1716

18-
* Ubuntu 22.04
19-
* [DeepStream SDK 7.1](https://developer.nvidia.com/deepstream-download) or later
20-
* Python 3.10
21-
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.20.3
17+
* Ubuntu 24.04
18+
* [DeepStream SDK 8.0](https://developer.nvidia.com/deepstream-download) or later
19+
* Python 3.12
20+
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.24.1
2221

2322
Gst python should be already installed on Jetson.
2423
If missing, install with the following steps:

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,32 @@
22

33
This repository contains Python bindings and sample applications for the [DeepStream SDK](https://developer.nvidia.com/deepstream-sdk).
44

5-
SDK version supported: 7.1
5+
SDK version supported: 8.0
66

7-
<b>This release only supports Ubuntu 22.04 for DeepStreamSDK 7.1 with Python 3.10 and [gst-python](3rdparty/gst-python/) 1.20.3! Ubuntu 20.04 for DeepStreamSDK 6.3 with Python 3.8 support is NOW DEPRECATED</b>
7+
<b>This release only supports Ubuntu 24.04 for DeepStreamSDK 8.0 with Python 3.12 and [gst-python](3rdparty/gst-python/) 1.24.1!</b>
88

9-
The bindings sources along with build instructions are available under [bindings](bindings)! PyDS 1.2.0 for DeepStream 7.1 uses an updated build system for PyPA to support pip 24.2, which deprecated setup.py command line. We include one [guide](bindings/BINDINGSGUIDE.md) for contributing to bindings and another [guide](bindings/CUSTOMUSERMETAGUIDE.md) for advanced use-cases such as writing bindings for custom data structures.
9+
The bindings sources along with build instructions are available under [bindings](bindings)! PyDS 1.2.0+ for DeepStream 7.1+ uses an updated build system for PyPA to support pip 24.2+, which deprecated setup.py command line. We include one [guide](bindings/BINDINGSGUIDE.md) for contributing to bindings and another [guide](bindings/CUSTOMUSERMETAGUIDE.md) for advanced use-cases such as writing bindings for custom data structures.
1010

1111
Please report any issues or bugs on the [DeepStream SDK Forums](https://devtalk.nvidia.com/default/board/209). This enables the DeepStream community to find help at a central location.
1212

13+
<b>NOTE:<b> Python 3.12 requires a virtual environment to install and import pip packages:
14+
```
15+
sudo apt install python3-venv
16+
17+
# Create a venv for pyds
18+
python3 -m venv pyds
19+
# Activate the environment
20+
source ./pyds/bin/activate
21+
```
22+
1323
<b>NOTE:<b> numpy 2.x is not supported. If you have numpy 2.x installed, please downgrade by running
1424
```
1525
pip3 install --force-reinstall numpy==1.26.0
1626
```
1727

18-
<b>NOTE:<b> deepstream-segmask and deepstream-segmentation applications are not currently supported by DeepStream 7.1, due to removal of segmentation models.
28+
<b>NOTE:<b> deepstream-segmask and deepstream-segmentation applications are not currently supported by DeepStream 8.0, due to removal of segmentation and ssd models.
29+
30+
<b>NOTE:<b> deepstream-ssd-parser app is not supported since ssd models have been deprecated. The ssd-parser app is removed.
1931

2032
<b>NOTE for DeepStream dockers:<b> If you installed PyDS by running the user_deepstream_python_apps_install.sh script, be sure you also run the <b>user_additional_install.sh script<b>.
2133

@@ -64,19 +76,18 @@ We currently provide the following sample applications:
6476
* [deepstream-test3](apps/deepstream-test3) -- multi-stream pipeline performing 4-class object detection, also supports triton inference server, no-display mode, file-loop and silent mode
6577
* [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud
6678
* [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) -- multi-stream pipeline with access to image buffers
67-
* [deepstream-ssd-parser](apps/deepstream-ssd-parser) -- SSD model inference via Triton server with output parsing in Python
6879
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipeline with USB camera input
6980
* [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output, demonstrates adding software encoder option to support Jetson Orin Nano
7081
* [deepstream-opticalflow](apps/deepstream-opticalflow) -- optical flow and visualization pipeline with flow vectors returned in NumPy array
71-
* [deepstream-segmentation](apps/deepstream-segmentation) -- **NOT CURRENTLY SUPPORTED IN DS 7.1** segmentation and visualization pipeline with segmentation mask returned in NumPy array
82+
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
7283
* [deepstream-nvdsanalytics](apps/deepstream-nvdsanalytics) -- multistream pipeline with analytics plugin
7384
* [runtime_source_add_delete](apps/runtime_source_add_delete) -- add/delete source streams at runtime
74-
* [deepstream-imagedata-multistream-redaction](apps/deepstream-imagedata-multistream-redaction) -- multi-stream pipeline with face detection and redaction
85+
* [deepstream-imagedata-multistream-redaction](apps/deepstream-imagedata-multistream-redaction) -- multi-stream pipeline with face detection and redaction **NOTE** now uses local sink instead of rtsp output
7586
* [deepstream-rtsp-in-rtsp-out](apps/deepstream-rtsp-in-rtsp-out) -- multi-stream pipeline with RTSP input/output - has command line option "--rtsp-ts" for configuring the RTSP source to attach the timestamp rather than the streammux
7687
* [deepstream-preprocess-test](apps/deepstream-preprocess-test) -- multi-stream pipeline using nvdspreprocess plugin with custom ROIs
7788
* [deepstream-demux-multi-in-multi-out](apps/deepstream-demux-multi-in-multi-out) -- multi-stream pipeline using nvstreamdemux plugin to generated separate buffer outputs
7889
* [deepstream-imagedata-multistream-cupy](apps/deepstream-imagedata-multistream-cupy) -- access imagedata buffer from GPU in a multistream source as CuPy array - x86 only
79-
* [deepstream-segmask](apps/deepstream-segmask) -- **NOT CURRENTLY SUPPORTED IN DS 7.1** access and interpret segmentation mask information from NvOSD_MaskParams
90+
* [deepstream-segmask](apps/deepstream-segmask) -- access and interpret segmentation mask information from NvOSD_MaskParams
8091
* [deepstream-custom-binding-test](apps/deepstream-custom-binding-test) -- demonstrate usage of NvDsUserMeta for attaching custom data structure - see also the [Custom User Meta Guide](bindings/CUSTOMUSERMETAGUIDE.md)
8192

8293

apps/README

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,9 +19,9 @@
1919
DeepStream SDK Python Bindings
2020
================================================================================
2121
Setup pre-requisites:
22-
- Ubuntu 22.04
23-
- NVIDIA DeepStream SDK 7.1
24-
- Python 3.10
22+
- Ubuntu 24.04
23+
- NVIDIA DeepStream SDK 8.0
24+
- Python 3.12
2525
- Gst-python
2626

2727
--------------------------------------------------------------------------------
@@ -36,29 +36,36 @@ Package Contents
3636
Installing Pre-requisites:
3737
--------------------------------------------------------------------------------
3838

39-
DeepStream SDK 7.1
39+
DeepStream SDK 8.0
4040
--------------------
4141
Download and install from https://developer.nvidia.com/deepstream-download
4242

43-
Python 3.10
44-
----------
45-
Should be already installed with Ubuntu 22.04
43+
Python 3.12
44+
-----------
45+
Should be already installed with Ubuntu 24.04
4646

47-
Gst-python
47+
gst-python
4848
----------
4949
Should be already installed on Jetson
5050
If missing, install with the following steps:
5151
$ sudo apt update
5252
$ sudo apt install python3-gi python3-dev python3-gst-1.0 -y
5353

54-
**NEW** cuda-python
54+
**NEW** If in virtual environment, additionally run:
55+
$ pip3 install PyGObject
56+
57+
cuda-python
5558
-----------
59+
**WARNING** cuda-python 13.0.0 is now installed by default. For x86, cuda-python 12.8.0 must
60+
be installed to match Cuda version 12.8:
61+
$ pip3 install cuda-python==12.8.0
62+
For Jetson, Cuda version is 13.0:
5663
$ pip3 install cuda-python
5764

5865
--------------------------------------------------------------------------------
5966
Running the samples
6067
--------------------------------------------------------------------------------
61-
The apps are configured to work from inside the DeepStream SDK 7.1 installation.
68+
The apps are configured to work from inside the DeepStream SDK 8.0 installation.
6269

6370
Clone the deepstream_python_apps repo under <DeepStream ROOT>/sources:
6471
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
@@ -80,20 +87,23 @@ Running the samples inside DeepStream SDK docker
8087
The general steps are:
8188
1. Pull the DeepStream SDK docker of choice following the latest DeepStream
8289
Release Notes at https://developer.nvidia.com/deepstream-sdk for more info.
83-
Note that the deepstream-ssd-parser app requires the Triton docker on x86_64.
8490
2. Run the docker with Python Bindings mapped using the following option:
8591
-v <path to this python bindings directory>:/opt/nvidia/deepstream/deepstream/sources/python
8692
3. Inside the container, install packages required by all samples:
8793
$ sudo apt update
8894
$ sudo apt install python3-gi python3-dev python3-gst-1.0 -y
89-
4. Optionally install additional dependencies required by specific samples.
95+
4. If running script user_deepstream_python_apps_install.sh available in the triton docker, please note that it
96+
will setup a virtual environment for you at <DS_ROOT>/deepstream_python_apps/pyds location.
97+
While the script will activate this virtual environment for you, you might have to activate it explicitly before installing
98+
PIP packages and running apps.
99+
5. Optionally install additional dependencies required by specific samples.
90100
See README in app's directory for such requirements.
91-
$ sudo apt install python3-opencv
92-
$ sudo apt install python3-numpy
101+
$ pip3 install opencv-python
102+
$ pip3 install --force-reinstall numpy==1.26.0
93103
$ sudo apt install libgstrtspserver-1.0-0 gstreamer1.0-rtsp
94104
$ sudo apt install libgirepository1.0-dev
95105
$ sudo apt install gobject-introspection gir1.2-gst-rtsp-server-1.0
96-
5. Run sample apps following directions in each app's README.
106+
6. Run sample apps following directions in each app's README.
97107

98108
--------------------------------------------------------------------------------
99109
Notes:

apps/common/platform_info.py

100644100755
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import sys
1919
import platform
2020
from threading import Lock
21-
from cuda import cudart
22-
from cuda import cuda
21+
from cuda.bindings import runtime
22+
from cuda.bindings import driver
2323

2424
guard_platform_info = Lock()
2525

@@ -58,17 +58,17 @@ def is_integrated_gpu(self):
5858
with guard_platform_info:
5959
#Cuda initialize
6060
if not self.is_integrated_gpu_verified:
61-
cuda_init_result, = cuda.cuInit(0)
62-
if cuda_init_result == cuda.CUresult.CUDA_SUCCESS:
61+
cuda_init_result, = driver.cuInit(0)
62+
if cuda_init_result == driver.CUresult.CUDA_SUCCESS:
6363
#Get cuda devices count
64-
device_count_result, num_devices = cuda.cuDeviceGetCount()
65-
if device_count_result == cuda.CUresult.CUDA_SUCCESS:
64+
device_count_result, num_devices = driver.cuDeviceGetCount()
65+
if device_count_result == driver.CUresult.CUDA_SUCCESS:
6666
#If atleast one device is found, we can use the property from
6767
#the first device
6868
if num_devices >= 1:
6969
#Get properties from first device
70-
property_result, properties = cudart.cudaGetDeviceProperties(0)
71-
if property_result == cuda.CUresult.CUDA_SUCCESS:
70+
property_result, properties = runtime.cudaGetDeviceProperties(0)
71+
if property_result == runtime.cudaError_t.cudaSuccess:
7272
print("Is it Integrated GPU? :", properties.integrated)
7373
self.is_integrated_gpu_system = properties.integrated
7474
self.is_integrated_gpu_verified = True

apps/deepstream-custom-binding-test/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
################################################################################
1717

1818
Prequisites:
19-
- DeepStreamSDK 7.1
20-
- Python 3.10
19+
- DeepStreamSDK 8.0
20+
- Python 3.12
2121
- Gst-python
2222

2323
To run the test app:

0 commit comments

Comments
 (0)