Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access violation when appending OpenVINO execution provider #23478

Open
deischi opened this issue Jan 24, 2025 · 0 comments
Open

access violation when appending OpenVINO execution provider #23478

deischi opened this issue Jan 24, 2025 · 0 comments
Labels
ep:DML issues related to the DirectML execution provider ep:OpenVINO issues related to OpenVINO execution provider

Comments

@deischi
Copy link

deischi commented Jan 24, 2025

Describe the issue

onnxruntime crashes in openvino_npu_plugin.dll when addingthe OpenVINO execution provider for CPU:

		std::unordered_map<std::string, std::string> options;
		options["device_type"] = "CPU";
		options["precision"] = "FP32";
		ortSessionOptions.AppendExecutionProvider("OpenVINO", options);

Callstack:

 	00007ffd287f29c0()	Unknown	No symbols loaded.
 	openvino_intel_npu_plugin.dll!00007ffd28e2ac5d()	Unknown	No symbols loaded.
 	openvino_intel_npu_plugin.dll!00007ffd28df8cfc()	Unknown	No symbols loaded.
 	openvino_intel_npu_plugin.dll!00007ffd28ccd9b8()	Unknown	No symbols loaded.
 	openvino_intel_npu_plugin.dll!00007ffd28cb5b42()	Unknown	No symbols loaded.
 	openvino_intel_npu_plugin.dll!00007ffd28ccc7a0()	Unknown	No symbols loaded.
 	openvino.dll!00007ffd377e1d18()	Unknown	No symbols loaded.
 	openvino.dll!00007ffd377e31f6()	Unknown	No symbols loaded.
 	openvino.dll!00007ffd377df3b3()	Unknown	No symbols loaded.
 	openvino.dll!00007ffd377c6511()	Unknown	No symbols loaded.
 	onnxruntime_providers_openvino.dll!onnxruntime::OVDevices::get_ov_devices() Line 22	C++	Symbols loaded.
 	onnxruntime_providers_openvino.dll!onnxruntime::OpenVINO_Provider::CreateExecutionProviderFactory(const void * void_params) Line 141	C++	Symbols loaded.
 	onnxruntime.dll!onnxruntime::OpenVINOProviderFactoryCreator::Create(const std::unordered_map<std::string,std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::pair<std::string const ,std::string>>> * provider_options_map, const onnxruntime::SessionOptions * session_options) Line 1830	C++	Symbols loaded.
 	onnxruntime.dll!OrtApis::SessionOptionsAppendExecutionProvider(OrtSessionOptions * options, const char * provider_name, const char * const * provider_options_keys, const char * const * provider_options_values, unsigned __int64 num_keys) Line 111	C++	Symbols loaded.

To reproduce

Immediately crashed when adding the execution provider (see above).

onnxruntime build command:
build.bat --build --update --parallel --compile_no_warning_as_error --config RelWithDebInfo --use_openvino CPU --use_dml --build_shared_lib --skip_tests --cmake_extra_defines CMAKE_INSTALL_PREFIX=c:\dev\ort_1.20.1-install

As a workaround, I tried to remove the openvino_intel_npu_plugin.dll.
appending the execution provider is working, but creating the session later fails with this exception:

Exception during initialization: Exception from src\inference\src\cpp\core.cpp:265:
Exception from src\inference\src\dev\core_impl.cpp:567:
Device with "NPU" name is not registered in the OpenVINO Runtime

Also onnxruntime_perf_test.exe failes for OpenVINO - just without any error message.

C:\dev\onnxruntime-1.20.1\build\Windows\RelWithDebInfo\RelWithDebInfo>\dev\w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64\setupvars.batPython 3.12.8
[setupvars.bat] OpenVINO environment initialized

fine for CPU:

C:\dev\onnxruntime-1.20.1\build\Windows\RelWithDebInfo\RelWithDebInfo>onnxruntime_perf_test.exe -m times -r 1 -I testdata\test_resize.onnx
Session creation time cost: 0.008206 s
First inference time cost: 0 ms
Total inference time cost: 5.77e-05 s
...

fine for DML:

C:\dev\onnxruntime-1.20.1\build\Windows\RelWithDebInfo\RelWithDebInfo>onnxruntime_perf_test.exe -e dml -m times -r 1 -I testdata\test_resize.onnx
Session creation time cost: 0.33271 s
First inference time cost: 47 ms
Total inference time cost: 0.0004038 s
Total inference requests: 1
...

no output for openvino:

C:\dev\onnxruntime-1.20.1\build\Windows\RelWithDebInfo\RelWithDebInfo>onnxruntime_perf_test.exe -e openvino -m times -r 1 -I testdata\test_resize.onnx

There is a similar issue openvinotoolkit/openvino#26567, but this should have been fixed with OpenVINO 2024.5

Urgency

No response

Platform

Windows

OS Version

Windows 10, 22H2

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.20.1

ONNX Runtime API

C++

Architecture

X64

Execution Provider

OpenVINO

Execution Provider Library Version

openvino 2024.5

@github-actions github-actions bot added ep:DML issues related to the DirectML execution provider ep:OpenVINO issues related to OpenVINO execution provider labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:DML issues related to the DirectML execution provider ep:OpenVINO issues related to OpenVINO execution provider
Projects
None yet
Development

No branches or pull requests

1 participant