Application Workflow ====================== This workflow is for application developers to create AI Application using published extensions and deploy those graphs either to containers or on native systems. Application development is supported only on x86, but can be deployed on both Jetson and x86. Application workflow includes following steps: 1. Launch Composer 2. Sync Extensions from NVIDIA Cloud repository 3. Load Graph and parameters 4. Deploy AI Application Launch Composer --------------- There are two options to launch Composer: 1. Native workstation: Launch Composer from native workstation using following command: :: composer 2. DeepStream SDK devel container image: Launch Composer from DeepStream SDK devel container image: :: 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 composer .. image:: /content/Composer_launch_window.PNG :align: center :alt: Graph Composer Default Window Sync Extensions ------------------------- Before any graph can be executed or container built, extensions from NGC public repo must be synced. Follow the steps below to sync the extensions: 1. Close any open graphs .. image:: /content/Composer_registry_sync_close_graphs.PNG :align: center :alt: Graph Composer Close Graphs 2. 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 3. 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 4. The composer reports the current status using a progress bar. .. image:: /content/Composer_registry_sync_progress.PNG :align: center :alt: Graph Composer Sync Progress 5. Once the extension sync is complete, the composer displays a success message. .. image:: /content/Composer_registry_sync_success.PNG :align: center :alt: Graph Composer Sync Success 6. On clicking close, the composer automatically refreshes component list. You can see the refreshed list in the component list window on the right. .. image:: /content/Composer_registry_sync_refreshed_list.PNG :align: center :alt: Graph Composer Default View Load Graph -------------- 1. Open the ``File`` menu from the menubar at the top and click on ``Open Graph`` to launch the file browser. You may alternatively use the ``Ctrl + O`` key combination. .. image:: /content/Composer_file_menu.png :align: center :alt: Graph Composer File Menu 2. Browse to a valid graph file, select it and click on ``Okay`` to open the graph. .. image:: /content/Composer_open_graph.PNG :align: center :alt: Graph Composer Open Graph 3. Composer should now show the application graph. .. image:: /content/Composer_test1_graph.PNG :align: center :alt: Graph Composer Test1 Graph 4. To load component parameters from a separate file, right-click on the graph and select ``Load parameters`` from the context menu to launch the file browser. .. image:: /content/Composer_load_parameters_right_click.PNG :align: center :alt: Graph Composer Load Parameters Menu 5. Browse to an appropriate parameters file for the currently open and visible graph, select it and click on ``Okay`` to load parameter values from the file. .. image:: /content/Composer_load_parameters.PNG :align: center :alt: Graph Composer Load Parameters Deploy Graph -------------- You can deploy the graph using one of the following methods: 1. Execute on x86_64 (host) 2. Execute on Jetson or another remote system 3. Build Container Image 4. Execute graph using command-line **Execute on x86_64 (Same Host)** * To execute the currently open graph, click on the ``Run Graph`` button from the toolbar on the left. This will open the ``Run Graph`` dialog. .. image:: /content/Composer_launch_window_button.PNG :align: center :alt: Graph Composer Run Graph Toolbar button * To execute on the same host system, select ``Local Machine`` radio button, select appropriate Platform config file using the file browser and click on ``Run``. The graph execution progress will be reported via logs in the console window. .. image:: /content/Composer_local_run.png :align: center :alt: Graph Composer Local Run **Execute on Jetson or another remote system** 1. Launch the ``Run Graph`` dialog and select ``Remote Machine`` radio button. 2. Select appropriate Platform config file (aarch64 or x86_64) based on the remote machine configuration. 3. Set any environment variables required to execute the graph remotely (e.g. ``DISPLAY=:0``) enter the remote system details and click on ``Run``. 4. The graph execution progress will be reported via logs in the console window. .. image:: /content/Composer_remote_run.PNG :align: center :alt: Graph Composer Remote Run **Build Container Image** 1. To build a container, first click on the ``Build Container`` button from the toolbar on the left. .. image:: /content/Composer_container_builder_launch_button.PNG :align: center :alt: Graph Composer Container Builder Toolbar Button 2. This will open the ``Build Container`` dialog. Launch the file browser using the button next to the ``Configuration File`` input. .. image:: /content/Composer_container_builder_launch.PNG :align: center :alt: Graph Composer Container Builder Launch 3. Select a container builder configuration file and open it. .. image:: /content/Composer_container_builder_config.PNG :align: center :alt: Graph Composer Container Builder Config 4. Click the button next to the ``Platform config File`` input to launch the file browser. Select a platform config file and open it. .. image:: /content/Composer_container_builder_platform.PNG :align: center :alt: Graph Composer Container Builder Platform 5. Click on ``Build`` to start the build process. Composer reports the container build status using a progress bar. .. image:: /content/Composer_container_builder_progress.PNG :align: center :alt: Graph Composer Container Builder Progress 6. Composer shows a success message upon successful completion. .. image:: /content/Composer_container_builder_success.PNG :align: center :alt: Graph Composer Container Builder Success **Execute Graph using command-line (execute_graph.sh script)** The ``execute_graph.sh`` script provided with the graph composer helps with graph execution and provides added functionality. Complete usage reference: :: Usage: /opt/nvidia/graph-composer/execute_graph.sh [options] [additional graph files] Options: -d, --graph-target "" [Required] Graph target config file -s, --subgraphs ,,... [Optional] Paths of subgraphs used by the application, comma-separated list --resources [Optional] Graph resources file -f, --fresh-manifest [Optional] Re-install graph and generate a new manifest file -g, --with-gdb [Optional] Execute the graph under gdb -m, --use-manifest [Optional] Use an existing manifest file -r, --remove-install-dir [Optional] Remove graph installation directory during exit -t, --target [Optional] Target to execute the graph on. SSH will be used --target-env-vars "" [Optional] Separated list of environment variables to be set before running on target .. note:: To execute graphs on a remote target: * Graph Composer package needs to be already installed on the target * It is recommended that a password-less login method be used for SSH * To execute a graph locally, run: :: /opt/nvidia/graph-composer/execute_graph.sh -d For example, on dGPU host, run: :: /opt/nvidia/graph-composer/execute_graph.sh -d /opt/nvidia/graph-composer/config/target_x86_64_cuda_11_4.yaml * To execute on a remote Jetson target, run: :: /opt/nvidia/graph-composer/execute_graph.sh -d /opt/nvidia/graph-composer/config/target_aarch64.yaml \ -t --target-env-vars "DISPLAY=:0" .. note:: If a graph has resources associated with it described in a resources YAML file, an additional argument ``--resources `` can be passed to the script. The resources would be copied to the remote target before graph execution .. note:: When executing a graph that uses subgraphs, you must pass additional argument ``-s ,,...`` containing paths to the subgraph files. You must not pass the subgraphs as graph file arguments without an option. .. note:: To run the graph on the remote machine, install the following packages: 1) `openssh-client` 2) `sshfs` Use `ssh-keygen` to generate an ssh key pair.