Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU] documentation for debugging OOR (#33213)

Mingyu Kim0effb3b4147e
diff --git a/src/plugins/intel_gpu/README.md b/src/plugins/intel_gpu/README.md
index a04cddc6601..9397cca3b58 100644
--- a/src/plugins/intel_gpu/README.md
+++ b/src/plugins/intel_gpu/README.md
@@ -27,8 +27,6 @@ GPU Plugin contains the following components:
* [Memory formats](./docs/gpu_memory_formats.md)
* [Kernels and kernel selectors](./docs/gpu_kernels.md)
* [GPU plugin operations enabling flow](./docs/gpu_plugin_ops_enabling.md)
-* [Debug utils](./docs/gpu_debug_utils.md)
-* [OpenCL Runtime issues troubleshooting](./docs/gpu_plugin_driver_troubleshooting.md)
* [GPU plugin unit test](./docs/gpu_plugin_unit_test.md)
* [Run benchmark from device_mem](./docs/use_device_mem.md)
@@ -55,6 +53,11 @@ This contents explain the internal implementation of dynamic shape support in th
* Model caching for dynamic shape (TBD)
-->
+## Troubleshooting / Debugging
+* [Debug utils](./docs/gpu_debug_utils.md)
+* [Debugging guide](./docs/debugging_guide.md)
+* [OpenCL Runtime issues troubleshooting](./docs/gpu_plugin_driver_troubleshooting.md)
+
## Attached licenses
GPU plugin uses 3<sup>rd</sup>-party components licensed under following licenses:
diff --git a/src/plugins/intel_gpu/docs/debugging_guide.md b/src/plugins/intel_gpu/docs/debugging_guide.md
new file mode 100644
index 00000000000..14dbb64685c
--- /dev/null
+++ b/src/plugins/intel_gpu/docs/debugging_guide.md
@@ -0,0 +1,34 @@
+# GPU Plugin Debugging Guide
+
+This document describes debugging practices that can help diagnose issues in the GPU plugin.
+
+## OpenCL Out-Of-Resource
+During execution, OpenCL may return an out-of-resource (OOR) error. This can happen for two primary reasons:
+
+* **Actual resource exhaustion**: The system runs out of resources—for example, because the workload requires more memory than is available.
+* **GPU execution failures reported as OOR**: Some GPU-side failures do not have dedicated OpenCL error codes. In these cases, the driver may report the failure as an OOR error. A known (and common) example—starting from Xe2— is a page fault inside a GPU kernel. When this occurs, the GPU may report OOR even though the root cause is not memory pressure.
+
+### Steps to Debug OOR Issues
+
+1. **Verify Memory Consumption**
+ First, assess whether memory usage is within a reasonable range.
+ * Use the [OV_VERBOSE](gpu_debug_utils.md#gpu-plugin-debug-utils) logs or
+ * Examine memory allocations using *CLI_CallLogging* from the [opencl-intercept-layer](https://github.com/intel/opencl-intercept-layer/)
+
+ If memory consumption is unexpectedly high, investigate:
+ * It may be expected (e.g., large model size, large intermediate buffers).
+ * Or it may indicate a potential issue in the OpenVINO GPU plugin.
+
+2. **Identify the Kernel That Triggers the OOR**
+ If memory usage appears normal, the next step is locating the specific kernel that causes the failure. Use the opencl-intercept-layer with:
+ * CLI_CallLogging – to record OpenCL calls
+ * CLI_FinishAfterEnqueue – to force each OpenCL enqueue call to execute in a blocking manner
+
+ With these options enabled, the OOR error will be associated with a specific enqueue call, allowing you to determine which layer caused it.
+
+3. **Validate by Replacing the Kernel with a Dummy Implementation**
+ Once you identify the problematic layer, you can try replacing the kernel with a dummy implementation. For OpenVINO kernels, you can temporarily comment out the corresponding OpenCL code.
+
+ If the OOR disappears after replacing the kernel, this indicates the error originates from within the kernel execution itself. You can then bisect the kernel code to isolate the exact section responsible.
+
+ > Note: When modifying or partially removing code, keep in mind that the OpenCL compiler may optimize away sections which are considered "unused." Be cautious when interpreting results after such modifications.
\ No newline at end of file