microsoft / microsoft/onnxruntime

[Feature Request] Check installation when onnxruntime is first loaded

Open
#26,247 1 comment 2 reactions 0 assignees View on GitHub
ep:QNN feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

We very often have users install the following packages at the same time:

```
onnxruntime
onnxruntime-gpu
onnxruntime-qnn
```

This can result in unexpected behavior, such as certain EPs not working correctly, or not showing up entirely.

I suggest that ONNX Runtime implement something that runs on first import of the package that verifies the install is right, and suggests a fix if it isn't correct.

### Describe scenario use case

Any time users import the `onnxruntime` package, a check is run (and cached) to verify their installation. The check would raise an exception if more than one `onnxruntime` package is installed, and suggest what the user can do `pip uninstall x, y; pip install x` to fix their environment.

Example implementation: https://github.com/quic/ai-hub-models/blob/da68312da0ab5ed40705c1f4e38b87f19fa19e70/qai_hub_models/utils/onnx_torch_wrapper.py#L60

Contributor guide

Open the contributing guide

Research direction

Read the linked example implementation in qai_hub_models/utils/onnx_torch_wrapper.py around line 60, then locate ONNX Runtime’s package entry point for the first import. Done means an import check detects conflicting onnxruntime packages, caches the result, and provides a corrective pip command or exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.