### Install Confluent Platform Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html Sets up the Confluent Platform repository and installs it. This is a prerequisite for librdkafka. ```bash sudo mkdir -p /etc/apt/keyrings wget -qO - https://packages.confluent.io/deb/8.0/archive.key | gpg \ --dearmor | sudo tee /etc/apt/keyrings/confluent.gpg > /dev/null CP_DIST=$(lsb_release -cs) echo "Types: deb URIs: https://packages.confluent.io/deb/8.0 Suites: stable Components: main Architectures: $(dpkg --print-architecture) Signed-by: /etc/apt/keyrings/confluent.gpg Types: deb URIs: https://packages.confluent.io/clients/deb/ Suites: ${CP_DIST} Components: main Architectures: $(dpkg --print-architecture) Signed-By: /etc/apt/keyrings/confluent.gpg" | sudo tee /etc/apt/sources.list.d/confluent-platform.sources > /dev/null sudo apt-get update && sudo apt-get install confluent-platform ``` -------------------------------- ### Install GStreamer and Development Packages Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_3D_Depth_Camera.html Installs necessary GStreamer and development libraries for the application. Ensure these are installed before proceeding. ```bash sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \ libgstrtspserver-1.0-dev libx11-dev libyaml-cpp-dev ``` -------------------------------- ### Example: Grant CAP_NET_RAW to gst-launch-1.0 Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvdsudpsink.html Example command to grant CAP_NET_RAW capability to the gst-launch-1.0 executable. ```bash sudo setcap CAP_NET_RAW=ep /usr/bin/gst-launch-1.0 ``` -------------------------------- ### Install NVIDIA Driver Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html Use these commands to make the NVIDIA driver executable and install it. Ensure Xorg service is stopped before installation. ```bash $ chmod 755 NVIDIA-Linux-x86_64-590.48.01.run $ sudo ./NVIDIA-Linux-x86_64-590.48.01.run --no-cc-version-check ``` -------------------------------- ### Setup Sample Data Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/Pipetuner-guide.html Unzip the sample data and run the setup script. Choose either the 'deepstream' or 'metropolis' option based on your usage. ```bash $ unzip pipe-tuner-sample.zip $ cd pipe-tuner-sample/scripts $ # DeepStream or Metropolis Microservices users should run only one of the following two commands based on their usage $ bash setup.sh deepstream # DeepStream users $ bash setup.sh metropolis # Metropolis Microservices users ``` -------------------------------- ### Compile and Install gst-nvdsdynamicsrcbin Plugin Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvdsdynamicsrcbin.html Set the CUDA version and run make commands to compile and install the plugin. Ensure you have root permissions for the installation step. ```bash export CUDA_VER=13.1 # or # CUDA_VER=13.0 $ sudo make $ sudo make install ``` -------------------------------- ### Install GStreamer Prerequisites Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_FAQ.html Install necessary packages for migrating to a newer GStreamer version. ```bash apt-get install python3-pip pip3 install meson pip3 install ninja apt-get install libmount-dev apt-get install flex apt-get install flex bison apt-get install libglib2.0-dev ``` -------------------------------- ### Install Confluent Platform for Kafka Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html Sets up the Confluent Platform repository and installs it, which is a prerequisite for installing librdkafka. This enables Kafka protocol support for message brokers. ```bash sudo mkdir -p /etc/apt/keyrings wget -qO - https://packages.confluent.io/deb/8.0/archive.key | gpg \ --dearmor | sudo tee /etc/apt/keyrings/confluent.gpg > /dev/null CP_DIST=$(lsb_release -cs) echo "Types: deb URIs: https://packages.confluent.io/deb/8.0 Suites: stable Components: main Architectures: $(dpkg --print-architecture) Signed-by: /etc/apt/keyrings/confluent.gpg Types: deb URIs: https://packages.confluent.io/clients/deb/ Suites: ${CP_DIST} Components: main Architectures: $(dpkg --print-architecture) Signed-By: /etc/apt/keyrings/confluent.gpg" | sudo tee /etc/apt/sources.list.d/confluent-platform.sources > /dev/null sudo apt-get update && sudo apt-get install confluent-platform ``` -------------------------------- ### Build and Install DeepStream Lidar Inference App Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_3D_Lidar_Inference.html Navigate to the application source directory and execute the make commands to build and install the application. Ensure you have the necessary build tools installed. ```bash $ sudo make $ sudo make install ``` -------------------------------- ### List Installed WSL Distributions Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_on_WSL2.html After installation or potential restart, verify that Ubuntu has been successfully installed by listing all available WSL distributions. ```bash $ wsl --list ``` -------------------------------- ### Compile and Install GStreamer Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_FAQ.html Steps to remove older GStreamer versions, clone, compile, and install a new version. ```bash #Remove older version apt-get remove *gstreamer* mkdir /tmp/gst- cd /tmp/gst- #Clone the repository git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git cd gstreamer #Switch to gst-version git checkout meson build --prefix=/usr ninja -C build/ cd build/ ninja install cd rm -rf ``` -------------------------------- ### Verify Docker Installation Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_on_WSL2.html Confirm that Docker is installed and running correctly by executing the 'hello-world' container. This should output a confirmation message. ```bash $ sudo docker run hello-world ``` -------------------------------- ### Install RealSense SDK Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_3D_Depth_Camera.html Installs the RealSense SDK utilities and development files. Ensure the SDK version is 2.48 or later. ```bash sudo apt-get install librealsense2-utils librealsense2-dev ``` -------------------------------- ### Install Nginx and RTMP module Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_AVSync.html Installs Nginx and the RTMP module, then configures Nginx to serve RTMP streams. This is a prerequisite for setting up RTMP input streams. ```bash $ apt-get update $ apt-get install nginx -y $ apt-get install libnginx-mod-rtmp -y $ vim /etc/nginx/nginx.conf #add below content rtmp { server { listen 1935; chunk_size 4096; application live { live on; record off; } } } $ service nginx restart ``` -------------------------------- ### Install Dependencies and Run Application Inside Container Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_AI_Agent_Skill.html After entering the container, install any required Python packages using requirements.txt and then execute your application script with its arguments. ```bash pip install -r requirements.txt # if generated ``` ```bash python3 .py [arguments] ``` -------------------------------- ### Install NVIDIA Driver on Linux Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html Make the NVIDIA driver executable and install it, bypassing version checks. Ensure display services are stopped before running. ```bash chmod 755 NVIDIA-Linux-aarch64-590.48.01.run sudo ./NVIDIA-Linux-aarch64-590.48.01.run --no-cc-version-check ``` -------------------------------- ### Sample Startup Info Response Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_RestServer.html Example JSON output for a successful startup status check. ```json { "startup-info" : { "ds-startup" : "YES" }, "reason" : "GET_STARTUP_INFO_SUCCESS", "status" : "HTTP/1.1 200 OK" } ``` -------------------------------- ### Example DeepStream Pipeline with Gst-nvstreammux Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_troubleshooting.html This is an example of a DeepStream pipeline that includes the Gst-nvstreammux plugin, which is required starting with DeepStream 4.0. ```bash Gst nvv4l2decoder --> Gst nvstreammux --> Gst nvinfer --> Gst nvtracker --> Gst nvmultistreamtiler --> Gst nvvideoconvert --> Gst nvosd --> Gst nveglglessink ``` -------------------------------- ### Install Prerequisite Packages for DeepStream Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html Installs essential packages required for DeepStream functionality, including SSL, cURL, GStreamer, and JSON/YAML libraries. Ensure these are installed before proceeding with DeepStream setup. ```bash $ sudo apt install \ libssl3 \ libssl-dev \ libcurl4-openssl-dev \ libgstreamer1.0-0 \ gstreamer1.0-tools \ gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly \ gstreamer1.0-libav \ libgstreamer-plugins-base1.0-dev \ libgstrtspserver-1.0-0 \ libjansson4 \ libyaml-cpp-dev \ libmosquitto1 ``` -------------------------------- ### Run 12-Camera MV3DT Example Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_MV3DT.html Execute the 12-camera sample workflow for MV3DT. Ensure prerequisites are met and the container has display access. ```bash sudo xhost + # Grant container access to display ./scripts/test_12cam_ds.sh ``` -------------------------------- ### Running Generated DeepStream App (Bare Metal) Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_AI_Agent_Skill.html Instructions for running a generated DeepStream Python application on a bare metal system with DeepStream SDK installed. Includes virtual environment setup and dependency installation. ```bash cd / # Create and activate a virtual environment (recommended) python3 -m venv venv source venv/bin/activate # Install dependencies listed by the agent pip install -r requirements.txt # if generated # Run the application python3 .py [arguments] ``` -------------------------------- ### Multi-View Configuration with Render Graph Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_3D_Custom_Manual.html Example configuration for a multi-view setup using a render graph, displaying a 2D color image and Lidar data in separate views. ```yaml config_body: window_width: 1280 # window size window_height: 360 # window size color_clear: true window_title: DS3D-Lidar-6-Cameras-BEVFusion render_graph: - texture3d_render: # 2D texture view layout: [0, 0, 640, 360] # layout [x0, y0, x1, y1] max_vertex_num: 6 color_clear: false texture_frame_key: DS3D::ColorFrame_2 # image data key - lidar3d_render: # lidar top view layout: [640, 0, 1280, 360] # layout [x0, y0, x1, y1] color_clear: false view_position: [0, 0, 30] view_target: [0, 0, 0] view_up: [0, 1, 0] lidar_color: [0, 0, 255] lidar_data_key: DS3D::LidarXYZI lidar_bbox_key: DS3D::Lidar3DBboxRawData element_size: 4 ``` -------------------------------- ### Run 4-Camera MV3DT Example Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_MV3DT.html Execute the 4-camera sample workflow for MV3DT. Ensure prerequisites are met and the container has display access. ```bash sudo xhost + # Grant container access to display ./scripts/test_4cam_ds.sh ``` -------------------------------- ### Test gst-nvdsdynamicsrcbin with Sample Application Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvdsdynamicsrcbin.html Navigate to the sample application directory, clone the reference apps repository, compile the test application, and run it. This demonstrates pipeline setup, dynamic source addition, and frame processing. ```bash cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/ git clone https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps cd deepstream-dynamicsrcbin-test sudo make ./deepstream-dynamicsrcbin-test ``` -------------------------------- ### PipeTuner Console Output Example Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/Pipetuner-guide.html This shows a typical console log output during PipeTuner operation, including dependency installation, server launch, progress updates, and optimization completion messages. ```text Installing dependencies... Installing dependencies (1/2) Installing dependencies (2/2) Launch BBO client... Launch BBO server... PipeTuner started successfully! !!!!! To stop tuning process in the middle, press CTRL+C !!!!! adding: DsAppServer (deflated 63%) 2024-03-19 08:09:52,108 root INFO seq_list: ['Retail_Synthetic_Cam01', 'Retail_Synthetic_Cam02', 'Retail_Synthetic_Cam03', 'Retail_Synthetic_Cam04', 'Retail_Synthetic_Cam05', 'Retail_Synthetic_Cam06', 'Retail_Synthetic_Cam07', 'Retail_Synthetic_Cam08'] 2024-03-19 08:09:52,169 root INFO Writing configs to /output/SDG_sample_PeopleNet-ResNet34_NvDCF-ResNet50_MOT_test.yml_output/results/configs_03-19-2024_08-09-52 2024-03-19 08:09:52,169 root INFO send backend init 2024-03-19 08:09:52,170 root INFO creating optimizers... 2024-03-19 08:09:52,170 root INFO done. created 2 * Serving Flask app 'ds_bbo_frontend_server' * Debug mode: on 2024-03-19 08:09:52,186 root INFO init jobs done 2024-03-19 08:09:52,187 root INFO progress: 0% (0/4) 2024-03-19 08:09:52,193 root INFO wait backend ready ... 2024-03-19 08:12:15,232 root INFO progress: 25% (1/4) ETA 00:07:09 2024-03-19 08:12:25,447 root INFO progress: 25% (1/4) ETA 00:07:39 ... 2024-03-19 08:13:47,190 root INFO progress: 50% (2/4) ETA 00:03:55 2024-03-19 08:13:57,413 root INFO progress: 75% (3/4) ETA 00:01:21 ... 2024-03-19 08:14:58,719 root INFO progress: 100% (4/4) ETA 00:00:00 2024-03-19 08:14:58,720 root INFO OPTIMIZATION DONE! … stopping workers... number of workers to stop: 2 number of workers to stop: 0 done. !!!!! Press CTRL+C key to end PipeTuner !!!!! ``` -------------------------------- ### Install Prerequisite Packages for DeepStream SDK Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Installation.html Install essential packages required before installing the DeepStream SDK. This command installs libraries for SSL, curl, GStreamer, JSON, and build tools. ```bash sudo apt install \ libssl3 \ libssl-dev \ libcurl4-openssl-dev \ libgles2-mesa-dev \ libgstreamer1.0-0 \ gstreamer1.0-tools \ gstreamer1.0-plugins-good \ gstreamer1.0-plugins-bad \ gstreamer1.0-plugins-ugly \ gstreamer1.0-libav \ libgstreamer-plugins-base1.0-dev \ libstrtspserver-1.0-0 \ libjansson4 \ libyaml-cpp-dev \ libjsoncpp-dev \ protobuf-compiler \ libmosquitto1 \ gcc \ make \ git \ python3 ``` -------------------------------- ### NvMOT_Init Sample Implementation Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvtracker.html Sample implementation for the NvMOT_Init function, responsible for initializing the custom tracker context. Users should add error handling and additional logic as needed. ```c++ NvMOTStatus NvMOT_Init(NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse) { if(pContextHandle != nullptr) { NvMOT_DeInit(*pContextHandle); } /// User-defined class for the context NvMOTContext *pContext = nullptr; /// Instantiate the user-defined context pContext = new NvMOTContext(*pConfigIn, *pConfigResponse); /// Pass the pointer as the context handle *pContextHandle = pContext; /** * return NvMOTStatus_Error if something is wrong * return NvMOTStatus_OK if everything went well */ } ``` -------------------------------- ### Start Kafka Server and Create Topic Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_3D_MultiModal_Lidar_Camera_BEVFusion.html Initialize a Kafka server and create a topic for messaging tests. These commands are used to set up the Kafka environment required for IoT messaging. ```bash $ docker run -p 9092:9092 apache/kafka:3.7.0 # start kafka server with port 9092 ``` ```bash $ bin/kafka-topics.sh --create --topic quick-test --bootstrap-server localhost:9092 # creat topic 'quick-test' ``` -------------------------------- ### Sample Readiness Info Response Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_RestServer.html Example JSON output for a successful readiness check. ```json { "ready-info" : { "ds-ready" : "YES" }, "reason" : "GET_READY_INFO_SUCCESS", "status" : "HTTP/1.1 200 OK" } ``` -------------------------------- ### Install Python 3.12 for Inference Builder Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_troubleshooting.html When `typed-ast` fails to build during Python dependency installation for Inference Builder, ensure Python 3.12 is installed. This command installs the necessary development and virtual environment packages for Python 3.12. ```bash sudo apt update sudo apt install -y python3.12-dev python3.12-venv ``` -------------------------------- ### NvMOTContext Constructor Sample Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvtracker.html Sample code for the NvMOTContext constructor, demonstrating initialization steps such as setting the CUDA device, instantiating a localizer, and processing frame information. ```c++ NvMOTContext::NvMOTContext(const NvMOTConfig &config, NvMOTConfigResponse& configResponse) { // Set CUDA device as needed cudaSetDevice(m_Config.miscConfig.gpuId) // Instantiate an appropriate localizer/tracker implementation // Load and parse the config file for the low-level tracker using the path to a config file m_pLocalizer = LocalizerFactory::getInstance().makeLocalizer(config.customConfigFilePath); // Set max # of streams to be supported // ex) uint32_t maxStreams = config.maxStreams; // Use the video frame info for(uint i=0; i/.cursor/skills/ ``` -------------------------------- ### Get Metrics Info Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_RestServer.html Retrieve performance metrics for streams and system statistics. This is a GET request to the /api/v1/metrics endpoint. ```bash curl -XGET 'http://localhost:9000/api/v1/metrics' ``` -------------------------------- ### Launch PipeTuner Tuning Process Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/Pipetuner-guide.html Execute the launch.sh script with the image name and PipeTuner configuration file to start the tuning process. ```bash $ bash launch.sh [deepstream or mdx-perception image name or id] [config_pipetuner.yml] ``` -------------------------------- ### Install Additional DeepStream Packages Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_FAQ.html Run this script inside DeepStream Docker containers to install packages for multimedia operations. ```bash $ /opt/nvidia/deepstream/deepstream/user_additional_install.sh ``` -------------------------------- ### Install DeepStream Libraries Package Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Libraries.html Install the DeepStream Libraries package using pip after downloading the wheel file from NGC. ```bash pip3 install deepstream_libraries-1.3-cp312-cp312-linux_x86_64.whl ``` -------------------------------- ### Install Python Dependencies for DeepStream Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Libraries.html Install the Python packages required for DeepStream Libraries within the activated virtual environment. ```bash sh scripts/install_python_pkgs.sh ``` -------------------------------- ### SV3DT Configuration Example Source: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvtracker.html Configuration section for enabling the ObjectModelProjection feature, specifying camera calibration files. ```yaml ObjectModelProjection: cameraModelFilepath: # In order of the source streams - 'camInfo-01.yml' - 'camInfo_02.yml' ... ```