-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Activate thread pool will cause crash. #21461
Comments
07-23 13:59:43.248 32076 32076 F DEBUG : pid: 30705, tid: 31908, name: CurProgram >>> com.Xjg.maxi <<< Android ndk build the code, with onnxruntime h/so, the program works fine, but when my program so is released by dl close, the main program crashed. Whether this is related to this comment: |
默认好像是开启thread pool的,我关闭,设置_OrtSessionOptions.SetIntraOpNumThreads(1);就没问题,但是会慢很多,但是不设置1,就会在释放so的时候,崩溃在thread相关操作,有什么办法能够主动关闭thread pool么,在执行完之后。 |
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. |
Describe the issue
My program dlopen libonnxruntime.so, the infence works fine, but when dlclose all the so, the main program crash.
If I activate disable thread pool by set _OrtSessionOptions.SetIntraOpNumThreads(1);
the main program won't crash, but the infence speed will be very slow.
From the onnxruntime source code comment:
ORT_RUNTIME_CLASS(Session); // Don't call ReleaseSession from Dllmain (because session owns a thread pool)
Whether my case violation this, and how to use thread pool, and release the thread pool after infence finished.
To reproduce
N/A
Urgency
No response
Platform
Android
OS Version
Android 7.0
ONNX Runtime Installation
Built from Source
Compiler Version (if 'Built from Source')
No response
Package Name (if 'Released Package')
None
ONNX Runtime Version or Commit ID
V1.18
ONNX Runtime API
C++/C
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: