C# OpenVino EP broken: OrtSessionOptionsAppendExecutionProvider_OpenVINO not exported in onnxruntime.dll #7951
Description
Describe the bug
SessionOptions.AppendExecutionProvider_OpenVINO() fails
Urgency
Urgent: blocked from using onnx runtime in our application
System information
Edition Windows 10 Pro
Version 20H2
Installed on 3/2/2021
OS build 19042.985
- ONNX Runtime installed from : Source
- ONNX Runtime version:
- Python version: 3.8
- Visual Studio version (if applicable): 2019
- CUDA/cuDNN version:
- GPU model and memory: nVidia GTX 1080ti
To Reproduce
Build OpenVino as per instructions on Windows:
.\build.bat --config RelWithDebInfo --use_openvino CPU_FP32 --cmake_generator "Visual Studio 16 2019" --build_shared_lib --build_nuget
Dll's build but automated test fails:
[Begin excerpt from build output]
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:08.69] Microsoft.ML.OnnxRuntime.Tests.InferenceTest.TestGpu [SKIP]
Skipped Microsoft.ML.OnnxRuntime.Tests.InferenceTest.TestGpu [1 ms]
Failed Microsoft.ML.OnnxRuntime.Tests.InferenceTest.TestSessionOptions [6 ms]
Error Message:
System.EntryPointNotFoundException : Unable to find an entry point named 'OrtSessionOptionsAppendExecutionProvider_OpenVINO' in DLL 'onnxruntime'.
Stack Trace:
at Microsoft.ML.OnnxRuntime.NativeMethods.OrtSessionOptionsAppendExecutionProvider_OpenVINO(IntPtr options, IntPtr device_id)
at Microsoft.ML.OnnxRuntime.SessionOptions.AppendExecutionProvider_OpenVINO(String deviceId) in D:\Local\OnnxVersions\20210603\onnxruntime\csharp\src\Microsoft.ML.OnnxRuntime\SessionOptions.cs:line 195
at Microsoft.ML.OnnxRuntime.Tests.InferenceTest.TestSessionOptions() in D:\Local\OnnxVersions\20210603\onnxruntime\csharp\test\Microsoft.ML.OnnxRuntime.Tests\InferenceTest.cs:line 116
Failed Microsoft.ML.OnnxRuntime.Tests.InferenceTest.VerifyNativeMethodsExist [2 ms]
Error Message:
Entrypoint OrtSessionOptionsAppendExecutionProvider_OpenVINO not found in module onnxruntime.dll
Expected: False
Actual: True
Stack Trace:
at Microsoft.ML.OnnxRuntime.Tests.InferenceTest.VerifyNativeMethodsExist() in D:\Local\OnnxVersions\20210603\onnxruntime\csharp\test\Microsoft.ML.OnnxRuntime.Tests\InferenceTest.cs:line 2438
Failed! - Failed: 2, Passed: 206, Skipped: 1, Total: 209, Duration: 11 s - Microsoft.ML.OnnxRuntime.Tests.dll (netcoreapp2.1)
Another way to reproduce the same error is to create a c# .net framework console application with the following lines:
SessionOptions ops = new SessionOptions(); ops.AppendExecutionProvider_OpenVINO(openVinoDeviceId);
This will trigger an EntryPointNotFoundException:
"Unable to find an entry point named 'OrtSessionOptionsAppendExecutionProvider_OpenVINO' in DLL 'onnxruntime'."
Inspecting the built onnxruntime.dll with Dependencies.exe reveals the entry point "OrtSessionOptionsAppendExecutionProvider_OpenVINO" is absent: