.. Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA CORPORATION is strictly prohibited. ========================================= Development Workflow ========================================= This workflow is for custom extension developers. It allows developers to implement new functionality and add business logic to applications through graph. .. image:: /content/Development_workflow.png :align: center :alt: 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.1-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.1-devel In both the cases, either commandline or Composer UI can used. To launch composer, run: :: composer .. image:: /content/Composer_launch_window.png :align: center :alt: Graph Composer Default Window 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 :doc:`GraphComposer_Registry_CLI` for more commands. Using Composer UI ==================== Open the ``Registry`` menu from the menubar at the top and click on ``Sync Repo`` .. image:: /content/Composer_registry_sync_menu.png :align: center :alt: Graph Composer Registry Menu Select ``ngc-public`` from the drop-down list and click on ``Sync`` .. image:: /content/Composer_registry_sync_selection.png :align: center :alt: Graph Composer Select Repo Composer will report the current status using a progress bar .. image:: /content/Composer_registry_sync_progress.png :align: center :alt: Graph Composer Sync Progress Once the extension sync is complete, composer will display a success message. .. image:: /content/Composer_registry_sync_success.png :align: center :alt: Graph Composer Sync Success On clicking close, composer will automatically refresh component list and the refreshed list can be seen in the component list window on the right .. image:: /content/Composer_registry_sync_refreshed_list.png :align: center :alt: Graph Composer Default View Develop New Extension ------------------------- Using commandline ==================== Generating a non-DeepStream (GStreamer) extension ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 ``/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.1/tools/graph_extension_generator/generate_extensions.py * Navigate to the output directory :: cd * 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``. .. image:: /content/Composer_tools_menu.png :align: center :alt: Graph Composer Tools Menu 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. .. image:: /content/Composer_Extn_Generation_dependencies.png :align: center :alt: Graph Composer Extension Generator Dialog - Install Dependencies 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. .. image:: /content/Composer_Extn_Generation.png :align: center :alt: 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``. 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. .. image:: /content/Composer_development_workflow_graph_create.png :align: center :alt: Graph Composer Development Workflow Graph Creation Save and execute the graph as demonstrated in :doc:`GraphComposer_Getting_Started`