Skip to content

Commit 216ce3a

Browse files
committed
Update to 1.1.11 Release
This release is compatible with DeepStream SDK 7.0 Ubuntu 22.04 Python 3.10 DeepStream SDK 7.0 Features: - New module platform_info() has been added for checking for WSL, integrated GPU, and aarch64. All apps and integration tests have been updated to use this module when checking for platform. See deepstream_test1 for simple usage. - SBSA is now supported. Check bindings/README.md for quick build instructions. - Apps have been updated to use request_pad_simple() instead of the deprecated method get_request_pad(). See gst-python API documentation for details. - New API nvds_measure_buffer_latency() has been added for pipeline and component latency measurement. See deepstream-test3 app and bindfunctions.cpp for reference.
1 parent 36fdc7e commit 216ce3a

File tree

99 files changed

+620
-299
lines changed

Some content is hidden

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

99 files changed

+620
-299
lines changed

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,5 @@ The pyds wheel installs the pyds.so library where all the pip packages are store
165165

166166
Command to install the pyds wheel is:
167167
```bash
168-
$ pip3 install ./pyds-1.1.10-py3-none*.whl
168+
$ pip3 install ./pyds-1.1.11-py3-none*.whl
169169
```

HOWTO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This guide provides resources for DeepStream application development in Python.
1616
## Prerequisites
1717

1818
* Ubuntu 22.04
19-
* [DeepStream SDK 6.4](https://developer.nvidia.com/deepstream-download) or later
19+
* [DeepStream SDK 7.0](https://developer.nvidia.com/deepstream-download) or later
2020
* Python 3.10
2121
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.20.3
2222

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
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: 6.4
5+
SDK version supported: 7.0
66

7-
<b>This release only supports Ubuntu 22.04 for DeepStreamSDK 6.4 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 22.04 for DeepStreamSDK 7.0 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>
88

9-
The bindings sources along with build instructions are available under [bindings](bindings)! 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.
10-
11-
Download the latest release package complete with bindings and sample applications from the [release section](../../releases).
9+
The bindings sources along with build instructions are available under [bindings](bindings)! 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.
1210

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

1513
- [DeepStream Python Apps](#deepstream-python-apps)
14+
- [Setup](#setup)
1615
- [Python Bindings](#python-bindings)
16+
- [Python Bindings Breaking API Change](#python-bindings-breaking-api-change)
1717
- [Sample Applications](#sample-applications)
1818

19+
## Setup
20+
Once you have DeepStreamSDK pre-requisites and DeepStreamSDK installed on the system, navigate to <DS_ROOT>/sources/ dir which is /opt/nvidia/deepstream/deepstream/sources/ and git clone deepstream_python_apps repo here.
21+
22+
The latest bindings can be installed from [release section](../../releases).
23+
You can also build the bindings from source using the instructions in the [bindings readme](bindings/README.md) if needed.
24+
1925
<a name="metadata_bindings"></a>
2026
## Python Bindings
2127

@@ -45,13 +51,13 @@ To run the sample applications or write your own, please consult the [HOW-TO Gui
4551

4652
We currently provide the following sample applications:
4753
* [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline, also demonstrates support for new nvstreammux
48-
* **UPDATED** [deepstream-test2](apps/deepstream-test2) -- 4-class object detection, tracking and attribute classification pipeline - now uses new names for tracker meta data types in DS 6.4
54+
* [deepstream-test2](apps/deepstream-test2) -- 4-class object detection, tracking and attribute classification pipeline
4955
* [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
50-
* **UPDATED** [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud - now supports MQTT protocol adaptor
56+
* [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud
5157
* [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) -- multi-stream pipeline with access to image buffers
5258
* [deepstream-ssd-parser](apps/deepstream-ssd-parser) -- SSD model inference via Triton server with output parsing in Python
5359
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipeline with USB camera input
54-
* **UPDATED** [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output - now demonstrates adding software encoder option to support Jetson Orin Nano
60+
* [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
5561
* [deepstream-opticalflow](apps/deepstream-opticalflow) -- optical flow and visualization pipeline with flow vectors returned in NumPy array
5662
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
5763
* [deepstream-nvdsanalytics](apps/deepstream-nvdsanalytics) -- multistream pipeline with analytics plugin

apps/README

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DeepStream SDK Python Bindings
2020
================================================================================
2121
Setup pre-requisites:
2222
- Ubuntu 22.04
23-
- NVIDIA DeepStream SDK 6.4
23+
- NVIDIA DeepStream SDK 7.0
2424
- Python 3.10
2525
- Gst-python
2626

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

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

@@ -51,16 +51,23 @@ 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+
cuda-python
55+
-----------
56+
$ pip3 install cuda-python
57+
5458
--------------------------------------------------------------------------------
5559
Running the samples
5660
--------------------------------------------------------------------------------
57-
The apps are configured to work from inside the DeepStream SDK 6.4 installation.
61+
The apps are configured to work from inside the DeepStream SDK 7.0 installation.
5862

5963
Clone the deepstream_python_apps repo under <DeepStream ROOT>/sources:
6064
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
6165
This will create the following directory:
6266
<DeepStream ROOT>/sources/deepstream_python_apps
63-
67+
Cuda python APIs are used to distinguish between iGPU and dGPU.
68+
Install cuda-python using:
69+
pip3 install cuda-python
70+
NOTE: is_aarch64.py is deprecated in favor of platform_info.py
6471
Follow README in each app's directory to run the app.
6572

6673
Example: running test1 app:

apps/common/is_aarch_64.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/common/platform_info.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
################################################################################
2+
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
################################################################################
17+
18+
import sys
19+
import platform
20+
from threading import Lock
21+
from cuda import cudart
22+
from cuda import cuda
23+
24+
guard_platform_info = Lock()
25+
26+
class PlatformInfo:
27+
def __init__(self):
28+
self.is_wsl_system = False
29+
self.wsl_verified = False
30+
self.is_integrated_gpu_system = False
31+
self.is_integrated_gpu_verified = False
32+
self.is_aarch64_platform = False
33+
self.is_aarch64_verified = False
34+
35+
def is_wsl(self):
36+
with guard_platform_info:
37+
# Check if its already verified as WSL system or not.
38+
if not self.wsl_verified:
39+
try:
40+
# Open /proc/version file
41+
with open("/proc/version", "r") as version_file:
42+
# Read the content
43+
version_info = version_file.readline()
44+
version_info = version_info.lower()
45+
self.wsl_verified = True
46+
47+
# Check if "microsoft" is present in the version information
48+
if "microsoft" in version_info:
49+
self.is_wsl_system = True
50+
except Exception as e:
51+
print(f"ERROR: Opening /proc/version failed: {e}")
52+
53+
return self.is_wsl_system
54+
55+
def is_integrated_gpu(self):
56+
#Using cuda apis to identify whether integrated/discreet
57+
#This is required to distinguish Tegra and ARM_SBSA devices
58+
with guard_platform_info:
59+
#Cuda initialize
60+
if not self.is_integrated_gpu_verified:
61+
cuda_init_result, = cuda.cuInit(0)
62+
if cuda_init_result == cuda.CUresult.CUDA_SUCCESS:
63+
#Get cuda devices count
64+
device_count_result, num_devices = cuda.cuDeviceGetCount()
65+
if device_count_result == cuda.CUresult.CUDA_SUCCESS:
66+
#If atleast one device is found, we can use the property from
67+
#the first device
68+
if num_devices >= 1:
69+
#Get properties from first device
70+
property_result, properties = cudart.cudaGetDeviceProperties(0)
71+
if property_result == cuda.CUresult.CUDA_SUCCESS:
72+
print("Is it Integrated GPU? :", properties.integrated)
73+
self.is_integrated_gpu_system = properties.integrated
74+
self.is_integrated_gpu_verified = True
75+
else:
76+
print("ERROR: Getting cuda device property failed: {}".format(property_result))
77+
else:
78+
print("ERROR: No cuda devices found to check whether iGPU/dGPU")
79+
else:
80+
print("ERROR: Getting cuda device count failed: {}".format(device_count_result))
81+
else:
82+
print("ERROR: Cuda init failed: {}".format(cuda_init_result))
83+
84+
return self.is_integrated_gpu_system
85+
86+
def is_platform_aarch64(self):
87+
#Check if platform is aarch64 using uname
88+
if not self.is_aarch64_verified:
89+
if platform.uname()[4] == 'aarch64':
90+
self.is_aarch64_platform = True
91+
self.is_aarch64_verified = True
92+
return self.is_aarch64_platform
93+
94+
sys.path.append('/opt/nvidia/deepstream/deepstream/lib')

apps/deepstream-custom-binding-test/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
################################################################################
1717

1818
Prequisites:
19-
- DeepStreamSDK 6.4
19+
- DeepStreamSDK 7.0
2020
- Python 3.10
2121
- Gst-python
2222

apps/deepstream-custom-binding-test/deepstream_custom_binding_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def main(args):
191191
source.link(h264parser)
192192
h264parser.link(decoder)
193193

194-
sinkpad = streammux.get_request_pad("sink_0")
194+
sinkpad = streammux.request_pad_simple("sink_0")
195195
if not sinkpad:
196196
Gst.error(" Unable to get the sink pad of streammux")
197197

apps/deepstream-demux-multi-in-multi-out/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
################################################################################
1717

1818
Prerequisites:
19-
- DeepStreamSDK 6.4
19+
- DeepStreamSDK 7.0
2020
- Python 3.10
2121
- Gst-python
2222

apps/deepstream-demux-multi-in-multi-out/deepstream_demux_multi_in_multi_out.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import os
3333
import math
3434
import platform
35-
from common.is_aarch_64 import is_aarch64
35+
from common.platform_info import PlatformInfo
3636
from common.bus_call import bus_call
3737
from common.FPS import PERF_DATA
3838

@@ -265,6 +265,7 @@ def main(args, requested_pgie=None, config=None, disable_probe=False):
265265
global perf_data
266266
perf_data = PERF_DATA(number_sources)
267267

268+
platform_info = PlatformInfo()
268269
# Standard GStreamer initialization
269270
Gst.init(None)
270271

@@ -294,7 +295,7 @@ def main(args, requested_pgie=None, config=None, disable_probe=False):
294295
sys.stderr.write("Unable to create source bin \n")
295296
pipeline.add(source_bin)
296297
padname = "sink_%u" % i
297-
sinkpad = streammux.get_request_pad(padname)
298+
sinkpad = streammux.request_pad_simple(padname)
298299
if not sinkpad:
299300
sys.stderr.write("Unable to create sink pad bin \n")
300301
srcpad = source_bin.get_static_pad("src")
@@ -347,14 +348,18 @@ def main(args, requested_pgie=None, config=None, disable_probe=False):
347348
for i in range(number_sources):
348349
# pipeline nvstreamdemux -> queue -> nvvidconv -> nvosd -> (if Jetson) nvegltransform -> nveglgl
349350
# Creating EGLsink
350-
if is_aarch64():
351+
if platform_info.is_integrated_gpu():
351352
print("Creating nv3dsink \n")
352353
sink = make_element("nv3dsink", i)
353354
if not sink:
354355
sys.stderr.write(" Unable to create nv3dsink \n")
355356
else:
356-
print("Creating EGLSink \n")
357-
sink = make_element("nveglglessink", i)
357+
if platform_info.is_platform_aarch64():
358+
print("Creating nv3dsink \n")
359+
sink = make_element("nv3dsink", i)
360+
else:
361+
print("Creating EGLSink \n")
362+
sink = make_element("nveglglessink", i)
358363
if not sink:
359364
sys.stderr.write(" Unable to create egl sink \n")
360365
pipeline.add(sink)
@@ -375,7 +380,7 @@ def main(args, requested_pgie=None, config=None, disable_probe=False):
375380

376381
# connect nvstreamdemux -> queue
377382
padname = "src_%u" % i
378-
demuxsrcpad = nvstreamdemux.get_request_pad(padname)
383+
demuxsrcpad = nvstreamdemux.request_pad_simple(padname)
379384
if not demuxsrcpad:
380385
sys.stderr.write("Unable to create demux src pad \n")
381386

0 commit comments

Comments
 (0)