microsoft / microsoft/onnxruntime

Fix arm64 DLL loading

Open Beginner friendly
#29,809 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

https://github.com/microsoft/onnxruntime/blob/11e2f5c14a1e063a2e707eec5762ff52dd7b1328/onnxruntime/__init__.py#L221-L227

`platform.machine()` is the wrong Python API to use here - it's going to tell you the underlying architecture of the machine, but you want the architecture of the current process so that you can load the correct DLLs.

You should use `sysconfig.get_platform()` for this instead: https://docs.python.org/3/library/sysconfig.html#sysconfig.get_platform

Further discussion and context: https://github.com/python/cpython/issues/98962

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.

Research direction

Start at onnxruntime/__init__.py lines 221-227 and compare the current platform.machine() lookup with Python's sysconfig.get_platform() documentation. Change the architecture source so DLL selection follows the current process architecture, then verify that the correct arm64 DLLs are selected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.