Repository navigation
[SYCL][UR] Improve diagnostics for missing platforms in sycl-ls - #23542
inteltdelisle wants to merge 2 commits into
Conversation
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>
bratpiorka
left a comment
There was a problem hiding this comment.
CUDA/HIP/NativeCPU/OpenCL LGTM
ldorau
left a comment
There was a problem hiding this comment.
The description says more than the code does. It says:
- OpenCL adapter logs an error when
clGetPlatformIDsfails and forCL_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.
| cl_uint NumPlatforms = 0; | ||
| cl_int Result = ocl::clGetPlatformIDs_ptr(0, nullptr, &NumPlatforms); | ||
| if (Result != CL_SUCCESS || NumPlatforms == 0) { | ||
| UR_LOG(INFO, "CL No platforms found (Result = {})", Result); |
There was a problem hiding this comment.
Nit: the new messages use different styles:
CUDA Initialized {} platformsHIP Initialized {} platformsLZ Initialized {} platformsCL Initialized {} platformsCL No platforms found (Result = {})NATIVE_CPU: 1 platform availableOFFLOAD: {} platforms available
Could you use one style for all of them? For example:
<Adapter name>: found {} platforms.
Also "OpenCL" is easier to understand than "CL".
| UR_ASSERT(pNumPlatforms || phPlatforms, UR_RESULT_ERROR_INVALID_VALUE); | ||
|
|
||
| if (pNumPlatforms) { | ||
| UR_LOG(INFO, "NATIVE_CPU: 1 platform available"); |
There was a problem hiding this comment.
Nit: this is inside urPlatformGet(), which is called many times.
So this message is printed again and again. The other adapters print it only once,
during initialization. Could you move it there, or keep it but know it will repeat?
There was a problem hiding this comment.
Unless I'm missing something, I don't believe this particular adapter has initialization code. So I moved the log into a static initilization.
| ur_platform_handle_t *phPlatforms, uint32_t *pNumPlatforms) { | ||
|
|
||
| if (pNumPlatforms) { | ||
| UR_LOG(INFO, "OFFLOAD: {} platforms available", Adapter->Platforms.size()); |
There was a problem hiding this comment.
Nit: this is inside urPlatformGet(), which is called many times.
So this message is printed again and again. The other adapters print it only once,
during initialization. Could you move it there, or keep it but know it will repeat?
Updated the description:
|
Signed-off-by: Delisle, Thierry <thierry.delisle@intel.com>
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:
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