Skip to content

[Bug/Missing Feature] Ryzen AI on Linux x86_64: Vitis AI EP fails to offload to NPU (Missing voe module & Config parser crash) #341

@honghonghao-wq

Description

@honghonghao-wq

Description:

Hello AMD / ONNX Runtime team,

I have been extensively testing the Vitis AI Execution Provider (ONNX Runtime 1.20.1) on an x86_64 Linux system equipped with an AMD Ryzen AI NPU (Device 1022:17f0). While the underlying hardware and amdxdna drivers are functioning perfectly, there are severe blocking issues in the Linux software stack that prevent any operators from being offloaded to the NPU.

After writing a custom C++ Pybind11 wrapper to bypass standard Python ABI segfaults, I managed to get the entire pipeline running. However, 100% of operators are falling back to the CPU.

Through deep-dive debugging, I have isolated the root causes to missing graph optimization wheels (voe) and a memory/pointer bug in the config parser.

Here is the detailed breakdown:

  1. Environment
    OS: Linux x86_64 (Ubuntu)

Hardware: AMD Ryzen AI NPU (Device 1022:17f0)

Driver: amdxdna successfully loaded (/dev/accel/accel0 accessible)

ONNX Runtime: 1.20.1 (Custom compiled with Vitis AI EP)

Model: AMD Quantized INT8 Models (QDQ format)

  1. The Achievements (Hardware/Core C++ is working)
    The pre-compiled CVML Python wheel (onnxruntime_pybind11_state.so) has fatal C++11 ABI incompatibilities on Linux, causing immediate Segfaults (KernelDefBuilder__SinceVersion).
    To isolate the issue, I wrote a custom zero-copy C++ Pybind11 bridge. With this custom framework, I successfully initialized the VitisAIExecutionProvider and ran inference without any crashes. The C++ core library libonnxruntime_providers_vitisai.so is healthy.

  2. Core Issue 1: All Operators Fallback to CPU
    Despite the EP initializing successfully, the output logs show:
    [Vitis AI EP] No. of Operators : CPU 30
    Zero operators are offloaded to the NPU.

  3. Core Issue 2: Missing voe.passes Module for Linux x86_64
    To correctly partition the graph for the XIR compiler, official Windows examples rely on the Vitis ONNX Execution graph optimization passes (voe / voe.passes).
    However, the voe Python wheel is entirely missing from Linux x86_64 distributions. Without this module, the ONNX graph cannot be optimized for the NPU, resulting in the inevitable CPU fallback. ModuleNotFoundError: No module named 'voe' is consistently thrown when trying to follow official optimization scripts.

  4. Core Issue 3: Fatal Crash in C++ Config Parser
    When attempting to pass the compiler configuration via provider_options in my C++ session:

C++
Ort::SessionOptions session_options;
std::unordered_map<std::string, std::string> options;
options["config_file"] = "/path/to/vaip_config.json";
// Append VitisAI EP...
The Vitis AI EP crashes internally with the following error:
check failure: s.IsOK()open file "/tmp/<random_garbled_chars>" failed
This strongly indicates an uninitialized pointer, memory leak, or string parsing bug inside the Vitis AI EP's C++ config parser on Linux when trying to generate cache directories or parse the JSON.

  1. Questions for the Dev Team
    This looks like an incomplete Linux x86_64 release. To help the community utilize Ryzen AI on Linux:

When will the voe (Vitis ONNX Execution) Python .whl be officially published for x86_64 Linux?

Is the team aware of the /tmp/ path corruption bug when parsing vaip_config.json via provider_options on Linux? 3. Can you provide a working vaip_config.json template and the corresponding .xclbin for Phoenix/Hawk Point (1x4 / 4x4) NPUs on Linux?

Thank you for your time. The NPU hardware is fantastic, and I look forward to the Linux software stack catching up to fully utilize it!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions