microsoft / microsoft/onnxruntime

[Feature Request] Python DirectML,I can set 'device_id=1' to choose a GPU,but I can't know which ID corresponds to which GPU.

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

Description

### Describe the feature request

[Feature Request] I use Python with ONNX Runtime DirectML. I can set 'device_id=1' to choose a GPU, but I can't determine which GPU corresponds to which ID. Can you add an API to list all the devices with their IDs that support DirectML?

### Describe scenario use case

python onnxruntime-directml,I use it to do some audio AI inference,there is a example:
print(onnxruntime.get_available_providers())
model_path = "model.onnx"
session = onnxruntime.InferenceSession("model.onnx",providers=['DmlExecutionProvider'])
session.set_providers(['DmlExecutionProvider'], [ {'device_id': 0}])

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the DirectML execution provider's device selection and the Python provider configuration shown in the issue. Define how an API would enumerate supported devices and map each device to its device_id; done means Python callers can identify the GPU associated with each ID before creating an inference session.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.