microsoft / microsoft/onnxruntime

Import Error in Windows debug config with eager mode

Open
#11,985 0 comments 0 reactions 1 assignee View on GitHub

@souptc is already working on this.

Since Jun 24, 2022.

build
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Describe the bug
When importing onnxruntime built from source for Windows in debug config with eager mode, we get a DLL load error for the module onnxruntime_pybind11_state.

Urgency
Blocking testing in windows debug

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 11
  • ONNX Runtime installed from (source or binary): source
  • ONNX Runtime version: 1.12.0
  • Python version: 3.9.13
  • Visual Studio version (if applicable): NA
  • GCC/Compiler version (if compiling from source): Clang 14
  • CUDA/cuDNN version: NA
  • GPU model and memory: NA

To Reproduce
Build from source:

  1. Create and activate a venv
  2. Install prereqs: pip install setuptools wheel numpy typing_extensions torch
  3. Build for windows in debug mode: python ..\onnxruntime\tools\ci_build\build.py --config Debug --build_dir .\build --build_eager_mode --enable_training --build_wheel --parallel

The build stage itself will succeed, but the python tests will fail with a similar DLL error.

To repro once build succeeds:

  1. Setup the python wheel (from Debug output dir): python ..\..\..\..\onnxruntime\setup.py bdist_wheel --enable_training
  2. pip install the wheel: pip install "dist\onnxruntime_training-1.12.0+cpu-cp39-cp39-win_amd64.whl"
  3. Try importing onnxruntime in interactive python shell
>>> import torch
>>> import onnxruntime

Expected behavior
Should be able to successfully import onnxruntime when built with Windows debug configuration and eager mode enabled

Screenshots
Error during python test stage of build:
1ada2c31-e551-4c7a-80f1-7be3093c4f88

Error during import after installing wheel:
image

Additional context
Both stack traces suggest that the error is specifically related to the onnxruntime_pybind11_state module.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.