Bug 105106 - LO should inform if and why it's unable to enable OpenCL
Summary: LO should inform if and why it's unable to enable OpenCL
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.2.1 rc
Hardware: x86-64 (AMD64) All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 160013 (view as bug list)
Depends on:
Blocks: OpenCL Options-Dialog
  Show dependency treegraph
 
Reported: 2017-01-04 18:10 UTC by k1349890
Modified: 2024-03-04 17:09 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description k1349890 2017-01-04 18:10:27 UTC
Description:
Unable to enable OpenCL. When I restart Libre Office to apply settings and go to settings I see "Enable OpenCL" tick in settings disabled.

Steps to Reproduce:
1. Open Libre Office app (i.e. Calc)
2. Go to settings and enable OpenCL
3. Restart Libre Office
4. Go to OpenCL settings

Actual Results:  
and see OpenCL tick disabled.

Expected Results:
it either should be enabled, or Libre Office should warn a user why can't it enable OpenCL. For example if it has some tests to test if OpenCL platform has needed features, if it doesn't it should show the kernel compilation log. But a much better approach is to have test results in OpenCL settings which will show what LibreOffice features will be OpenCL powered.


Reproducible: Always

User Profile Reset: No

Additional Info:
clinfo -l    
Platform #0: Clover
 `-- Device #0: AMD ****** (DRM 2.46.0 / 4.8.0-32-generic, LLVM 4.0.0)
Platform #1: Portable Computing Language
 `-- Device #0: pthread-Intel(R) *** CPU ***** @ ****GHz



User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Comment 1 Buovjaga 2017-01-05 10:55:55 UTC
I guess it would be helpful -> NEW
Comment 2 How can I remove my account? 2017-01-05 11:00:09 UTC
I would prefer if we wouldn't have any "Enable OpenCL" setting visible to the user at all. It should be something completely internal to LO. We have way too many settings. Too many settings is a sign of bad software. It only encourages folklore and placebo effects. "I changed this setting and now my LO is 20% faster!!!ELEVEN"
Comment 3 Roman Kuznetsov 2022-09-02 07:54:56 UTC
I don't think it's an enhancement, it's a clear bug when user don't see why he/she can't enable OpenCL option 

And it's still repro in

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3e544b6938ee509a4f6df4c2e2996d71ce072506
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded

And I would agree with Tor, if OpenCL would be enabled by default, but today it is impossible (or may be I'm wrong? and may be after Lubos's patches current situation will be improved?)
Comment 4 Mike Kaganski 2022-09-02 08:08:54 UTC
Unless we can have Calc unit tests routinely run with OpenCL enabled on multiple platforms and with multiple drivers in CI, so that users would have no reason to disable e.g. to avoid wrong calculation results or crashes because of bad OpenCL driver version, the option to disable it should be available to users (and in this case, the problem of "bad software" is not entirely on LibreOffice side).

But I agree that the reason why the setting was disabled should be available (e.g., a "test log" button next to the checkbox could be activated when there are last test results somewhere in the user profile).
Comment 5 Stéphane Guillou (stragu) 2024-03-04 03:33:44 UTC
*** Bug 160013 has been marked as a duplicate of this bug. ***
Comment 6 Stéphane Guillou (stragu) 2024-03-04 03:38:30 UTC
From my duplicate:

-------

Since 5.3[1], we have automatic tests to decide if OpenCL is safe to use.

However, the user is not informed of if and why "Tools > Options > LibreOffice > OpenCL > Allow use of OpenCL" was turned off after turning it on and restarting - regardless of the reason (tests failed, not on device whitelist, OpenCL not installed...).
The only way to find out it was actually turned back off is to go back to the dialog.

We don't want to bother the user with too much information, but silently turning off what the user turned on is poor UX (and makes troubleshooting difficult).

We have reports about this issue:
- bug 103580 on macOS
- bug 106162 on Linux
- bug 133449 on Windows

And on ask.LO:
- https://ask.libreoffice.org/t/opencl-could-not-be-enabled/25011
- https://ask.libreoffice.org/t/unable-to-activate-opencl/45714

If the option remains exposed in the UI[2], the UX needs improving. Because OpenCL might be updated (or even just installed!) after LO was installed, I think it's OK to keep the workflow of automatically turning off after a check. However, we'd also need:
- so the user is aware that it did not work, a dialog at startup with the message:

"OpenCL was turned off because:
<reason XYZ>"

- In the Options dialog, a message like:

"Last attempt to use OpenCL failed: <reason XYZ>."

A link to a full log of failed tests would also be useful (similar to what we have for Skia since 7.6 for bug 155070). We have relevant user profile files opencl_profile.xml and opencl_devices.log[3], but I understand they are only available if OpenCL was able to be used.

Easy access to a short error message, + a full log with useful info, would be useful for the user to solve the issue themself (e.g. OpenCL not installed) or for QA to more efficiently troubleshoot.

[1]: https://meeksfamily.uk/~michael/blog/2017-02-01-under-the-hood-5-3.html
[2]: because of poor support on e.g. macOS, it has been suggested to remove the option from the GUI. See bug 103580 comment 12
[3]: see 8d3dd678bf9fd50a736cc0ff956f1efd7e660502 for bug 99453, and https://wiki.documentfoundation.org/QA/FirstSteps#Computation-related_issues_in_Calc_(_OpenCL_)