From 2f066a7e703d19b77723a5bf8ff5f781fc6586ee Mon Sep 17 00:00:00 2001 From: Roy Oursler Date: Thu, 27 Mar 2025 07:15:41 -0700 Subject: [PATCH] common, xe: sycl: improve logging when OpenCL install is missing --- src/common/verbose_msg.hpp | 1 + src/gpu/intel/sycl/utils.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/common/verbose_msg.hpp b/src/common/verbose_msg.hpp index 441f614c8e6..cf92ffbbfa4 100644 --- a/src/common/verbose_msg.hpp +++ b/src/common/verbose_msg.hpp @@ -129,6 +129,7 @@ #define VERBOSE_INCOMPATIBLE_GEMM_FMT "incompatible gemm format" #define VERBOSE_DEVICE_CTX_MISMATCH "device not found in the given context" +#define VERBOSE_MISSING_OCL_DEVICE "%s OpenCL device not found" #define VERBOSE_INVALID_PLATFORM "unsupported %s platform (expected %s got %s)" #define VERBOSE_ENGINE_CREATION_FAIL "failed to create %s engine with index %zu" #define VERBOSE_KERNEL_CREATION_FAIL "failed to create %s kernel" diff --git a/src/gpu/intel/sycl/utils.cpp b/src/gpu/intel/sycl/utils.cpp index c83d66eeca0..db32955e7c1 100644 --- a/src/gpu/intel/sycl/utils.cpp +++ b/src/gpu/intel/sycl/utils.cpp @@ -132,13 +132,21 @@ status_t sycl_dev2ocl_dev(cl_device_id *ocl_dev, const ::sycl::device &dev) { return uuid2ocl_dev_tmp; }(); - if (uuid2ocl_dev.empty()) return status::runtime_error; + if (uuid2ocl_dev.empty()) { + VERROR(common, runtime, VERBOSE_MISSING_OCL_DEVICE, + dev.get_info<::sycl::info::device::name>().c_str()); + return status::runtime_error; + } const xpu::device_uuid_t l0_dev_uuid = gpu::intel::sycl::get_device_uuid(dev); auto d = uuid2ocl_dev.get(l0_dev_uuid); - if (!d) return status::runtime_error; + if (!d) { + VERROR(common, runtime, VERBOSE_MISSING_OCL_DEVICE, + dev.get_info<::sycl::info::device::name>().c_str()); + return status::runtime_error; + } *ocl_dev = d;