In order to run the commands in this section, the driver and runtime installation must be completed. You can
review the Installation section for the installation steps.
Command Line Tools
The following helper tools are installed together with the DX-RT runtime.Querying the Device Status
The--status option is used to display the instantaneous temperature, voltage and clock frequency values
of the module.
--info option is used to display the hardware and version information of the module.
dxrt-cli tool are listed in the table below.
For example, you can use the command below to monitor the device status at 1 second intervals.
Monitoring the NPU Utilization
You can use thedxtop tool to observe how busy the NPU cores are while your application is running.
q key is enough to exit the application.
Downloading Pre-compiled Models
The NPU can only run models compiled into the.dxnn format. You do not need to compile your own model in
order to try the examples in this section; more than three hundred pre-compiled models are provided in the
DEEPX model repository (Model Zoo).
Downloading Models
Thesetup.sh script in the DX-APP repository is used to access the entire model repository and to download
models by category. The script places the downloaded files into the assets/models directory.
The file names of some frequently used models are listed in the table below.
When the script is run without any option, the category and model selection is made through a menu. The list
of available models is kept in the
scripts/modelzoo_manifest.json file.Measuring Model Performance
Therun_model tool is used to measure the real performance of a compiled model on the board.
required
The path of the
.dxnn model file to be measured.Measures in maximum throughput mode. It is the default operating mode.
Measures on a single core, sequentially with a single input.
default:"30"
The number of inference loops to be performed.
The duration of the measurement in seconds. When specified, it overrides the
--loops value.default:"0"
The number of warm-up rounds to be performed before starting the measurement.
Displays the NPU processing time and latency values in detail.
Running Inference with Python
TheInferenceEngine class in the dx_engine package is used to make use of the NPU in Python applications.
The basic flow consists of the steps of loading the model, preparing the input buffer, running the inference
and processing the results.
Getting Model Information
The information about the input and output layers can be queried from the runtime so that the pre-processing and post-processing steps can be written correctly.Asynchronous Inference
In applications that process continuous data such as a video stream, sending a new frame without waiting for the result of the inference increases the performance. Therun_async method is used for this purpose. The
method returns a job id without waiting for the inference to complete.
There are two methods for collecting the results. The results can be delivered automatically by registering a
callback function, or the result can be requested by using the wait method with the job id.
Since the callback function is executed in a separate thread, a lock must be used when accessing shared data
structures.
Performance Measurement and Device Monitoring
The inference performance can be measured with therun_benchmark method, and the device status can be read
from within the application with the DeviceStatus class.
C/C++ API
In addition to the Python interface, DX-RT also provides a C and C++ interface. On the C++ side the same workflow is performed with thedxrt::InferenceEngine class.

