Skip to content

OGA LLM example crashes during OgaModel::Create() on Ryzen AI with both NPU and Hybrid Models #332

@bmhydar

Description

@bmhydar

The LLM-examples/oga_api (https://github.com/amd/RyzenAI-SW/tree/main/LLM-examples/oga_api) consistently crashes during model loading on a Ryzen AI MAX (Strix Halo) system when using RyzenAI 1.7.0.

The process terminates during OgaModel::Create() with a Windows native exception 0xC0000409 (stack buffer overrun), before Model loaded. is printed. No C++ exception is thrown.

This occurs with multiple AMD-packaged LLaMA-2 model variants, suggesting a platform/runtime issue rather than a model-specific problem.

Environment-
CPU: AMD Ryzen AI MAX PRO 390 (Strix Halo)
GPU: Radeon 8050S
OS: Windows 11 Pro (10.0.26100)
RyzenAI Version: 1.7.0
Toolchain: Visual Studio 2022 (MSVC 19.44), CMake (VS 2022 generator)

Models Tested
Both of the following crash in the same way:
Hybrid model (awq / hybrid package)
Ryzen AI MAX / Strix NPU model (*_jit.onnx with rai_config.json)

Model directories contain:
.onnx + .onnx.data
genai_config.json
tokenizer files (tokenizer.json, tokenizer.model, etc.)

Steps to Reproduce
cd LLM-examples\oga_api
mkdir build
cd build
cmake .. -A x64
cmake --build

.\bin\Release\example.exe -m "<path_to_model_dir>"

Observed Behavior
Initializing ORT GenAI...
Loading Model from: <model_path>

Process exits immediately.

Expected Behavior
Based on the example source and README:

Model loaded.
Creating Tokenizer...
Creating Generator...
Enter prompt: Insert whatever you want here.

Notes / Question
The executable contains the expected strings ("Model loaded.", tokenizer/generator code), confirming it is built from the interactive example.
Adding RyzenAI runtime paths explicitly does not change behavior.
Older RyzenAI installers correctly report “Unknown platform” on this system, so platform detection itself is working.
We previously tested with NPU 1.6_305, but the latest update is for NPU 1.5_280, why was this reverted?

Image

Metadata

Metadata

Assignees

No one assigned

    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