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 Nov 15, 2024
1 parent 80f3eb6 commit bd00e60
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 @@ -54,6 +54,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 bd00e60

Please sign in to comment.