Development Workflow

This workflow is for custom extension developers. It allows developers to implement new functionality and add business logic to applications through graph.

Graph composer Development Workflow

Development workflow has the following steps:

  1. Sync extensions from NVIDIA Cloud repository

  2. Develop new extension

  3. Build and add extension to registry

  4. Create and test graph

There are two options to for developing extensions and application graphs:

  1. Native workstation

  2. 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.0-devel
xhost +
docker run -it --entrypoint /bin/bash --gpus all --rm --network=host -e DISPLAY=:0 -v /tmp/.X11-unix/:/tmp/.X11-unix --privileged -v /var/run/docker.sock:/var/run/docker.sock nvcr.io/nvidia/deepstream:6.0-devel

In both the cases, either command-line or Composer UI can used. To launch composer, run:

composer
Graph Composer Default Window

Sync Extensions

Before you build any extension or create graph, you must sync extensions from NGC public repo. Follow the steps below to sync the extensions:

Using command-line

  1. Sync published extensions from NVIDIA Cloud repository using following command:

    registry repo sync -n ngc-public
    
  2. 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

  1. Open the Registry menu from the menubar at the top and click on Sync Repo

Graph Composer Registry Menu
  1. Select ngc-public from the drop-down list and click on Sync

Graph Composer Select Repo
  1. Composer will report the current status using a progress bar

Graph Composer Sync Progress
  1. Once the extension sync is complete, composer will display a success message.

Graph Composer Sync Success
  1. On clicking close, composer will automatically refresh component list. The refreshed list can be seen in the component list window on the right.

Graph Composer Default View

Develop New Extension

Using command-line

Generating a non-DeepStream (GStreamer) extension

Generate sample extension using

python3 /opt/nvidia/graph-composer/extension-dev/generate_extension.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 registry 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

Generating a DeepStream (GStreamer) extension

This requires the DeepStream Reference Graphs package to be installed

  • 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-6.0/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.

  1. To start, open the Tools menu from the menubar at the top and select Generate Extension.

Graph Composer Tools Menu

2. This will launch the Extension Generator dialog. The extension generator needs some dependencies to be installed. You can install them 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 are pre-installed.

Graph Composer Extension Generator Dialog - Install Dependencies

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

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

Graph Composer Extension Generator Dialog

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 session

    OR

  • git config --global http.sslVerify false to disable git SSL verification machine-wide and retrying Build. This does not require the composer to be restarted. To re-enable, run git config --global http.sslVerify true.

  1. After extension build is done, close any open graphs and refresh the component list to see the newly added extensions.

Graph Composer Refresh Extensions

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.

Graph Composer Development Workflow Graph Creation

For more information on creating graphs refer to DS_GraphComposer_Create_Graph

Save and execute the graph as demonstrated in Application Workflow