MPK Toolο
The MPK tool is a set of commands used by the Palette CLI engine to allow users to build, deploy, and manage applications on the SiMa.ai devices of all form factors. The applications are packaged and deployed in a bundle called an MPK.
The MPK commands allow the developer to communicate and manage the MLSoC device (for example, the Developer Board in the SiMa Development Kit). The commands are the same whether the device is connected over Ethernet or PCIe.
However, in PCIe mode, you must include the slot number as shown below, -s
being your slot number.
sima-user@docker-image-id:/home# mpk device connect -s 0
Device Connectivity using mpkο
The MPK tool allows for persistent device connection which provides the ability to auto- reconnect to the MLSoC device upon reboot.
Note
The Palette SDK polls the device for 125 seconds post disconnect. If the device does not reconnect in 125 seconds, the device will be permanently disconnected.
Check the device connectivity status using the mpk device list
command.
If the connection status is cli-agent-down
or offline
, even after 125 seconds, you must manually disconnect and re-connect to the device.
sima-user@docker-image-id:/home$ mpk device list Active Connections over Ethernet ββββββββββ³βββββββββββββββββ³ββββββββββββββββββ³βββββββββββ³ββββββββββββββ³ββββββββββββββ β Status β Status Details β Target β Username β Device β Jump Server β β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ© β π΄ β Cli-agent-down β 10.42.0.231 β sima β diet_danger β - β ββββββββββ΄βββββββββββββββββ΄ββββββββββββββββββ΄βββββββββββ΄ββββββββββββββ΄ββββββββββββββ sima-user@docker-image-id:/home$ mpk device list Active Connections over Ethernet ββββββββββ³βββββββββββββββββ³ββββββββββββββββββ³βββββββββββ³ββββββββββββββ³ββββββββββββββ β Status β Status Details β Target β Username β Device β Jump Server β β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ© β π΄ β Offline β 10.42.0.231 β sima β diet_danger β - β ββββββββββ΄βββββββββββββββββ΄ββββββββββββββββββ΄βββββββββββ΄ββββββββββββββ΄ββββββββββββββ sima-user@docker-image-id:/home$ mpk device disconnect -t sima@10.42.0.231 βΉ Disconnecting 10.42.0.231... βΌ 10.42.0.231 is not connected for sima. sima-user@docker-image-id:/home$ mpk device connect -t sima@10.42.0.231 βΉ Please enter the password for 10.42.0.231 π : βΉ Connecting to sima@10.42.0.231... β Connection established to 10.42.0.231 . sima-user@docker-image-id:/home$ mpk device list Active Connections over Ethernet ββββββββββ³βββββββββββββββββ³ββββββββββββββββββ³βββββββββββ³ββββββββββββββ³ββββββββββββββ β Status β Status Details β Target β Username β Device β Jump Server β β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ© β π’ β Online β 10.42.0.231 β sima β base_topple β - β ββββββββββ΄βββββββββββββββββ΄ββββββββββββββββββ΄βββββββββββ΄ββββββββββββββ΄ββββββββββββββ β There are no PCIe devices available.
mpk deviceο
The mpk device
command is used for device provisioning. This command lets you connect and
disconnect the MLSoC Developer Board from your host machine. To connect and disconnect,
you will need the MLSoC Developer Board username and IP/hostname.
mpk device -h
lists the supported commands as shown below:sima-user@docker-image-id:/home# mpk device -h usage: mpk device [-h] {connect,disconnect,list,reboot} ... Device Connectivity options: -h, --help show this help message and exit sub-commands: {connect,disconnect,list,reboot} connect Connect to the device disconnect Disconnect from the device list List the connected devices reboot Reboot the device
mpk device connect
is used to connect to the MLSoC Developer Board:sima-user@docker-image-id:/home# mpk device connect -h usage: mpk device connect [-h] [-t TARGET] [-u USER] [-p PASSWORD] [-d DEVICE] [-slot PCIE_SLOT] options: -h, --help show this help message and exit -t TARGET, --target TARGET target device ip or fqdn -u USER, --user USER username -p PASSWORD, --password PASSWORD password -d DEVICE, --device DEVICE device id -slot PCIE_SLOT, --slot-number PCIE_SLOT Slot number of the PCIe Soc to connect to sima-user@docker-image-id:/home# mpk device connect -t sima@10.42.0.231 π Connection established to 10.42.0.231 .
mpk device connect
uses SSH. For the SSH connection you must have the username/password and the IP address of the device.For the PCIe board, you must connect using the following command:
sima-user@docker-image-id:/home# mpk device connect -s 0
-s being your slot number.
mpk device list
lists the devices (MLSoC Developer Board) already connected, if you do not have available connections:sima-user@docker-image-id:/home# mpk device list β There are no active Ethernet connections. β There are no active PCIe connections.
If there are connections available:
sima-user@docker-image-id:/home# mpk device list Active Connections over Ethernet ββββββββββ³ββββββββββββββ³βββββββββββ³ββββββββββββββββ β Status β Target β Username β Device β β‘ββββββββββββββββββββββββββββββββββββββββββββββββββ© β π’ β 10.42.0.231 β sima β fault_satisfy β ββββββββββ΄ββββββββββββββ΄βββββββββββ΄ββββββββββββββββ β There are no active PCIe connections.
Note
mpk device list
correctly displays the current device status with red/green indicators (green: active, red: offline).
mpk device disconnect
is used to disconnect from the device:sima-user@docker-image-id:/home# mpk device disconnect -h usage: mpk device disconnect [-h] [-t TARGET] [-u USER] [-d DEVICE] [-slot PCIE_SLOT] options: -h, --help show this help message and exit -t TARGET, --target TARGET target device ip or fqdn -u USER, --user USER username -d DEVICE, --device DEVICE device id -slot PCIE_SLOT, --slot-number PCIE_SLOT Slot number of the PCIe Soc to connect to sima-user@docker-image-id:/home# mpk device disconnect -t sima@10.42.0.231 β 10.42.0.231 successfully disconnected for user sima !
mpk device reboot
is used to reboot the device:sima-user@docker-image-id:/home# mpk device reboot -h usage: mpk device reboot [-h] [-t TARGET] [-d DEVICE] options: -h, --help show this help message and exit -t TARGET, --target TARGET target device ip or fqdn -d DEVICE, --device DEVICE device id
sima-user@docker-image-id:/home# mpk device reboot -t 10.42.0.231 βΉ Rebooting 10.42.0.231, please wait βΉ 10.42.0.231 is rebooted.
More Optionsο
You have the ability to specify the username using the -u
option and assign a name to the device as shown below. Once assigned, use the device name in the commands.
sima-user@docker-image-id:/home# mpk device connect -t 10.42.0.231 -u sima -d my_device βΉ Please enter the password for 10.42.0.231 π : π Connection established to 10.42.0.231 . sima-user@docker-image-id:/home# mpk device list Active Connections over Ethernet ββββββββββ³ββββββββββββββ³βββββββββββ³ββββββββββββ β Status β Target β Username β Device β β‘ββββββββββββββββββββββββββββββββββββββββββββββ© β π’ β 10.42.0.231 β sima β my_device β ββββββββββ΄ββββββββββββββ΄βββββββββββ΄ββββββββββββ β There are no active PCIe connections. sima-user@docker-image-id:/home# mpk device disconnect -d my_device βΉ Disconnecting User: sima from Target: 10.42.0.231 β 10.42.0.231 successfully disconnected for user sima !
mpk createο
The mpk create
command is used for creating an mpk package from the source directory of your
application which can then be deployed on the MLSoC Developer Board.
Note
For the mpk create
command, do not use the slot number when connected over PCIe.
sima-user@docker-image-id:/home# mpk create -h
usage: mpk create [-h] [-d OUTPUT_DIR] [-s INPUT_DIR]
options:
-h, --help show this help message and exit
-d OUTPUT_DIR, --dir OUTPUT_DIR
folder to be used for mpk creation
-s INPUT_DIR, --src INPUT_DIR
folder where project sources are located
sima-user@docker-image-id:/home# cd /usr/local/simaai/app_zoo/Gstreamer/PeopleTracker/
sima-user@docker-image-id:/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker# ls
application.json build core plugins README.md resources
sima-user@docker-image-id:/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker# mpk create -d . -s .
βΉ Step COMPILE completed successfully.
βΉ Step COPY RESOURCE completed successfully
βΉ Step RPM BUILD completed successfully.
βΉ Successfully created MPK at '/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker/project.mpk'
sima-user@docker-image-id:/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker# ls
application.json build core plugins project.mpk README.md resources
mpk project createο
The mpk project create
command is used for createing a project/pipeline from a model.tar.gz using a combination of pre-process, MLA, and
post-process plugins (or a only a specific plugin as specified by the user). The project/pipeline created by default includes simaaisrc
as the source
and fakesink
as the sink.
Note
For the mpk project create
command, do not use the slot number when connected over PCIe.
sima-user@docker-image-id:/home# mpk project create -h
usage: mpk project create [-h] [--model-path MODEL_PATH] [--preproc-kernel PREPROC_KERNEL] [--plugin-json PLUGIN_JSON] [--input-resource INPUT_RESOURCE]
options:
-h, --help show this help message and exit
--model-path MODEL_PATH
Path to the model.tar.gz file. This file contains the model to be used for generating the mini pipeline.
--preproc-kernel PREPROC_KERNEL
Optional parameter: You may specify a pre-processing kernel, such as 200 (gen_preproc, the default value if not specified) or 202 (quanttess). This parameter is only applicable when using the 5-plugin pipeline and is not valid for creating a mini pipeline for a specific
plugin.
--plugin-json PLUGIN_JSON
Optional parameter: You may specify a JSON file corresponding to any plugin in the model (e.g., pre-process, MLA, or post-process). If this parameter is provided, the project/pipeline will use only the specified plugin (e.g., processcvu for pre and post processes or process
for MLA plugin). The project/pipeline will include simaaisrc as the source and fakesink as the sink.
--input-resource INPUT_RESOURCE
Path to the input resources (e.g., image or video files) for the simaaisrc plugin. The path can include a %d placeholder, which will be replaced by a sequence of numbers, enabling the plugin to process all files matching the pattern in the specified directory.
sima-user@docker-image-id:/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker# mpk create -d . -s .
βΉ Step COMPILE completed successfully.
βΉ Step COPY RESOURCE completed successfully
βΉ Step RPM BUILD completed successfully.
βΉ Successfully created MPK at '/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker/project.mpk'
sima-user@docker-image-id:/usr/local/simaai/app_zoo/Gstreamer/PeopleTracker# ls
application.json build core plugins project.mpk README.md resources
mpk deployο
The mpk deploy
command is used for deploying the application to the MLSoC Developer Board.
This command will install and launch the pipeline application on the MLSoC Developer Board.
The target device can be mentioned either using option -t (ip address) or -d (device name) as shown
below. If you do not specify the target device, then it will be deployed to the last connected device.
sima-user@docker-image-id:/home# mpk deploy -h usage: mpk deploy [-h] [-f FILE] [-t TARGET] [-d DEVICE] [-slot PCIE_SLOT] [--set-default] options: -h, --help show this help message and exit -f FILE, --file FILE mpk file to be deployed to device -t TARGET, --target TARGET fqdn or ip of devkit onto which to deploy mpk -d DEVICE, --device DEVICE device id/tag of devkit onto which to deploy mpk -slot PCIE_SLOT, --slot-number PCIE_SLOT slot number of PCIe devkit onto which to deploy mpk --set-default set the current application as default one so that it runs at board boot sima-user@docker-image-id:/home# mpk deploy -f /usr/local/simaai/app_zoo/Gstreamer/PeopleTracker/project.mpk -t 10.42.0.231 -d my_device π Sending MPK to 10.42.0.231... Transfer Progress for project.mpk: 100.00% π MPK sent successfully! β MPK Deployment is successful for project.mpk
The MPK CLI Engine lets you deploy an application as the default application which runs automatically when the device boots up.
For example, use the --set-default
argument to make PeopleTracker the default pipeline which starts when you boot up the device.
mpk launchο
When deploying an application, the SDK installs the application on the device and automatically
launches it. If an application is then killed, or the device is rebooted and the --set-default
flag
was not used, you can relaunch an application by using the mpk launch
command, without having to redeploy it (reinstall and launch).
Assuming that an application was previously deployed (using mpk deploy
) you can relaunch an
application by:
sima-user@docker-image-id:/home# mpk launch -h usage: mpk launch [-h] [-a APP] [-t TARGET] [-d DEVICE] [-slot PCIE_SLOT] options: -h, --help show this help message and exit -a APP, --application APP name of the previously deployed mpk -t TARGET, --target TARGET fqdn or ip of devkit onto which to deploy mpk -d DEVICE, --device DEVICE device id/tag of devkit onto which to deploy mpk -slot PCIE_SLOT, --slot-number PCIE_SLOT Slot number of the PCIe Soc to upgrade sima-user@docker-image-id:/home# mpk launch -t 10.42.0.231 -d my_device -a com.sima.awesome_app βΉ Launching mpk deployment on 10.42.0.231 with application_name: com.sima.awesome_app. β MPK with id: peopletracker_Pipeline is successfully launched on 10.42.0.231 π
You can check if the pipeline has launched successfully using the mpk list
command.
This command launches the application on the device. Use this command if the application has
already been deployed on the device and has not been removed from the device.
mpk listο
The mpk list
command lists the deployed MPKs.
sima-user@docker-image-id:/home# mpk list Active MPK deployments ββββββββββββββββββββββββββ³ββββββββββββββ³βββββββββββββββββββββββ³ββββββββββββββ³ββββββββββββββββββββββ³βββββββββ β mpk_id β file β application_name β Target β Time β Status β β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ© β peopletracker_Pipeline β project.mpk β com.sima.awesome_app β 10.42.0.231 β 01/02/2024 06:08 PM β active β ββββββββββββββββββββββββββ΄ββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββ βΌ No MPKs deployed for PCIe
mpk killο
The mpk kill
command is used to kill the MPK application on the MLSoC Developer Board, that is,
it stops the application from running on the device. For PCIe mode, use -slot 0
.
sima-user@docker-image-id:/home# mpk kill -h usage: mpk kill [-h] [-i MPK_ID] options: -h, --help show this help message and exit -i MPK_ID, --id MPK_ID id of mpk deployment to be killed. In case an id isn't provided, it will kill the latest active deployment sima-user@docker-image-id:/home# mpk kill -i peopletracker_Pipeline βΉ killing mpk with peopletracker_Pipeline on 10.42.0.231 β MPK with id: peopletracker_Pipeline is successfully killed on 10.42.0.231 π
mpk removeο
The mpk remove
command allows you to remove a previously deployed MPK application.
For PCIe mode, add slot -0
.
sima-user@docker-image-id:/home# mpk remove -h usage: mpk remove [-h] [-a APP] [-t TARGET] [-d DEVICE] [-slot PCIE_SLOT] options: -h, --help show this help message and exit -a APP, --application APP name of the previously deployed mpk -t TARGET, --target TARGET fqdn or ip of devkit onto which to deploy mpk -d DEVICE, --device DEVICE device id/tag of devkit onto which to deploy mpk -slot PCIE_SLOT, --slot-number PCIE_SLOT Slot number of the PCIe Soc to upgrade sima-user@docker-image-id:/home# mpk remove -t 10.42.0.231 -d my_device -a com.sima.awesome_app βΉ Removing mpk deployment on 10.42.0.231 with application_name: com.sima.awesome_app. β Successfully removed mpk deployment with application_name: com.sima.awesome_app and id: peopletracker_Pipeline on target: 10.42.0.231
The mpk remove
command kills the deployed pipeline and removes all application-installed data. To verify that the application was successfully removed, run the command below:
Check for the deployed application using the
mpk list
command.Check that the directory
/usr/local/simaai/*
does not contain any package data for the application that was removed.
mpk firmware-upgradeο
The mpk firmware-upgrade
command lets users wirelessly (Over-the-Air) upgrade
the firmware on the MLSoC devices using the Palette CLI. The upgrade tool updates
the media on which device is booted. Supported boot media are EMMC or SDCard images.
The firmware update process is independent of how the host machine is connected
to the MLSoC board.
sima-user@docker-image-id:/home# mpk firmware-upgrade -h usage: mpk firmware-upgrade [-h] [-f FILE] [-t TARGET] [-slot PCIE_SLOT] [-d DEVICE] [--reboot-on-upgrade] options: -h, --help show this help message and exit -f FILE, --file FILE Software Update file -t TARGET, --target TARGET fqdn or ip of devkit to upgrade -slot PCIE_SLOT, --slot-number PCIE_SLOT Slot number of the PCIe Soc to upgrade -d DEVICE, --device DEVICE device id/tag of devkit to upgrade --reboot-on-upgrade reboot the device on upgrade
Latest SDK installed on the host machine.
Device flashed and booted with the last release or the working build.
Device connected to host over (Ethernet or PCIe). Ensure you are connected to the device by pinging it or SSH into it.
.swu
package for firmware to upgrade on the device.
Copy the
.swu
package to Docker or place it in yourworkspace
directory.sima-user@sima-user-machine:~$ sima-user@sima-user-machine:~$ cd Downloads/MLSoC1.1_Firmware sima-user@sima-user-machine:~/Downloads/MLSoC1.1_Firmware$ cp simaai-image-palette-upgrade-davinci.swu ~/workspace
On the Docker container run
mpk device connect
.sima-user@docker-image-id:/home# mpk device connect -t <BOARD_IP_ADDRESS> -u <USER> -d my_device βΉ Please enter the password for 10.42.0.231 π : βΉ Connecting to sima@10.42.0.231... β Connection established to 10.42.0.231 . sima-user@docker-image-id:/home# mpk device list Active Connections over Ethernet ββββββββββ³βββββββββββββββββ³ββββββββββββββ³βββββββββββ³ββββββββββββ³ββββββββββββββ β Status β Status Details β Target β Username β Device β Jump Server β β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ© β π’ β Online β 10.42.0.231 β sima β my_device β - β ββββββββββ΄βββββββββββββββββ΄ββββββββββββββ΄βββββββββββ΄ββββββββββββ΄ββββββββββββββ β There are no PCIe devices available.
Run the firmware-upgrade command from the CLI:
sima-user@docker-image-id:/home# mpk firmware-upgrade -h usage: mpk firmware-upgrade [-h] [-f FILE] [-t TARGET] [-slot PCIE_SLOT] [-d DEVICE] [--reboot-on-upgrade] options: -h, --help show this help message and exit -f FILE, --file FILE Software Update file -t TARGET, --target TARGET fqdn or ip of devkit to upgrade -slot PCIE_SLOT, --slot-number PCIE_SLOT Slot number of the PCIe Soc to upgrade -d DEVICE, --device DEVICE device id/tag of devkit to upgrade --reboot-on-upgrade reboot the device on upgrade sima-user@docker-image-id:/home# mpk firmware-upgrade -f /home/docker/sima-cli/simaai-image-palette-upgrade-davinci.swu -d my_device Sending software upgrade file to 10.42.0.231... Transfer Progress for simaai-image-palette-upgrade-davinci.swu: 100.00% β Extracting details from the upgrade file, please wait... β Extracted details from the upgrade file. π Upgrading 10.42.0.231 from 1.4.0_master_B1230 to 1.5.0_master_B1417, please wait... β Device Upgraded! ββββββββββββββββ Installing update.sh... ββββββββββββββββ 100% 0:00:00 Installing simaai-image-palette-davinci.ext4.gz... ββββββββββββββββ 100% 0:00:00 Installing u-boot.bin... ββββββββββββββββ 100% 0:00:00 Installing Image... ββββββββββββββββ 100% 0:00:00 Installing davinci-combo-board.dtb... ββββββββββββββββ 100% 0:00:00 Installing davinci-dual-m2.dtb... ββββββββββββββββ 100% 0:00:00 Installing davinci-hhhl.dtb... ββββββββββββββββ 100% 0:00:00 Installing boot.scr.uimg... ββββββββββββββββ 100% 0:00:00 Installing update.sh... ββββββββββββββββ 100% 0:00:00 β Successfully upgraded 10.42.0.231 to 1.5.0_master_B1417 β Reboot the device? [y/n]: y βΉ Rebooting 10.42.0.231, please wait βΉ 10.42.0.231 is rebooted. Waiting for device to come back online... βββββββββββββββββββββββββ 100% 0:00:00 βΉ Device is back online β Sevices started. ββββββββββββββββββββββββββββββββββββββββ 100% 0:00:00 βΉ Verifying build details on the board, thank you for your patience... β Device 10.42.0.231 was successfully upgraded to 1.5.0_master_B1417! βΉ You can continue to use the device now.
Verify that the device was successfully upgraded to the latest build version by running:
cat /etc/build
.sima-user@docker-image-id:/home# ssh sima@<BOARD_IP_ADDRESS> The authenticity of host '10.42.0.231 (10.42.0.231)' can't be established. ED25519 key fingerprint is SHA256:mTD8tqYTR/NrmVcE0pyMaVGYXpbkgJ4iJppskpDL3yM. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '10.42.0.231' (ED25519) to the list of known hosts. sima@10.42.0.231's password: davinci:~$ cat /etc/build ----------------------- Build Configuration: | ----------------------- DISTRO = poky DISTRO_VERSION = 4.0.23 MACHINE = davinci DATE = 20241214 TIME = 181909 SIMA_BUILD_VERSION = 1.5.0_master_B1417 ----------------------- Layer Revisions: | ----------------------- meta = kirkstone:8e092852b63e998d990b8f8e1aa91297dec4430f meta-poky = kirkstone:8e092852b63e998d990b8f8e1aa91297dec4430f meta-yocto-bsp = kirkstone:8e092852b63e998d990b8f8e1aa91297dec4430f meta-simaai = master:ea4335caeffa48bd9347f53b743aa00262353dd8 -- modified meta-oe = kirkstone:4ad41baed6236d499804cbfc4f174042d84fce97 meta-python = kirkstone:4ad41baed6236d499804cbfc4f174042d84fce97 meta-networking = kirkstone:4ad41baed6236d499804cbfc4f174042d84fce97 meta-swupdate = kirkstone:6918be849ddf1fed5b7a0173e51c7a136e8d4101
Performance Estimatorο
The Performance Estimator (PE) is a utility in the Palette software that lets you start and stop the performance analysis of your GStreamer pipelines by using the command, mpk pe
.
The Performance Estimator will generate .json files in /tmp/PerformanceEstimator_*
. It also starts the local server with the current Performance Estimator content and the
user can visualize data in their browser.
Note
The Performance Estimator tool only reports Tracer data from plugins.
Performance Estimator and Dynamic KPI collection are only functional when the MPK is created using the
mpk create --gst-app
option and then deployed.Please ensure you create the MPK with this option, deploy it, and then run mpk pe start. For example,
mpk create -s . -d . --gst-app
Follow the commands described below when using the Performance Estimator.
mpk pe -h
lists the supported commands as shown below.sima-user@docker-image-id:/home$ mpk pe -h usage: mpk pe [-h] {start,stop} ... Performance Estimator Note: Performance Estimator and Dynamic KPI collection are only functional when the MPK is created using the mpk create --gst-app option and then deployed. Please ensure you create the MPK with this option, deploy it, and then run mpk pe start. options: -h, --help show this help message and exit sub-commands: {start,stop} start Start Performance Estimator in dynamic or static mode. stop Stop Performance Estimator. usage: mpk pe --help
mpk pe start
is used to start performance analysis of the pipeline running on the MLSoC Developer Board. Before executingmpk pe start
, make sure the pipeline is running on the MLSoC board.sima-user@docker-image-id:/home# mpk pe start -h usage: mpk pe start [-h] [-f FILE] [-i ID] [--period PERIOD] [-t TARGET] [-d DEVICE] [--count COUNT] options: -h, --help show this help message and exit -f FILE, --file FILE mpk file to be deployed to device. -i ID, --id ID id of the deployed pipeline. --period PERIOD period of time to collect the kpis. -t TARGET, --target TARGET IP address/FQDN of the device. -d DEVICE, --device DEVICE Name of the device. --count COUNT Number of Collated Json files to be collected for the period. sima-user@docker-image-id:/home# mpk list Active MPK deployments βββββββββββββββββββ³ββββββββββββββ³βββββββββββββββββββββββ³ββββββββββββββββββ³ββββββββββββββββββββββ³βββββββββ β mpk_id β file β application_name β Target β Time β Status β β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ© β yolov7_Pipeline β project.mpk β com.sima.awesome_app β 192.168.135.242 β 05/08/2024 02:35 AM β active β βββββββββββββββββββ΄ββββββββββββββ΄βββββββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββββββ΄βββββββββ βΌ No MPKs deployed for PCIe sima-user@docker-image-id:/home# mpk pe start -i yolov7_Pipeline -t 192.168.135.242 --count 35 βΉ Starting Dynamic Performance Estimator for pipeline: yolov7_Pipeline on device: 192.168.135.242. π Dynamic Performance estimator can be accessed at: http://localhost/getDynamicKPI?directoryPath=/tmp/PerformanceEstimator_b61cfced72d943cebce4f1dae917801c sima-user@docker-image-id:/home#
mpk pe stop
is used to stop performance analysis of a pipeline running on the MLSoC Developer Board.sima-user@docker-image-id:/home# mpk pe stop -h usage: mpk pe stop [-h] [-f FILE] [-i ID] [-t TARGET] [-d DEVICE] options: -h, --help show this help message and exit -f FILE, --file FILE mpk file to be deployed to device. -i ID, --id ID id of the deployed pipeline. -t TARGET, --target TARGET IP address/FQDN of the device. -d DEVICE, --device DEVICE Name of the device. sima-user@docker-image-id:/home# mpk pe stop -i yolov7_Pipeline -t 192.168.135.242 β Stopped Performance estimator for yolov7_Pipeline on 192.168.135.242. sima-user@docker-image-id:/home#
To interpret data open a .json file from
/tmp/PerformanceEstimator_*
in your editor. You can view data for each frame for all three processing units (CVU, APU and MLA) and the plugins that are executed to compute on that processing unit.sima-user@docker-image-id:/tmp/PerformanceEstimator_b61cfced72d943cebce4f1dae917801c$ ls -ltr total 13364 -rw-r--r-- 1 sima-user sima-user 312967 Aug 5 02:36 yolov7_Pipeline_1722843378.json -rw-r--r-- 1 sima-user sima-user 391186 Aug 5 02:36 yolov7_Pipeline_1722843383.json sima-user@docker-image-id:/tmp/PerformanceEstimator_b61cfced72d943cebce4f1dae917801c$ cat yolov7_Pipeline_1722843378.json | head -n200 { "pipeline_id":"yolov7_Pipeline", "timestamp":"2024-08-05T07:36:17Z", "num_frames":80, "period":5, "data":[ { "frame_id":1207, "pipeline_id":"yolov7_Pipeline", "plugins":[ { "frame_id":1207, "kpis":{ "dma_BW":{ ... ... "frame_id":1208, "pipeline_id":"yolov7_Pipeline", "plugins":[ {
To visualize performance data in a browser, click the link which was generated when the
mpk pe start
command executed successfully. See the output in the browser as shown below. To further analyze data, zoom in or put your cursor on the specific processing unit data as shown in screenshots below.mpk pe model
command can be used to generate KPIs directly from the given model.tar.gz file and the input image. The command streamlines the process of creating a project, running necessary operations, and collecting KPI data.The command
mpk pe model
executes the following operations in a sequence:mpk project create
with the provided model.tar.gz and input image.mpk create
to be run on the project created in the previous step.mpk deploy
to deploy the mpk to the default device.mpk pe
to start collecting the dynamic KPIs for the default interval of time.Collect the JSON output and print a message instructing the user to check the hyperlink for the KPI data.
Connect to the device where the model needs to be run. The model is deployed on the last connected device.
sima-user@docker-image-id:/home$ mpk device connect -t sima@192.168.135.97 βΉ Please enter the password for 192.168.135.97 π : βΉ Connecting to sima@192.168.135.97... β Connection established to 192.168.135.97 .
See example code below.
sima-user@docker-image-id:/home/docker/sima-cli/models_files/new$ mpk pe model --model-path alexnet.tar.gz --input-resource /home/docker/sima-cli/scratch/test-gst-automation/img/image1.rgb β³ Starting the project creation process for the model: alexnet.tar.gz... β Step 1: Project created successfully for the model: alexnet.tar.gz. β³ Starting the mpk creation process for the mini pipeline associated with model: alexnet.tar.gz... β Step 2: MPK created successfully at /home/docker/sima-cli/models_files/new. β³ Starting the mpk deploy process for the mini pipeline associated with model: alexnet.tar.gz... β Step 3: MPK deploy command executed successfully. β³ Starting the collection of dynamic KPIs for the mini pipeline associated with the model: alexnet.tar.gz... β βΉ Starting Dynamic Performance Estimator for pipeline: alexnet_Pipeline on device: 192.168.135.97. π Dynamic Performance estimator can be accessed at: http://localhost:49152/getDynamicKPI?directoryPath=/tmp/PerformanceEstimator_ad947fd09c5e4439a7520c26b8fc60ab Step 4: Successfully launched the Performance Estimator.