headless_shell, webgl, and problems with chrome://gpu

2,632 views
Skip to first unread message

Tim Sullivan

unread,
Sep 27, 2022, 12:30:18 PM9/27/22
to Chromium-dev
Hello,
My team is working on a build of headless_shell for Chromium to upgrade from 93.0.4577.0 => 106.0.5249.0. While running pages with webgl, we see performance issues that weren't present before the upgrade.

While running a page with webgl, we're seeing these warnings in the DevTools console:
[.WebGL-0x400139e900]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels 
The launch arguments we are using are mentioned in this cross-post:  

I attempted to generate a PDF of chrome://gpu using --print-to-pdf. However, the result PDF is nearly empty except for a red pixel. While the browser is running the command, some errors are printed to the console. This problem is not present in our build of Chromium 93.

./headless_shell --headless --no-sandbox --print-to-pdf=out.pdf 'chrome://gpu'
[0921/215656.690167:INFO:content_main_runner_impl.cc(1204)] Chrome is running in full browser mode.
[0921/215656.696091:WARNING:child_process_launcher_helper_posix.cc(83)] Ignoring invalid file snapshot_blob.bin
[0921/215656.697934:ERROR:gl_display.cc(895)] EGL display query failed with error EGL_SUCCESS
[0921/215656.698080:ERROR:gl_display.cc(508)] EGL Driver message (Error) eglInitialize: display is EGL_NO_DISPLAY.
[0921/215656.698122:ERROR:gl_display.cc(920)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[0921/215656.698174:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[0921/215656.699934:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[0921/215656.702298:WARNING:child_process_launcher_helper_posix.cc(83)] Ignoring invalid file snapshot_blob.bin
[0921/215656.709852:ERROR:gl_display.cc(895)] EGL display query failed with error EGL_SUCCESS
[0921/215656.709999:ERROR:gl_display.cc(508)] EGL Driver message (Error) eglInitialize: display is EGL_NO_DISPLAY.
[0921/215656.710044:ERROR:gl_display.cc(920)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[0921/215656.710093:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[0921/215656.711900:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[0921/215656.718151:ERROR:gl_display.cc(895)] EGL display query failed with error EGL_SUCCESS
[0921/215656.718288:ERROR:gl_display.cc(508)] EGL Driver message (Error) eglInitialize: display is EGL_NO_DISPLAY.
[0921/215656.718333:ERROR:gl_display.cc(920)] eglInitialize Default failed with error EGL_BAD_DISPLAY
[0921/215656.718385:ERROR:gl_ozone_egl.cc(23)] GLDisplayEGL::Initialize failed.
[0921/215656.720108:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization
[0921/215656.723048:ERROR:gpu_init.cc(521)] Passthrough is not supported, GL is disabled, ANGLE is
[0921/215656.796952:INFO:headless_shell.cc(660)] Written to file out.pdf.
[0921/215656.804709:ERROR:process_posix.cc(343)] Unable to terminate process 589737: No such process (3)
[0921/215656.804784:WARNING:internal_linux.cc(67)] Failed to read /proc/589737/stat
[0921/215656.805644:WARNING:discardable_shared_memory_manager.cc(436)] Some MojoDiscardableSharedMemoryManagerImpls are still alive. They will be leaked.


I'm attaching the PDF creating using our 106 build and 93.0 builds. Also, build args and launch args are below.

Our goal is a headless_shell build for Linux x64 and arm64, which will run on containers with relatively low system RAM (2-8MB), no GPU, and without x11 installed. This will launch our application which features webgl for maps.

Regards,
 - Tim

Build args:
  • import("//build/args/headless.gn")
  • symbol_level = 0
  • is_debug = false
  • is_component_build = false
  • enable_nacl = false
  • enable_gpu_client_logging = true
  • enable_gpu_service_logging = true
  • use_kerberos = false
  • target_cpu = x64
Launch args:
  •  --disable-background-networking
  • --disable-default-apps
  • --disable-extensions
  • --disable-gpu
  • --disable-setuid-sandbox
  • --disable-sync
  • --disable-translate
  • --headless
  • --hide-scrollbars
  • --mainFrameClipsContent=false
  • --metrics-recording-only
  • --mute-audio
  • --no-first-run
  • --no-sandbox
  • --safebrowsing-disable-auto-update
  • --window-size=1950,1200
chromium-gpu-106.pdf
chromium-gpu-93.pdf

Ken Russell

unread,
Oct 6, 2022, 8:45:40 PM10/6/22
to tsul...@elastic.co, graphics-dev
+graphics-dev , chromium-dev to bcc:

Hi Tim,

Apologies for taking so long to reply.

From the error logs it sounds like ANGLE is failing to initialize, which causes cascading errors breaking Chrome's graphics stack. In the environment you describe it sounds like you aren't expecting GPU acceleration for this content anyway - your about:gpu from Chrome 93 is using SwiftShader.

It's not clear whether you're passing these command line arguments, but don't pass "--use-gl=swiftshader-webgl" yourself. That will break Chrome's graphics stack at this point. You should only attempt to configure ANGLE's backends, but ANGLE is required, and --use-gl overrides it. Per http://crbug.com/1362848#c8 you can pass:

--use-angle=swiftshader

to force the use of SwiftShader, in case autodetection is failing. Hopefully that will get the browser to initialize.

I don't know whether headless Chrome will start up in an environment without x11. Wayland support is still underway as far as I know, but presumably you don't want that dependency either. Hopefully others on this list can advise more.

Hope this helps,

-Ken



--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/f700209b-c5bf-4037-943b-d3805ae7bc74n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages