NVIDIA DeepStream
How to run NVIDIA DeepStream (video analytics and stream processing) as a compute resource in CGC and develop your own DeepStream app.
Some of the provided texts come from the official website.
NVIDIA’s DeepStream is a complete streaming analytics toolkit based on GStreamer for AI-based multi-sensor processing, video, audio, and image understanding.
You can now create stream-processing pipelines that incorporate neural networks and other complex processing tasks like tracking, video encoding/decoding, and video rendering. These pipelines enable real-time analytics on video, image, and sensor data.
Create DeepStream app on CGC SDK
First of all, create DeepStream app in CGC SDK using the command below:
cgc compute create -n <name> -c <cpu_cores> -m <RAM GiB> -g <gpu_count> -gt <gpu_type> deepstream --repository-secret <secret_name>
-n, --name- name of the compute resource-g, --gpu- quantity of attached GPUs-gt, --gpu-type- type of attached GPU, named as incgc status(NVIDIA-RTX-A5000 | NVIDIA-A100-SXM4-80GB | NVIDIA-B200) default = NVIDIA-RTX-A5000-c, --cpu- cpu core count-m, --memory- amount of attached RAM in GiB--repository-secret- name of the registry secret used to pull the image, created withcgc secret create. It is required for this template: without it the API rejects the request withRequired CGC specific parameter: image_pull_secret_name
The app runs the nvcr.io/nvidia/deepstream:7.1-triton-multiarch image, so the SDK is installed in /opt/nvidia/deepstream/deepstream-7.1. The /opt/nvidia/deepstream/deepstream symlink always points at the installed version, so you can use it instead of the versioned path.
DeepStream app is running as a container and do not package libraries necessary for certain multimedia operations like audio data parsing, CPU decode, and CPU encode. This change could affect processing certain video streams/files like mp4 that include audio track. Run the below script inside the created app to install additional packages (e.g. gstreamer1.0-libav, gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad, gstreamer1.0-plugins-ugly as required) that might be necessary to use all the DeepStreamSDK features: /opt/nvidia/deepstream/deepstream/user_additional_install.sh
cd /opt/nvidia/deepstream/deepstream
./user_additional_install.sh
Sometimes with RTSP streams the application gets stuck on reaching EOS. This is because of an issue in rtpjitterbuffer component.
To fix this issue, a script update_rtpmanager.sh at /opt/nvidia/deepstream/deepstream has been provided with required details to update gstrtpmanager library.
cd /opt/nvidia/deepstream/deepstream
./update_rtpmanager.sh
Default configuration
These arguments are added by default to the DeepStream app, to the jupyter lab command:
--ip=0.0.0.0- binds the app to all available IP addresses--port=8888- sets the port for the app to listen on--allow-root- allows root user to access the app
Develop your own app with DeepStream and CGC SDK
To start the development of your first app with DeepStream and CGC you need to create a volume mounted to already created compute resource (deepstream app) and a filebrowser in order to save your progress no matter the circumstances.
The volume will be mounted at /workspace/{name-of-your-volume}.
To be able to run your code inside deepstream container you will need to create a symbolic link to your volume,
so it would be accessible from /opt/nvidia/deepstream/deepstream
ln -s /workspace/{name-of-your-volume} /opt/nvidia/deepstream/deepstream/{name-of-your-volume}
cd /opt/nvidia/deepstream/deepstream/{name-of-your-volume}
Now you are ready to develop your first DeepStream app with CGC SDK.