Skip to content

Commit

Permalink
[GPU] Added try/catch for device detection loop to skip platforms whi…
Browse files Browse the repository at this point in the history
…ch throw an exception
  • Loading branch information
vladimir-paramuzov committed Apr 18, 2023
1 parent d70d850 commit cc8046a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/plugins/intel_gpu/src/runtime/ocl/ocl_device_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,17 @@ std::vector<device::ptr> ocl_device_detector::create_device_list() const {
for (auto& id : platform_ids) {
cl::Platform platform = cl::Platform(id);

std::vector<cl::Device> devices;
platform.getDevices(CL_DEVICE_TYPE_ALL, &devices);
for (auto& device : devices) {
if (!does_device_match_config(device))
continue;
supported_devices.emplace_back(std::make_shared<ocl_device>(device, cl::Context(device), id));
try {
std::vector<cl::Device> devices;
platform.getDevices(CL_DEVICE_TYPE_ALL, &devices);
for (auto& device : devices) {
if (!does_device_match_config(device))
continue;
supported_devices.emplace_back(std::make_shared<ocl_device>(device, cl::Context(device), id));
}
} catch (std::exception& ex) {
GPU_DEBUG_LOG << "Devices query failes for " << platform.getInfo<CL_PLATFORM_NAME>() << ": " << ex.what() << std::endl;
continue;
}
}
OPENVINO_ASSERT(!supported_devices.empty(), create_device_error_msg);
Expand Down

0 comments on commit cc8046a

Please sign in to comment.