Run Pipeline without MPK Tools

When you use the mpk command to run a pipeline, it deploys the MPK package to the DevKit under the /data/simaai/applications/ directory. This package includes a manifest.json file that defines how the GStreamer pipeline is launched.

Reviewing the manifest.json file can help you understand the pipeline’s execution process. This allows you to run the pipeline manually without using mpk deploy. The following example demonstrates how to run a previously tested Resnet50 pipeline directly from the DevKit.

Note

This procedure assumes you have completed the procedure described in here and tested a ResNet50 pipeline on the DevKit.

davinci:/data/simaai/applications$ cat resnet/manifest.json |grep \"gst\"
  "gst" : "/data/simaai/applications/resnet/bin/gst_app --manifest-json=\"/data/simaai/applications/resnet/manifest.json\" --gst-string=\"simaaisrc location='/data/simaai/applications/resnet/etc/img_1_1920_1080.rgb' node-name='input' blocksize=6220800 delay=1000 mem-target=1 ! simaaiprocesscvu source-node-name='input' buffers-list='input' config='/data/simaai/applications/resnet/etc/simaai_detess_dequant_preproc_1.json' !  simaaiprocessmla config='/data/simaai/applications/resnet/etc/process_mla_1.json' !  simaaiprocesscvu source-node-name='process_mla' buffers-list='process_mla' config='/data/simaai/applications/resnet/etc/simaai_dequantize_postproc_1.json' ! fakesink\""

The gst element above shows the gst_app launch string to execute the pipeline.

davinci:/data/simaai/applications$ cat resnet/manifest.json |grep environment
  "environment" : [ "GST_DEBUG=5", "LD_LIBRARY_PATH=/data/simaai/applications/resnet/lib", "GST_PLUGIN_PATH=/data/simaai/applications/resnet/lib" ]

The environment string above shows the environment variables required to run the pipeline.

To run the pipeline manually, you need to combine the environment settings with the gst string as shown below.

davinci:/var/log$ sudo kill $(pgrep -f gst_app)
davinci:/var/log$ sudo GST_DEBUG=5 LD_LIBRARY_PATH=/data/simaai/applications/resnet/lib GST_PLUGIN_PATH=/data/simaai/applications/resnet/lib /data/simaai/applications/resnet/bin/gst_app --manifest-json=/data/simaai/applications/resnet50_mpk/manifest.json --gst-string="simaaisrc location=/data/simaai/applications/resnet50_mpk/etc/input_image720.rgb node-name=input blocksize=2764800 delay=1 mem-target=0 ! 'video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720' ! simaaiprocesscvu_new name=simaai_gen_preproc_1 !  simaaiprocessmla_new name=simaai_process_mla_1 ! simaaiprocesscvu_new name=simaai_detesdequant_1 ! 'application/vnd.simaai.tensor, format=(string)DETESSDEQUANT' ! simple_overlay config=/data/simaai/applications/resnet/etc/overlay.json"

After testing the command, you can integrate it into a shell script or a systemd service to run the pipeline at boot for automatic startup. You can also launch the pipeline from another application, which is useful when parameters need to be dynamically determined at runtime.