Skip to content

OpenCL: clSetEventCallback errors abort instead of returning a HIP error #2008

Open

Description

@pvelesko

On the OpenCL backend a failing clSetEventCallback in CHIPQueueOpenCL::launchImpl aborts the process instead of returning a HIP error, because clSetEventCallback has no entry in the error conversion table in src/backend/OpenCL/clHipErrorConversion.hh, so hip_convert_error hits the unmapped path and calls std::abort():

Error: Unmapped API or API Error Code encountered at CHIPBackendOpenCL.cc:1879
API call: clSetEventCallback
Error code: CL_OUT_OF_RESOURCES

The OpenCL API spec (api/opencl_runtime_layer.asciidoc, clSetEventCallback errors) allows this error:

{CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required by the OpenCL implementation on the device.

This is the same class as #1604 (clFlush was missing from the table). The fix is to add clSetEventCallback to the table so the error is mapped and returned.

Seen with zeroRK (CHIP-SPV/zero-rk hip-chipStar at a0783ad1) on an Intel Arc A770 under CHIP_BE=opencl, in the CVODE, Seulex and Radau constant volume GPU cases added in #1945. The same cases pass on Level Zero. The failure is intermittent; other runs instead segfault at address 0x8 inside libigdrcl.so under launchImpl. Why the driver runs out of resources, and whether the segfault has the same cause, is not established: NEO returns this error from clSetEventCallback when flushing earlier queued work fails, so the last launched kernel (sundials::nvector_hip::linearSumKernel) is not necessarily the culprit. Possibly related: #1384 (cross queue markers leak a cl_event) and #1438 (same error from other calls). No upstream compute-runtime report has been filed.

This issue was generated using AI

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:correctnessIncorrect results, crashes and behavioral bugs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions