Skip to content

[SYCL][UR] Improve diagnostics for missing platforms in sycl-ls - #23542

Open
inteltdelisle wants to merge 4 commits into
intel:syclfrom
inteltdelisle:unified-runtime/verbose_sycl_ls
Open

inteltdelisle wants to merge 4 commits into
intel:syclfrom
inteltdelisle:unified-runtime/verbose_sycl_ls

Conversation

@inteltdelisle

@inteltdelisle inteltdelisle commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

When a backend's platforms or devices fail to show up in sycl-ls, users currently get little indication of where in the stack things went wrong. This change adds some logging and guidance to help narrow it down:

  • UR loader: log each adapter that is loaded (statically or dynamically) and the total number of adapters loaded.
  • UR adapters (CUDA, HIP, Level Zero, OpenCL, Native CPU, Offload): log the number of platforms each adapter initializes at INFO level. The Level Zero message is raised from DEBUG to INFO for consistency.
  • OpenCL adapter: log a message when clGetPlatformIDs fails or returns no platforms.
  • sycl-ls --verbose: print backend-specific hints at the end of the output (clinfo, nvidia-smi, rocminfo/amd-smi, ZE_ENABLE_LOADER_DEBUG_TRACE, strace).

The new messages can be seen with UR_LOG_LOADER / UR_LOG_ set to "level:info;output:stdout" (or similar).

This doesn't fully resolve the issue, since sycl-ls still can't tell users why a backend is missing, but it should make the cause much easier to find.

Refs: #22313

When a backend's platforms or devices fail to show up in sycl-ls, users
currently get little indication of where in the stack things went wrong.
This change adds some logging and guidance to help narrow it down:

* UR loader: log each adapter that is loaded (statically or dynamically)
  and the total number of adapters loaded.
* UR adapters (CUDA, HIP, Level Zero, OpenCL, Native CPU, Offload): log
  the number of platforms each adapter initializes at INFO level. The
  Level Zero message is raised from DEBUG to INFO for consistency.
* OpenCL adapter: log an error when clGetPlatformIDs fails or returns no
  platforms, and when a platform reports CL_DEVICE_NOT_FOUND.
* sycl-ls --verbose: print backend-specific hints at the end of the
  output (clinfo, nvidia-smi, rocminfo/amd-smi,
  ZE_ENABLE_LOADER_DEBUG_TRACE, /dev/dri/renderD* permissions, strace),
  and say which UR logger messages point to a configuration problem.

The new messages can be seen with UR_LOG_LOADER / UR_LOG_<ADAPTER>
set to "level:info;output:stdout" (or similar).

This doesn't fully resolve the issue, since sycl-ls still can't tell
users *why* a backend is missing, but it should make the cause much
easier to find.

Refs: intel#22313

Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
Comment thread unified-runtime/source/adapters/level_zero/common/adapter.cpp Outdated

@bratpiorka bratpiorka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CUDA/HIP/NativeCPU/OpenCL LGTM

@ldorau ldorau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description says more than the code does. It says:

  • OpenCL adapter logs an error when clGetPlatformIDs fails and for CL_DEVICE_NOT_FOUND,
  • sycl-ls prints a hint about permissions on /dev/dri/renderD*,
  • sycl-ls explains which UR logger messages point to a configuration problem.

I cannot find any of these in the code. The OpenCL adapter adds only one INFO message ("CL No platforms found").
Please update the description (and the commit message) to match the code, or add the missing parts.

Comment thread sycl/tools/sycl-ls/sycl-ls.cpp Outdated
Comment thread unified-runtime/source/adapters/opencl/adapter.cpp Outdated
Comment thread unified-runtime/source/adapters/native_cpu/platform.cpp Outdated
Comment thread unified-runtime/source/adapters/offload/platform.cpp Outdated
Comment thread sycl/tools/sycl-ls/sycl-ls.cpp
@inteltdelisle

Copy link
Copy Markdown
Contributor Author

The description says more than the code does. It says:

  • OpenCL adapter logs an error when clGetPlatformIDs fails and for CL_DEVICE_NOT_FOUND,
  • sycl-ls prints a hint about permissions on /dev/dri/renderD*,
  • sycl-ls explains which UR logger messages point to a configuration problem.

I cannot find any of these in the code. The OpenCL adapter adds only one INFO message ("CL No platforms found"). Please update the description (and the commit message) to match the code, or add the missing parts.

Updated the description:

  • OpenCL logs a message, I forgot I downgraded this to info.
  • I believe the code already checked for /dev/dri/renderD* in checkRenderGroupPermission.
  • The hints at the end used to point to existing logger messages, but I felt they could go out of sync too easily.

@inteltdelisle
inteltdelisle requested a review from ldorau October 23, 2026 13:20

@ldorau ldorau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up. One remaining issue from the earlier review: the PR description still says the OpenCL adapter logs when a platform reports CL_DEVICE_NOT_FOUND. That is not in the code. The only new OpenCL log is:

    OpenCL: No platforms found (Result = {})

in the adapter constructor when clGetPlatformIDs fails or returns 0 platforms.
Please update the PR description and the first commit message to drop the CL_DEVICE_NOT_FOUND mention. After that LGTM.

Comment thread unified-runtime/source/adapters/opencl/adapter.cpp

@ldorau ldorau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants