-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Issue finding onnxruntime dll #15375
Comments
I found a similar issue reported earlier and saw some solutions posted by users: #9260. Were you able to try those out? Let me know if any of those worked for you. |
Hey Thanks for pointing it out. However, I don't think this is the same issue. In our case, it works pretty much every (hundreds of installations on Windows 10 without any issue). But somehow, on that particular system it does not work (same build of the software using the same installer and everything). I will try the solution that was provided in that thread but I doubt it will change anything. It will take a while till I know for sure as I have to indirectly troubleshoot it as I can not reproduce the problem (it's a user that reported the issue on his machine). Oli |
Unfortunately, the suggested solution did not change anything. I found this statement on the ONNX project page regarding en_US.UTF-8. Is this relevant for Windows 10? How can I check whether that is correctly installed. Regarding the other dependency (Visual C++ 2019 runtime) we already provide that with our software so that should be good. |
Do all the Win10 have the same OS version? You can run "winver" command to check. |
@oliver-bernhardt would you please share with us the logs you're seeing for the dlls being loaded. You will need to put your program into a debugger to get those logs. Please see @snnn's comment for an example on how to do this. |
I faced same problem for net472 and problem was that onnxruntime.dll wasn't copied to output. To fix this I had to specify runtime identifier explicitly like this in exe csproj:
|
Hello, seeing similar exception in the released v1.15.0 https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime/1.15.0 System.TypeInitializationException: The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'onnxruntime' or one of its dependencies: The specified procedure could not be found. (0x8007007F) No such error previously when using older version; even a v1.15.0-dev version is working fine. |
Check how many Check this. |
@jamesd-ms can you provide a minimal sln and csproj that repros the issue? AFAIK nothing changed in the structure of the native nuget package recently that would change where it looks for onnxruntime.dll. For most .net targets I would expect it's using the netstandard2.0 (lowest common denominator for the ORT native package) props. e.g. for x64 that would mean linking onnxruntime.dll from runtimes\win-x64\native in the nuget package. ![]() |
@jamesd-ms which dev build of the package was working? can diff that vs. the release to see what changed |
### Description <!-- Describe your changes. --> SetThreadDescription isn't available in an Azure App Service sandbox. #15219 removed a check that it was available, making it a hard dependency. When it's not available the dll load fails with a 'procedure not found' error. Add back the check. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> #15375 - although note this has nothing to do with the original issue. This is just for #15375 (comment)
### Description <!-- Describe your changes. --> SetThreadDescription isn't available in an Azure App Service sandbox. #15219 removed a check that it was available, making it a hard dependency. When it's not available the dll load fails with a 'procedure not found' error. Add back the check. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> #15375 - although note this has nothing to do with the original issue. This is just for #15375 (comment)
In ONNX Runtime 1.15.1 release we fixed an issue that could cause such problems in some Sandbox environments, however, the fix was not for the original issue reported here. |
ONNX Runtime 1.15.1 is published. |
After compiling a program that uses onnxruntime, it runs fine on my local machine and also runs smoothly in common runtime environments. However, when I installed Windows 10 or Windows 11, the program failed to run. To resolve this, I installed some toolkits for vs2022 in the new system environment, and now the program runs properly. The toolkits I installed for your reference include: Microsoft Visual C++ Redistributable Finally, I determined that the missing tool in the new operating system is the .NET Profiler. |
Describe the issue
Hi
We are facing an issue with onnxruntime in our C# application. Usually, everything works just fine on any type of Windows 10 x64 platform. However for some reason (that is not clear to me) we get this exception
The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception.
System.EntryPointNotFoundException: Unable to find an entry point named 'OrtGetApiBase' in DLL 'onnxruntime'.
on this system:
Edition Windows 10 Enterprise LTSC
Version 21H2
Installed on 24/03/2023
OS build 19044.2728
Experience Windows Feature Experience Pack 120.2212.4190.0
Processor Intel(R) Xeon(R) W-2295 CPU @ 3.00GHz 3.00 GHz
Installed RAM 128 GB (128 GB usable)
System type 64-bit operating system, x64-based processor
By default, the ddls are stored in the subfolder "bin\runtimes\win-x86" and "bin\runtimes\win-x64".
I also tried moving them into the same folder as the main executable without any change.
I need to point out that this was never a problem on Windows 10 Professional so I wonder whether you know anything to be special in this environment?
Is there anything else that could cause this issue? Any idea on how I could further investigate the problem?
Oli
To reproduce
I currently don't know whether it is reproducible as I only have 1 system with this setup on which it does happen.
Urgency
No response
Platform
Windows
OS Version
Windows 10 Enterprise LTSC, Version 21H2, 19044.2728
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.12.1
ONNX Runtime API
C#
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: