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

Runtime issue with onnxruntime-win-x64-1.18.1 #21543

Closed
M3nxudo opened this issue Jul 29, 2024 · 9 comments
Closed

Runtime issue with onnxruntime-win-x64-1.18.1 #21543

M3nxudo opened this issue Jul 29, 2024 · 9 comments
Labels
platform:windows issues related to the Windows platform stale issues that have not been addressed in a while; categorized by a bot

Comments

@M3nxudo
Copy link

M3nxudo commented Jul 29, 2024

Describe the issue

With the latest version of the prebuilt release files downloaded from https://github.com/microsoft/onnxruntime/releases?page=1 , this specific download onnxruntime-win-x64-1.18.1.zip
I can correctly link the libraries and compile the project (i have stripped it down to the minimum dependencies) but whenever i execute it I get a runtime error before any code executes.
Exception thrown at 0x00007FFFBCA03080 (msvcp140.dll) in CoreORTwVS.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
image

image

I have double checked the configuration of the project, have tested with both a cmake project and a Visual Studio project, made sure dlls are in the execution directory but still can't fix the issue.

Additionally, if i change the include and library files to the 1.12.1 release, I can load the dependencies and perform tests with different models with no issues at all.

To reproduce

#include <iostream>
#include <onnxruntime_cxx_api.h>

int main() {
    try {
        std::cout << "Initializing ONNX Runtime..." << std::endl;
        Ort::Env env(ORT_LOGGING_LEVEL_WARNING, "test");
        std::cout << "ONNX Runtime initialized successfully." << std::endl;
    }
    catch (const Ort::Exception& e) {
        std::cerr << "ONNX Runtime error: " << e.what() << std::endl;
    }
    catch (const std::exception& e) {
        std::cerr << "Standard exception: " << e.what() << std::endl;
    }
    catch (...) {
        std::cerr << "Unknown exception occurred" << std::endl;
    }
    return 0;
}

Urgency

We are trying to migrate our application to the new releases of Onnxruntime, to use some new operators that our models need that are not found on older versions of the runtime

Platform

Windows

OS Version

Version 10.0.17763 Build 17763

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.18.1

ONNX Runtime API

C++

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

@github-actions github-actions bot added the platform:windows issues related to the Windows platform label Jul 29, 2024
@M3nxudo
Copy link
Author

M3nxudo commented Jul 29, 2024

Tested all other release versions 1.12 - 1.18.0 and could load the library without the issue.

@CarlNobody
Copy link

CarlNobody commented Jul 29, 2024

Describe the issue
MNIST.cpp showed the same error 0xc0000142 either.

Platform
Windows

OS Version
21H2 19044.3803

ONNX Runtime Installation
Released Package

ONNX Runtime Version or Commit ID
onnxruntime-win-x64-1.18.1, copied all the DLLs including onnxruntime.dll and onnxruntime_providers_shared.dll to compiled output executable file directory.

ONNX Runtime API
C++, onnxruntime-win-x64-1.18.1

Architecture
X64

Execution Provider
GPU

Notes
1, Tested with GPU version with cuda_12.4.0_551.61_windows displayed the same error.
2, Remove onnxruntime.dll in System32 and SysWOW64 and copied all the DLLs from onnxruntime-win-x64-gpu-cuda12-1.18.1 to execution folder , it showed the same error.

@CarlNobody
Copy link

CarlNobody commented Jul 29, 2024

It's obviously that we missed a DLL called msvcp140.dll in our system from your debug exception , so download the Microsoft Visual C++ 2015 - 2022 Redistributable according to https://answers.microsoft.com/en-us/windows/forum/all/vcruntime140dll-and-msvcp140dll-missing-in-windows/220f1caf-8eb9-413d-a7fe-1b13df1bfa5d and install it, now the issue got fixed.

@charlescao460
Copy link

charlescao460 commented Jul 29, 2024

I encountered the same issue with onnxruntime-win-x64-gpu-cuda12-1.18.1.zip from the release, and I confirmed that Visual C++ Redistributable v14.40.33810 was installed. The issue remains.

The error is the same:

Exception thrown at 0x00007FFBCAE22F58 (msvcp140.dll) in Autopilot.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

Call stack with PDB loaded:
image

@snnn
Copy link
Member

snnn commented Jul 30, 2024

I confirmed that Visual C++ Redistributable v14.40.33810 was installed.

It is not enough. You need check what DLL was actually loaded. Because you may have multiple msvcp140.dll on the same machine.

See: #21102 (comment)

@ispysoftware
Copy link

Updated our nuget packages to use this latest version in our deployed clients can confirm it's throwing access violation exceptions on all deployments. Rolled back to 1.16.3 and it's fine.

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Aug 30, 2024
@VisionaryML
Copy link

i run on 1.16.3 but same error.

@snnn
Copy link
Member

snnn commented Sep 18, 2024

Not a bug of ONNX Runtime. Please use a debugger to check which msvcp140.dll was loaded into the process and check the DLL's version.

@snnn snnn closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:windows issues related to the Windows platform stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

6 participants