File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
onnxruntime/core/providers/openvino Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,12 @@ OrtStatus* OpenVINOEpPluginFactory::GetSupportedDevices(const OrtHardwareDevice*
9696
9797 const auto & ov_device_type = device_it->second ;
9898 std::string ov_device_name;
99- auto get_pci_device_id = [&](const std::string& ov_device) {
99+ auto get_gpu_device_id = [&](const std::string& ov_device) {
100100 try {
101- ov::device::PCIInfo pci_info = ov_core_->get_property (ov_device, ov::device::pci_info );
102- return pci_info. device ;
101+ auto device_id_str = ov_core_->get_property (ov_device, " GPU_DEVICE_ID " ). as <std::string>( );
102+ return static_cast < uint32_t >( std::stoul (device_id_str, nullptr , 0 )) ;
103103 } catch (ov::Exception&) {
104- return 0u ; // If we can't get the PCI info, we won't have a device ID.
104+ return 0u ; // If we can't get the GPU_DEVICE_ID info, we won't have a device ID.
105105 }
106106 };
107107
@@ -111,7 +111,7 @@ OrtStatus* OpenVINOEpPluginFactory::GetSupportedDevices(const OrtHardwareDevice*
111111 // If there are multiple devices of the same type, we need to match by device ID.
112112 matched_device = std::find_if (filtered_devices.begin (), filtered_devices.end (), [&](const std::string& ov_device) {
113113 uint32_t ort_device_id = ort_api.HardwareDevice_DeviceId (&device);
114- return ort_device_id == get_pci_device_id (ov_device);
114+ return ort_device_id == get_gpu_device_id (ov_device);
115115 });
116116 }
117117
You can’t perform that action at this time.
0 commit comments