Skip to content

Commit

Permalink
disable threadpools (causes deadlocks in onnxruntime::InferenceSessio…
Browse files Browse the repository at this point in the history
…n::~InferenceSession())
  • Loading branch information
veprbl committed Sep 19, 2024
1 parent 8299468 commit 193682d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/algorithms/onnx/InclusiveKinematicsML.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace eicrecon {
// onnxruntime setup
m_env = Ort::Env(ORT_LOGGING_LEVEL_WARNING, "inclusive-kinematics-ml");
Ort::SessionOptions session_options;
session_options.SetInterOpNumThreads(1);
session_options.SetIntraOpNumThreads(1);
try {
m_session = Ort::Session(m_env, m_cfg.modelPath.c_str(), session_options);

Expand Down
2 changes: 2 additions & 0 deletions src/algorithms/onnx/ONNXInference.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ namespace eicrecon {
// onnxruntime setup
m_env = Ort::Env(ORT_LOGGING_LEVEL_WARNING, name().data());
Ort::SessionOptions session_options;
session_options.SetInterOpNumThreads(1);
session_options.SetIntraOpNumThreads(1);
try {
m_session = Ort::Session(m_env, m_cfg.modelPath.c_str(), session_options);
Ort::AllocatorWithDefaultOptions allocator;
Expand Down

0 comments on commit 193682d

Please sign in to comment.