Bug 167979 - LO attempts to launch an OpenCL kernel with an invalid workgroup size
Summary: LO attempts to launch an OpenCL kernel with an invalid workgroup size
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OpenCL console-noise
  Show dependency treegraph
 
Reported: 2025-08-16 18:32 UTC by Eyal Rozenberg
Modified: 2025-08-17 13:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
opencl_devices.log on system exhibiting the issue (3.23 KB, text/x-log)
2025-08-17 13:11 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2025-08-16 18:32:44 UTC
When I start LibreOffice start center from the console, I get the following warning:

warn:opencl:1628:1628:opencl/opencltest/main.cxx:159: OpenCL driver check failed: -54(line 159)


First of all, let me say I think it's wasted perf to bring up an entire process just in order to run some OpenCL checks. Do it in our main process! But maybe I should open a separate bug about that.

Anyway, OpenCL error -54 is CL_INVALID_WORK_GROUP_SIZE. And the code in main.cxx looks like this:

const size_t globalWorkSize[] = { dataSize };
const size_t localSize[1] = { 64 };
state = clEnqueueNDRangeKernel(queue, kernel, 1, nullptr, globalWorkSize, localSize, 0, nullptr,nullptr);

This was fishy to me. So, I tried building the OpenCL test executable on my own, doing the following:

1. Cloning clew master branch from GitHub
2. Building and installing clew to /opt/clew
3. Dropping the dependency on SAL for logging (just do logging by streaming to std::cerr)
4. Building with:

g++ -o main main.cxx -I/opt/clew/include -L/opt/clew/lib -I${libreoffice_src_dir}/opencl/inc -lclew

it built, and ran, and gave the same error. My platform was "NVIDIA CUDA" and my device was "NVIDIA GeForce GTX 1050 Ti". If I had time I would try to take a closer look at the code to try to understand what's going on.


The version of main.cxx I'm looking at is from commit 10ad9560fba562f494fa44fc8a7bd2388d9e8c5c on Oct 5th 2021.
Comment 1 m_a_riosv 2025-08-16 21:27:52 UTC
In the Cache folder in the Profile, there is a opencl_devices.log
Comment 2 Julien Nabet 2025-08-17 08:40:40 UTC
Eyal: you can give a try with https://gerrit.libreoffice.org/c/core/+/187603/1/opencl/opencltest/main.cxx.
I don't know if this patch will be pushed or not. As I indicated it's been made from ChatGpt and I'm not an OpenCl expert, just gave a try on the tdf#167365 + I don't know about license part.
Comment 3 Eyal Rozenberg 2025-08-17 12:12:52 UTC
(In reply to m_a_riosv from comment #1)
> In the Cache folder in the Profile, there is a opencl_devices.log

It has my two NVIDIA GPUs: "NVIDIA GeForce RTX 4060" and "NVIDIA GeForce GTX 1050 Ti". Is there anything specific you think could be relevant you want me to check?


(In reply to Julien Nabet from comment #2)

> Eyal: you can give a try with
> https://gerrit.libreoffice.org/c/core/+/187603/1/opencl/opencltest/main.cxx.
> I don't know if this patch will be pushed or not. As I indicated it's been
> made from ChatGpt and I'm not an OpenCl expert, just gave a try on the
> tdf#167365 + I don't know about license part.

That will not make any difference effect, since all commands _up to_ the kernel launch succeeded, so our problem is not the device name being too long. Also, note that there are official C++ bindings for OpenCL which do error checking:

https://github.com/KhronosGroup/OpenCL-CLHPP/

(although to be honest I don't like them much and am planning to work on alternative ones).
Comment 4 Julien Nabet 2025-08-17 12:14:55 UTC
(In reply to Eyal Rozenberg from comment #3)
...
> (In reply to Julien Nabet from comment #2)
> 
> That will not make any difference effect, since all commands _up to_ the
> kernel launch succeeded, so our problem is not the device name being too
> long...
Ok so can't help here, uncc myself.
Comment 5 Aron Budea 2025-08-17 12:27:58 UTC
(In reply to Eyal Rozenberg from comment #3)
> It has my two NVIDIA GPUs: "NVIDIA GeForce RTX 4060" and "NVIDIA GeForce GTX
> 1050 Ti". Is there anything specific you think could be relevant you want me
> to check?
Can you attach it nevertheless?
Comment 6 Eyal Rozenberg 2025-08-17 13:11:22 UTC
Created attachment 202365 [details]
opencl_devices.log on system exhibiting the issue

As requested.