Skip to content

Commit ebc151a

Browse files
linesightclaude
andcommitted
Add --in-process-gpu for Linux CI to fix OnContextInitialized timeout
The GPU subprocess is spawned during CefInitialize() and fails with "Failed global descriptor lookup: 7" because CEF 146 does not pass the field-trial shared-memory fd to subprocesses in --no-sandbox mode. This crash blocks OnContextInitialized from firing within the 6-second poll, so CreateBrowserSync() returns None. --in-process-gpu runs the GPU inside the browser process, eliminating the failing subprocess launch and unblocking initialization. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3d3effc commit ebc151a

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

unittests/main_test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,19 @@ def test_main(self):
144144
# Chrome 130+ blocks window.open() called without a user gesture.
145145
switches = {"disable-popup-blocking": ""}
146146
if LINUX:
147-
# Sandbox setup (user-namespace) fails on CI runners; GPU process
148-
# also needs --no-sandbox to launch successfully under xvfb.
147+
# Sandbox setup (user-namespace) fails on CI runners.
149148
switches["no-sandbox"] = ""
150149
# /dev/shm is too small in CI containers; renderer subprocess
151150
# fails shared-memory descriptor lookup (global descriptor 7).
152151
switches["disable-dev-shm-usage"] = ""
153-
# GPU acceleration is not available under xvfb; disabling it
154-
# reduces startup time and avoids GPU process launch failures.
152+
# GPU acceleration is not available under xvfb.
155153
switches["disable-gpu"] = ""
156154
switches["disable-gpu-compositing"] = ""
157-
# Zygote FD-passing fails in CI containers; launch renderers
158-
# directly from the browser process instead.
155+
# Run GPU process inside the browser process. Without this,
156+
# the GPU subprocess is spawned during CefInitialize() and
157+
# fails the global descriptor lookup (key 7), which prevents
158+
# OnContextInitialized from firing and browser creation fails.
159+
switches["in-process-gpu"] = ""
159160
switches["no-zygote"] = ""
160161
cef.Initialize(settings, switches=switches)
161162
subtest_message("cef.Initialize() ok")

unittests/osr_test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,16 @@ def test_osr(self):
113113
"disable-surfaces": "", # This is required for PDF ext to work
114114
}
115115
if LINUX:
116-
# Sandbox setup fails on CI runners; subprocess won't launch
117-
# without this under xvfb even with --disable-gpu.
116+
# Sandbox setup fails on CI runners.
118117
switches["no-sandbox"] = ""
119118
# /dev/shm is too small in CI containers; renderer subprocess
120119
# fails shared-memory descriptor lookup (global descriptor 7).
121120
switches["disable-dev-shm-usage"] = ""
122-
# Zygote FD-passing fails in CI containers; launch renderers
123-
# directly from the browser process instead.
121+
# Run GPU process inside the browser process so the GPU
122+
# subprocess is not spawned during CefInitialize() and does
123+
# not fail the global descriptor lookup that blocks
124+
# OnContextInitialized from firing.
125+
switches["in-process-gpu"] = ""
124126
switches["no-zygote"] = ""
125127
browser_settings = {
126128
# Tweaking OSR performance (Issue #240)

0 commit comments

Comments
 (0)