-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Managed API: NativeMethods.OrtSetIntraOpNumThreads Crashes Application #4070
Comments
The official package has openmp. When you build from source by yourself I guess you didn't append "--use_openmp" to the build script? |
I did not append the OpenMP flag to the build script. Is this now a requirement for the runtime? I used the following for building from source: I do find it odd that 1.2.0 did not have this problem. Upgrading to 1.3.0 was when the issue started to happen. A little further digging around: using the 1.2.0 |
I was trying to explain the difference, why "This does not happen when building from source.". If you can build it from source with
And repro the bug with newly built binary, it would be easier for us to know why it crashed.
No. It is totally fine to live without it. |
Thanks for the recommendation. I built from source with the switches you suggested and was able to replicate the crashing behavior. Exact switch used: Oddly enough there's no exceptions happening and just an explicit crash, but it does look like OpenMP is the culprit. |
I used this sample code https://gist.github.com/pranavsharma/66186e986101022a7bb43201cd1e685e and tried it on my machine using the published pkg on Nuget and couldn't replicate. Here's my csproj file https://gist.github.com/pranavsharma/4d7d0b3964e0386295ed6362636452cf and I'm using Microsoft Visual Studio Community 2019 |
Thanks @pranavsharma |
Yes, I can repro. |
Btw, when openmp is enabled calling this method has no effect. So if this is blocking you, you can safely comment out the setting of options.IntraOpNumThreads in your C# code. The number of intra op threads are controlled using the openmp settings when openmp is enabled. See release notes https://github.com/microsoft/onnxruntime/releases/tag/v1.3.0. |
Thanks. I have commented out the code and proceeded with this as a temporary workaround. |
* Fix deprecated CentOS link for Linux CI pipeline (#4000) * Fix Linux_CI_GPU_Dev * centos6 * Fix crash reported in #4070. (#4091) * Fix crash reported in #4070. * Add newline to warning message * Add comment for using cout instead of the logger * fix optional input/outputs (#4229) Co-authored-by: Ryan Lai <[email protected]> Co-authored-by: Pranav Sharma <[email protected]> Co-authored-by: Tracy Sharpe <[email protected]>
Describe the bug
C# Application crashes without exception when setting
SessionOptions.IntraOpNumThreads
. This does not happen when building from source.Urgency
High. This used to work back in 1.2.0
System information
To Reproduce
InferenceSession
objectIntraOpNumThreads
to 1Expected behavior
Application should not crash and create the
InferenceSession
object.Additional context
This happens even when you don't have an ONNX model. See repro steps for procedure.
The text was updated successfully, but these errors were encountered: