Development Workflow¶
This workflow is for custom extension developers. It allows developers to implement new functionality and add business logic to applications through graph.
There are two options to for developing extensions and application graphs:
Native workstation
DeepStream SDK devel container image
When developing on native workstation, install pre-requisites for extension generation and build:
/opt/nvidia/graph-composer/extension-dev/install_dependencies.sh
Using the DeepStreamSDK development container image. The image has all the dependencies already installed:
docker pull nvcr.io/nvidia/deepstream:6.2-devel
xhost +
docker run -it --entrypoint /bin/bash --gpus all --rm --network=host -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix/:/tmp/.X11-unix --privileged -v /var/run/docker.sock:/var/run/docker.sock nvcr.io/nvidia/deepstream:6.2-devel
In both the cases, either commandline or Composer UI can used. To launch composer, run:
composer
Note
When using the Composer from the devel container image, users could have a problem browsing the “/” folder from the file browser, in this case they can just type the file path directly or copy and paste it.
Sync Extensions¶
Before any extension can be built or graph created, extensions from NGC public repo must be sync’ed. Follow the steps below to sync the extensions:
Using commandline¶
Sync published extensions from NVIDIA Cloud repository using following command:
registry repo sync -n ngc-public
Check the extensions using following commands:
registry extn list
registry comp list
Refer to the Registry Command Line Interface for more commands.
Using Composer UI¶
Open the Registry
menu from the menubar at the top and click on Sync Repo
Select ngc-public
from the drop-down list and click on Sync
Composer will report the current status using a progress bar
Once the extension sync is complete, composer will display a success message.
On clicking close, composer will automatically refresh component list and the refreshed list can be seen in the component list window on the right
Develop New Extension¶
Using commandline¶
Generate an extension for GXF Codelet¶
Generate sample extension using
python3 /opt/nvidia/graph-composer/extension-dev/generate_codelet.py \
--output_dir OUTPUT_DIR \
--extn_name EXTN_NAME \
--codelet_name codelet_name
This script will generate sample codelet and application graph at <OUTPUT_DIR>/app/app.yaml
. This codelet can be updated to implement custom function.
Bazel rule for extension build includes extension register call which adds the extension to the local workspace and can be used from Composer to create graph or by container builder to deploy the graph.
Host (x86_64):
bazel build ...
Jetson (aarch64):
bazel build ... --config=jetson
Generate an extension for GXF wrapper of GstElement¶
This requires the DeepStream 6.2 SDK and Reference Graphs package to be installed or use DeepStream 6.2 devel container image.
Create a text file containing the list of GStreamer elements for which the extensions are to be generated, with name of one element per line. The listed elements must be installed on the system. Following is an example:
timeoverlay filesrc filesink
To list all the GStreamer elements installed on the system, run
gst-inspect-1.0
Next, to generate the extension source code, run
python3 /opt/nvidia/deepstream/deepstream/tools/graph_extension_generator/generate_extensions.py <element_list.txt> <output-directory>
Navigate to the output directory
cd <output-directory>
Run the following command to build and register the extension for x86_64
bazel build ...
Run the following command to build and register the extension for Jetson
bazel build ... --config=jetson
Note
If the extension build fails because of git clone errors from freedesktop gitlab repository with errors like
fatal: unable to access 'https://gitlab.freedesktop.org/gstreamer/common.git/': server certificate verification failed. CAfile: none CRLfile: none
,
temporarily disable git SSL verification by running export GIT_SSL_NO_VERIFY=true
before running bazel build
command
Using Composer UI¶
Composer UI currently supports generating DeepStream (GStreamer) based extensions only.
Note
If the Deepstream SDK package is not installed, Generate Extension button will be disabled.
To start, open the Tools
menu from the menubar at the top and select Generate Extension
.
This will launch the Extension Generator
dialog. The extension generator needs some dependencies to be installed.
This can be done by clicking on the Install Dependencies
button. This only needs to be done once on a machine. This
is not required when running from the DeepStreamSDK development docker since the dependencies pre-installed.
Next, type in the comma-separated list of GStreamer elements for which corresponding extensions must be generated. Select the output directory using the file browser.
Click on Generate
first to generate the extension source code at the selected directory and then
Build
to build and register the extensions. The progress will be reported via logs in the console
window.
Note
If the extension build fails because of git clone errors from freedesktop gitlab repository with errors like
fatal: unable to access 'https://gitlab.freedesktop.org/gstreamer/common.git/': server certificate verification failed. CAfile: none CRLfile: none
,
temporarily disable git SSL verification by:
Closing the composer and then
export GIT_SSL_NO_VERIFY=true
before starting the composer from the same shell sessionOR
git config --global http.sslVerify false
to disable git SSL verification machine-wide and retryingBuild
. This does not require the composer to be restarted. To re-enable, rungit config --global http.sslVerify true
.
After extension build is done, newly added extensions will appear in the component list
Create and test graph¶
Drag and drop newly created components from the component list to the graph window and link to other components to create a complete application.
Save and execute the graph as demonstrated in Application Workflow