Try disabling webengine GPU acceleration unconditionally

It doesnt make any significant performance difference for ebooks and
might fix crashes/blackscreen on some older Windows systems.
This commit is contained in:
Kovid Goyal 2026-01-05 08:54:45 +05:30
parent 2096c0b7f3
commit e5c811e8bb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 17 deletions

View File

@ -895,18 +895,6 @@ see which one is causing the issue. Basically, stop a program, run calibre,
check for crashes. If they still happen, stop another program and repeat.
The calibre E-book viewer and Edit book tools do not work on Windows?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These two programs use hardware acceleration as they embed a version of the
Chrome browser to render HTML. If they do not work it will be because of
incompatibility with your system's GPU (graphics) drivers. Try updating these
first, and reboot. If that does not fix it, you can set the
``QTWEBENGINE_CHROMIUM_FLAGS`` environment variable to the value
``--disable-gpu`` to turn off hardware acceleration. See
`this page <https://doc.qt.io/qt-6/qtwebengine-debugging.html>`_ for details.
Using the viewer or doing any conversions results in a permission denied error on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1219,6 +1219,9 @@ class Application(QApplication):
args.extend(('-platformpluginpath', plugins_loc, '-platform', os.environ.get('CALIBRE_HEADLESS_PLATFORM', 'headless')))
else:
args.extend(self.palette_manager.args_to_qt)
# We disable GPU acceleration as it causes crashes/black screen in some Windows systems and
# isnt really needed for performance for our use cases.
args += ['--webEngineArgs', '--disable-gpu']
self.headless = headless
from calibre_extensions import progress_indicator
self.pi = progress_indicator
@ -1599,11 +1602,8 @@ def ensure_app(headless=True):
has_headless = ismacos or islinux or isbsd
if headless and has_headless:
args += ['-platformpluginpath', plugins_loc, '-platform', os.environ.get('CALIBRE_HEADLESS_PLATFORM', 'headless')]
if isbsd:
val = os.environ.get('QTWEBENGINE_CHROMIUM_FLAGS', '')
if val:
val += ' '
os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = f'{val}--disable-gpu'
# WebEngine GPU not needed in headless mode
args += ['--webEngineArgs', '--disable-gpu']
if ismacos:
os.environ['QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM'] = '1'
if headless and iswindows: