intel / onnxruntime

ONNX Runtime: cross-platform, high performance scoring engine for ML models
MIT License
57 stars 23 forks source link

Device selection by ID does not work #475

Open henryruhs opened 1 week ago

henryruhs commented 1 week ago

Describe the issue

Many users reach out that GPU.0, GPU.1 etc. is not working for them when creating a InferenceSession. According to the documentation this should work - but in fact only GPU does, which should just be an alias to GPU.0

...\rel-1.19_final\onnxruntime\onnxruntime\core\providers\openvino\openvino_execution_provider.cc:72 __cdecl onnxruntime::OpenVINOExecutionProvider::OpenVINOExecutionProvider(const struct onnxruntime::OpenVINOExecutionProviderInfo &) [ERROR] [OpenVINO] Specified device - GPU.0 is not available
 when using [('OpenVINOExecutionProvider', {'device_type': 'GPU.0', 'precision': 'FP32'})]
Falling back to ['CPUExecutionProvider'] and retrying.

A user with an Intel Arc 770 send me this, his device id is 0.

image

To reproduce

We found this script to debug his graphics card.

He then send me his output.

ZE_LOADER_DEBUG_TRACE:Using Loader Library Path: 
ZE_LOADER_DEBUG_TRACE:Tracing Layer Library Path: libze_tracing_layer.so.1
['CPU', 'GPU']

It seems this is an issue on OpenVINO's API itself or that different drivers return different information? Anyways, it could be resolved on the onnxruntime level bei hardcoding GPU.0 to GPU.

Urgency

High priority as this breaks apps.

Platform

Windows

OS Version

11

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.19.0

ONNX Runtime API

Python

Architecture

X64

Execution Provider

OpenVINO

Execution Provider Library Version

Used with OpenVino 2024.3.0

n1harika commented 1 day ago

Inferencing from OpenVINO depends on the available devices on your system- 'GPU.0' is equivalent to 'GPU' and 'GPU.1' can only be used if an additional dGPU driver is available on your system. Kindly use the latest release of OVEP and make sure your GPU drivers are updated and can be read by OpenVINO.

henryruhs commented 1 day ago

This does not explain this error:

[OpenVINO] Specified device - GPU.0 is not available