Bug 154533 - OpenCL: Libreoffice wont start / crash with OpenCL enabled if you have multiple GPUs (Intel+Nvidia) and have dGPU disabled
Summary: OpenCL: Libreoffice wont start / crash with OpenCL enabled if you have multi...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OpenCL Crash
  Show dependency treegraph
 
Reported: 2023-04-01 05:12 UTC by makedir
Modified: 2023-11-12 13:24 UTC (History)
3 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 makedir 2023-04-01 05:12:01 UTC
Just wanted to open an odt file today, and noticed Libreoffice doesnt open anymore. It worked some weeks ago still. I restarted PC, doesnt fix. I updated to LibreOffice_7.5.2_Win_x86-64, doesnt fix (could be it auto updated to 7.5.2 and that broke it). I uninstalled and reinstalled LibreOffice_7.5.2_Win_x86-64, doesnt fix. I deleted my profile under %APPDATA%\Libreoffice, doesnt fix. I started it in safe mode via command line " start soffice.exe --safe-mode " and did a revert back to factory settings, doesnt fix. Safe mode starts, but the moment it starts in normal mode again, it crashes after bootload GUI.

Found out, it seems to be related to dual GPU sytemes, I have Intel UHD 630 + Nvidia GTX1050 on my laptop, and have disabled the Nvidia card in control panel. This worked before with no problem.

I selected libreoffice writer under Windows 11 settings to just open with Intel GPU, doesnt fix.

Disabling OpenCL under libreoffice settings fixes the issue.

Windows 11 22h2 22621.1485
Intel drivers 31.0.101.2115
Nvidia drivers 31.0.15.3141
Comment 1 Julien Nabet 2023-04-01 07:49:11 UTC
Could you follow https://wiki.documentfoundation.org/QA/FirstSteps#Graphics-related_issues_(_Skia_) and provide skia.log if LO still crashes?
Comment 2 makedir 2023-04-01 07:57:22 UTC
Content of skia.log which was just created moments ago, after crash (with OpenCL enabled again, and Nvidia card disabled in device manager):

RenderMethod: vulkan
Vendor: 0x8086
Device: 0x3e9b
API: 1.3.215
Driver: 0.404.2115
DeviceType: integrated
DeviceName: Intel(R) UHD Graphics 630
Denylisted: no

The LO loading GUI shows and then crashes / not opening.
Comment 3 Julien Nabet 2023-04-01 08:30:26 UTC
Thank you for your feedback.

Here's a patch to prevent this:
https://gerrit.libreoffice.org/c/core/+/149901
It's just a workaround since it forces LO to not use hardware Skia rendering for Intel and this device in peculiar.
Comment 4 makedir 2023-04-01 09:42:44 UTC
Why is this a workaround? I want working HW acceleration, the issue is not the Intel GPU from what I see, but a bug in LO, that it crashes if you have 2 GPUs but disable one in device manager, no?
Comment 5 Julien Nabet 2023-04-01 09:52:10 UTC
(In reply to makedir from comment #4)
> Why is this a workaround? I want working HW acceleration, the issue is not
> the Intel GPU from what I see, but a bug in LO, that it crashes if you have
> 2 GPUs but disable one in device manager, no?

It's a workaround since it will prevent LO from crashing but it doesn't fix the pb per se.

The bug can be in:!
- LO implementation of Skia
- Skia itself
- graphic driver
- Windows driver

I have no knowledge of Skia so can't help more.
I can abandon the patch if you want, for the rest you can:
- wait for someone to work on fixing this
- try to fix this yourself if you know programming (https://wiki.documentfoundation.org/Development/GetInvolved may help)
- pay someone to fix this
Comment 6 makedir 2023-04-01 09:53:45 UTC
Is there no log which indicates why the crash is happening?
Comment 7 Julien Nabet 2023-04-01 10:00:15 UTC
(In reply to makedir from comment #6)
> Is there no log which indicates why the crash is happening?

You can try https://wiki.documentfoundation.org/QA/BugReport/Debug_Information#Windows:_How_to_get_a_backtrace
Comment 8 Julien Nabet 2023-04-01 10:15:19 UTC
BTW the crash report doesn't work? (https://help.libreoffice.org/latest/lo/text/shared/guide/error_report.html)
Comment 9 makedir 2023-04-01 10:30:07 UTC
There is no crash log or report it seems, LO just closes with no crash.
Comment 10 Julien Nabet 2023-04-01 10:32:29 UTC
You can also try to find some logs with eventvwr command.
Comment 11 makedir 2023-04-01 10:37:25 UTC
Ok the crash is logged by Windows:

Beschreibung
Name der fehlerhaften Anwendung: soffice.bin, Version: 7.5.2.2, Zeitstempel: 0x641f1dfd
Name des fehlerhaften Moduls: nvopencl64.dll, Version: 31.0.15.3141, Zeitstempel: 0x6413a5d6
Ausnahmecode: 0xc0000409
Fehleroffset: 0x0000000000578864
ID des fehlerhaften Prozesses: 0x0x1A74
Startzeit der fehlerhaften Anwendung: 0x0x1D96485424F6D92
Pfad der fehlerhaften Anwendung: C:\Program Files\LibreOffice\program\soffice.bin
Pfad des fehlerhaften Moduls: C:\WINDOWS\System32\DriverStore\FileRepository\nvdmig.inf_amd64_14e87c1a49e007a7\nvopencl64.dll
Berichtskennung: dc1c1ce7-7340-4886-a3b3-e2eeab125da7
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: 

100% bug in LO, it seems to want to access nvdmig which is nvidia driver, but the device is disabled => bug.

Seems to be badly coded in LO, that it doesnt properly checks, if a GPU is loaded. A simple GPU0/GPU1 option in LO options would mostly fix this.
Comment 12 Julien Nabet 2023-04-01 10:42:13 UTC
Ok, let's put this one to NEW since you provided some logs.
I abandoned the patch since you would like to use hardware rendering.
Uncc myself since I can't help here.
Comment 13 V Stuart Foote 2023-04-01 16:16:58 UTC
So the issue is not with Skia rendering at all.

"Disabling OpenCL under libreoffice settings fixes the issue.

Windows 11 22h2 22621.1485
Intel drivers 31.0.101.2115
Nvidia drivers 31.0.15.3141

nvopencl64.dll"

Also "disabled the Nvidia card in control panel" or "device manager" does not mean the nVidia GPU is actually disabled, nVidia Optimus is kind of annoying. Likewise AMDs Enduro/PowerXpress. 

So does your mixed GPU laptop work correctly when you actually allow LibreOffice to use the nVidia GPU for OpenCL.

Otherwise this seems related if not duplicate of long present bug 105084
Comment 14 makedir 2023-04-01 16:23:01 UTC
LO uses the Nvidia card, even if you set Windows 11 graphics setting to Intel GPU, this is the first bug in LO. It seems to want to force use dGPU, even it shouldnt, second bug seems to be, it wants to access the Nviddia driver, even it is not loaded (disabled in device manager). This is the only software I know of yet, which causes an issue. It seems there is some hard coded code in LO, which wants to use the Nvidia card, without proper checks. It should use the Windows setting, also there is no setting in LO, to say just use iGPU not dGPU.
Comment 15 makedir 2023-04-01 16:28:00 UTC
Using HW acc and also using Skia under settings work fine, with OpenCL disabled. The moment you tick use OpenCL it crashes on start.
Comment 16 V Stuart Foote 2023-04-01 17:11:20 UTC
(In reply to makedir from comment #15)
> Using HW acc and also using Skia under settings work fine, with OpenCL
> disabled. The moment you tick use OpenCL it crashes on start.

So what happens with the nVidia dGPU enabled and selected, not setting os via control center for LibreOFfice to be a low demand user of Intel iGPU?

Otherwise seems reasonable. When Use OpenCL is checked enabled, LO does check for OpenCL devices, if the os is reporting one or more OpenCL devices LO will enumerate and attempt to use. The fact LO is seeing a nVidia OpenCL device means the os is reporting it!  Hence my ping of nVidia's Optimus.

Kind of a corner case, but if you want to poke at LOs handling further you'll need to install WinDbg and download the symbols library.  Then attach to the soffic.bin while launching and capture the thread and stack trace.

The WiKi notes [2]  are a bit dated and don't include Win11 but essentially the same process. Get the Win11 SDK [3]. Download the LO symbols [4] while setting it up.  The "!Analyze" WinDbg command might help, but best to just dump the thread and stack trace at crash with "~* kp" save the output and attach--having the symbols helps identify the faulting calls and gives the devs a place to start looking at the OpenCL handling logic.

=-ref-=
[1]  or toggle from false to true in profile registrymodifications.xcu "<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="UseOpenCL" oor:op="fuse"><value>false</value></prop></item>"

[2] https://wiki.documentfoundation.org/How_to_get_a_backtrace_with_WinDbg
[3] https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
[4] use this local Symbol Files path (good to keep 32bit and 64 bit symbols apart):

CACHE*C:\symbols64;SRV*http://dev-downloads.libreoffice.org/symstore/symbols;SRV*http://msdl.microsoft.com/download/symbols
Comment 17 V Stuart Foote 2023-04-01 17:44:43 UTC
I guess the other question is why enable OpenCL? 

You do know it is only helpful in recalculation of large spread sheets, i.e. formula groupings of over 100 formulas.  OpenCL has nothing to do with LO UI and document canvas rendering by GPU. 

Do you work with large spread sheets?
Comment 18 QA Administrators 2023-10-12 03:17:20 UTC Comment hidden (obsolete)
Comment 19 QA Administrators 2023-11-12 03:13:42 UTC
Dear makedir,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp