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

  1. You must have at least two or more uniquely named working GStreamer pipelines.

  2. In the SDK, enable the multi-pipeline feature by updating the application.json file for each pipeline as shown below.

    • Configure the multi-pipeline parameter for the plugin simaaiprocessmla to be true. 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>"
  1. Run the command mpk create to generate an updated mpk for the pipeline.

  2. On the host side, update the PORT for 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
  1. Use the command mpk deploy to run the pipeline on the SoC device in the appropriate sequence configured in the application.json file.

  2. Repeat steps 2, 3, and 4, above, for each pipeline you will be running.