Application Development#

This page captures requirements and recommendations for developers looking to create, package and distribute applications targeting NPU-enabled AMD processors.

Application Development Requirements#

ONNX-RT Session#

The application should only use the Vitis AI Execution Provider if the following conditions are met:

📝 NOTE: Sample C++ code implementing the compatibility checks to be performed before using the VitisAI EP is provided here: amd/RyzenAI-SW

The application is responsible for setting the NPU configuration (set the XLNX_VART_FIRMWARE environment variable) correctly according to the APU type.

The application should use the Vitis AI EP with the corresponding configuration file (vaip_config.json) taken from the same Ryzen AI Software release package. The Vitis AI EP should not be used with a configuration file coming from a different version of the Ryzen AI Software.

Cache Management#

Cache directories generated by the Vitis AI Execution Provider should not be reused across different versions of the Vitis AI EP or across different version of the NPU drivers.

The application should check the version of the Vitis AI EP and of the NPU drivers. If the application detects a version change, it should delete the cache, or create a new cache directory with a different name.


Application Packaging Requirements#

A C++ application built on the Ryzen AI ONNX Runtime requires the following components to be included in its distribution package:

  • Runtime DLLs (located inside %RYZEN_AI_INSTALLATION_PATH%/onnxruntime/bin):

    • onnxruntime.dll

    • onnxruntime_providers_shared.dll

    • onnxruntime_providers_vitisai.dll

    • onnxruntime_vitisai_ep.dll

    • DirectML.dll

  • NPU Binary files (XCLBIN) to be used with the XLNX_VART_FIRMWARE environment variable.

  • Vitis AI Execution Provider Configuration File: vaip_config.json

The following components can be optionally included in the distribution package:

  • Vitis AI Execution Provider cache folder: containing pre-compiled models