diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index add1531664981..b0d3c2db15332 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -100,12 +100,17 @@ vector_class platform_impl::get_platforms() { for (unsigned int i = 0; i < Plugins.size(); i++) { pi_uint32 NumPlatforms = 0; - Plugins[i].call(0, nullptr, &NumPlatforms); + // Just return zero platforms if plugin fails to initialize. + // This way platforms from other plugins get a chance to be discovered. + if (Plugins[i].call_nocheck( + 0, nullptr, &NumPlatforms) != PI_SUCCESS) + return Platforms; if (NumPlatforms) { vector_class PiPlatforms(NumPlatforms); - Plugins[i].call(NumPlatforms, - PiPlatforms.data(), nullptr); + if (Plugins[i].call_nocheck( + NumPlatforms, PiPlatforms.data(), nullptr) != PI_SUCCESS) + return Platforms; for (const auto &PiPlatform : PiPlatforms) { platform Platform = detail::createSyclObjFromImpl(