From bee292579a4c56a9a66baa478ed9bf2afb281c5a Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Tue, 29 Apr 2025 17:02:01 +0200 Subject: [PATCH] Disable GPU when running headless On FreeBSD this prevents a failure when building with Qt 6.9 Adding the env only if `isbsd`, but this could be needed for other OSes too. --- src/calibre/gui2/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 5d30fd3fbd..d374b90f8c 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -1619,6 +1619,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: + os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = '--disable-gpu' if ismacos: os.environ['QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM'] = '1' if headless and iswindows: