Run Multiple (Concurrent) Pipelines
The Palette SDK supports running multiple (upto 4) pipelines concurrently on a single MLSoC device. This option, in which tasks are interleaved (managed at the same time), offers efficient resource management across pipelines enabling high-throughput workloads.
Steps
You must have at least two or more uniquely named working GStreamer pipelines.
In the SDK, enable the multi-pipeline feature by updating the application.json file for each pipeline as shown below.
Configure the
multi-pipelineparameter for the pluginsimaaiprocessmlato betrue. That is,multi-pipeline = true. For example,
"gst": "rtspsrc location=<RTSP_SRC> ! rtph264depay wait-for-keyframe=true ! h264parse ! 'video/x-h264, parsed=true, stream-format=(string)byte-stream, alignment=(string)au, width=(int)[1,4096], height=(int)[1,4096]' ! simaaidecoder sima-allocator-type=2 name='decoder' ! tee name=source ! 'video/x-raw' ! simaaiprocesscvu name=simaai_preprocess num-buffers=5 ! simaaiprocessmla multi-pipeline=true name=simaai_process_mla num-buffers=5 ! simaaiboxdecode name='simaai_boxdecode' ! 'application/vnd.simaai.tensor' ! overlay. source. ! 'video/x-raw' ! simaai-overlay2 name=overlay render-info='input::decoder,bbox::simaai_boxdecode' labels-file='/data/simaai/applications/YoloV7/share/overlay/labels.txt' ! simaaiencoder enc-bitrate=4000 name=encoder ! h264parse ! rtph264pay ! udpsink host=<HOST_IP> port=<HOST_PORT>"
Run the command
mpk createto generate an updated mpk for the pipeline.On the host side, update the
PORTfor each of the pipeline output to view the streams one by one running concurrently. For example,
GST_DEBUG=0 gst-launch-1.0 udpsrc port=<PORT> ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! 'video/x-h264,stream-format=byte-stream,alignment=au' ! avdec_h264 ! fpsdisplaysink sync=0
Use the command
mpk deployto run the pipeline on the SoC device in the appropriate sequence configured in the application.json file.Repeat steps 2, 3, and 4, above, for each pipeline you will be running.
Make sure you have a host machine with a SiMa.ai PCIe HHHL card appropriately installed in its slot. Additionally, you must have at least two or more uniquely named working GStreamer pipelines.
In the SDK, enable the multi-pipeline feature by updating the application.json file for each pipeline as shown below.
Configure the
queueparameter in the plugins, simaaipciesrc and simaaipciesink, for the order in which the pipeline will run. Use one queue for each pipeline.Configure the
multi-pipelineparameter for the pluginsimaaiprocessmlato betrue. That is,multi-pipeline = true. For example,
"gst": "simaaipciesrc queue=3 ! tee name='allegro_tee' ! queue2 ! simaaiprocesscvu name=simaai_preprocess num-buffers=5 ! simaaiprocessmla multi-pipeline=true name=simaai_process_mla num-buffers=5 ! simaaiboxdecode name='simaai_boxdecode' ! 'application/vnd.simaai.tensor' ! simaai-overlay2 name=overlay render-info='input::simaaipciesrc,bbox::simaai_boxdecode' labels-file='/data/simaai/applications/YoloV7_PCIe/share/overlay/labels.txt' ! simaaipciesink queue=3 allegro_tee. ! queue2 ! overlay."
Run the command
mpk createto generate an updated mpk for the pipeline.On the host side, update the
queueparameter of the pluginpciehostfor each gst-pipeline. Make sure to use the same queue number as used in the corresponding JSON file of the pipeline. For example,
gst-launch-1.0 rtspsrc location=<rtsp source> ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=NV12 ! pciehost queue=3 queuedepth=8 showfps=1 ! videoparse format=nv12 width=1280 height=720 ! autovideoconvert ! autovideosink
Use the command
mpk deployto run the pipeline on the SoC device in the appropriate sequence configured in the application.json file.Repeat steps 2, 3, and 4, above, for each pipeline you will be running.