Skip to content

[GPU] Print program build log on cl::Error during kernel build#36553

Merged
maxnick merged 1 commit into
openvinotoolkit:masterfrom
allnes:an/gpu-print-build-log-on-cl-error
Jun 24, 2026
Merged

[GPU] Print program build log on cl::Error during kernel build#36553
maxnick merged 1 commit into
openvinotoolkit:masterfrom
allnes:an/gpu-print-build-log-on-cl-error

Conversation

@allnes

@allnes allnes commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Problem: In ocl_kernel_builder, cl::Program::build only raises cl::BuildError for CL_BUILD_PROGRAM_FAILURE, and only that branch prints the OpenCL program build log. Other build-time failures — notably CL_OUT_OF_RESOURCES, raised when a generated kernel exceeds device limits (e.g. SLM/local memory on integrated GPUs) — propagate as a plain cl::Error, whose handler rethrows with just the error code and no build log. This leaves such kernel-build failures effectively undiagnosable without local source patching.

Solution: In the catch (const cl::Error&) branch of ocl_kernel_builder::build (src/plugins/intel_gpu/src/runtime/ocl/ocl_kernel_builder.hpp), fetch and log the program build log via program.getBuildInfo<CL_PROGRAM_BUILD_LOG>() before rethrowing, mirroring the existing cl::BuildError branch and using the same GPU_DEBUG_INFO channel. The log retrieval is wrapped so a secondary failure does not mask the original error. No behavior change in the success path; output is only produced under GPU verbose logging.

@allnes allnes requested review from a team as code owners June 24, 2026 14:35
@github-actions github-actions Bot added the category: GPU OpenVINO GPU plugin label Jun 24, 2026
@allnes allnes requested a review from maxnick June 24, 2026 14:37
@maxnick maxnick added this to the 2026.3 milestone Jun 24, 2026
@maxnick maxnick enabled auto-merge June 24, 2026 15:59
@maxnick maxnick added this pull request to the merge queue Jun 24, 2026
Merged via the queue into openvinotoolkit:master with commit b1d171d Jun 24, 2026
191 checks passed
@maxnick maxnick deleted the an/gpu-print-build-log-on-cl-error branch June 24, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: GPU OpenVINO GPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants