Debugging VART Based Apps#

Navigation: ← CPP VART Examples · Tensor Format Conversions →

The VART interface and x_plus_ml type apps offer extensive debugging features to help you identify and resolve errors. You can enable or disable debugging with command-line options or environment variables at different levels of the framework, giving flexible and controlled debugging.

Each of the following mechanisms uses its own log-level scale. The application --log-level, the VART-X/VVAS numeric debug variables, and the VART-ML named levels are independent of one another, so a value such as 5 or DEBUG only has meaning within the mechanism that defines it.

Command Line Debugging in x_plus_ml Type Apps#

Activate or deactivate application-level debugging with the --log-level command-line option for x_plus_ml apps at runtime. This provides granular control of log levels for specific application runs. Each level includes logs at that level and all lower levels.

The available log levels are:

  1. ERROR

  2. WARNING

  3. INFERENCE RESULT

  4. FIXME

  5. INFO

  6. DEBUG

Example command with log level 6 (DEBUG and below):

$ x_plus_ml_ort --input-file <path_to_test_jpeg_image> --app-config <path to json config> --log-level 6
$ x_plus_ml_vart --input-file <path_to_test_jpeg_image> --app-config <path to json config> --log-level 6
$ spatial_mt_ml_ort --input-file <path_to_jpeg_image> --app-config <path to json config> --log-level 6

Framework-Level Debugging with VART-X, VART-ML, and VVAS CORE#

For more detailed debugging of framework-level processes, enable logs within the VART-X, VART-ML, and VVAS CORE interfaces. This is useful for understanding internal flow and pinpointing deeper issues.

Enabling VART-X Logs#

Set the following environment variables before launching a VART-X application:

$ export VART_LOG_FILE_PATH=CONSOLE
$ export VART_CORE_DEBUG_ENV=5

This displays VART-X logs on the console at DEBUG level.

Enabling VART-ML Logs#

For VART-ML applications, set VART_LOG_LEVEL before launch:

$ export VART_LOG_LEVEL=DEBUG

Supported values are ERROR, WARNING, INFO, and DEBUG. VART-ML logs are written to the console; there is no separate file-redirect variable for VART-ML.

Alternatively, for the x_plus_ml_vart application you can set the runner log level in its JSON config by editing inference-config.runner-options.log-level (same values as previously listed). See the Inference Configuration JSON Guide for more info.

Note

VART_LOG_LEVEL is an environment variable and takes precedence over the runner log_level option set in code or in a JSON config (such as inference-config.runner-options.log-level).

Enabling VVAS CORE Logs#

To enable logs for the VVAS CORE framework, set these environment variables:

$ export VVAS_CORE_LOG_FILE_PATH=CONSOLE
$ export VVAS_CORE_DEBUG=4 # 4 is for INFO level verbosity

Adjust the VVAS_CORE_DEBUG level to control verbosity:

  1. NONE

  2. ERROR

  3. WARNING

  4. FIXME

  5. INFO

  6. DEBUG

Logs print on the console and offer detailed insights into the VVAS CORE framework.

Redirecting VART-X and VVAS CORE Logs to a File#

Besides displaying logs on the console, you can redirect VART-X and VVAS CORE logs to a file for easier analysis and persistent logging. Set the environment variable for the framework you are using to a file path. (VART-ML logs are console-only and cannot be redirected this way.)

To save VART-X logs to a file, set VART_LOG_FILE_PATH:

$ export VART_LOG_FILE_PATH=/tmp/vart_logs.txt
$ export VART_CORE_DEBUG_ENV=5

This configuration writes all VART-X logs at the specified log level (and below) to /tmp/vart_logs.txt.

To save VVAS CORE logs to a file, set VVAS_CORE_LOG_FILE_PATH:

$ export VVAS_CORE_LOG_FILE_PATH=/tmp/vvas_core_logs.txt
$ export VVAS_CORE_DEBUG=5

Use these features to effectively debug and optimize your applications with the VART interface.

Capturing Logs from AMD Vitis™ AI Execution Provider#

To capture logs from the AMD Vitis™ AI Execution Provider, set the logging level in vitisai_config.json.

Example vitisai_config Json:

{
  "passes": [
    {
      "name": "init",
      "plugin": "vaip-pass_init"
    },
    {
      "name": "vaiml_partition",
      "plugin": "vaip-pass_vaiml_partition",
      "vaiml_config": {
        "device": "ve2-xc2ve3858",
        "optimize_level": 2,
        "logging_level": "info",
        "threshold_gops_percent": 20
      }
    }
  ]
}

logging_level

  • Type: String

  • Supported values: “info”, “error”, “warning”

  • Default: “error”

Vitis AI Logging Level#

  • Info: Provides details about significant events or actions, including additional comparative information between options.

  • Warning: Indicates recoverable issues have occurred, with possible additional warnings highlighting differences between options.

  • Error: Reports critical failures that prevent program continuation; limited error details are displayed.

vitisai_config.json can be used for ml_ort, x_plus_ml_ort, and spatial_mt_ml_ort.

Navigation: ← CPP VART Examples · Tensor Format Conversions →