[snap] Default ANGLE renderer doesn't work in headless mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
chromium-browser (Ubuntu) |
Fix Released
|
Medium
|
Olivier Tilloy |
Bug Description
I use a headless browser with Selenium to automate access to a WebGL-heavy site. The current Snap package of Chromium (Chromium 97.0.4692.99 snap) running on Ubuntu 20.04.3 LTS cannot use WebGL in headless mode.
I was able to use the same script with the Snap package previously, but unfortunately a lot of time has elapsed since I last tried it, so I'm not sure exactly when this issue first appeared. I believe that the implementation of headless WebGL has changed recently, so perhaps this is related.
I can can easily reproduce this issue in the terminal by attempting to open a WebGL test page in a headless browser. This outputs multiple errors:
$ chromium --headless "https:/
[0128/113614.
t could not be completed for implementation-
[0128/113614.
for implementation-
[0128/113614.
[0128/113614.
[0128/113614.
[0128/113614.
t could not be completed for implementation-
[0128/113614.
for implementation-
[0128/113614.
[0128/113614.
[0128/113614.
[0128/113614.
t could not be completed for implementation-
[0128/113614.
for implementation-
[0128/113614.
[0128/113614.
[0128/113614.
[0128/113614.
When I ran a script to use selenium to save the output of this webpage, it reported that WebGL was disabled. (Using the screenshot option, which I was previously unaware of, should provide the same result.)
I have confirmed that the identical version of Google Chrome (installed from the .deb package on Google's website) works, and so does a slightly older version of Chromium from a .deb package installed from a PPA. The executables from these packages do not produce the errors above, and WebGL works correctly in headless mode.
While searching for these error messages I found various bug reports for similar WebGL-related problems. I noticed that some of the suggested solutions referred to library files which are installed by the working packages but not by the Snap package (for example libvk_swiftshad
I can confirm the problem.
If I run with the "--use- gl=swiftshader- webgl" command-line option, I can get WebGL to work in headless mode (as suggested in https:/ /bugs.chromium. org/p/chromium/ issues/ detail? id=1209250).
Can you confirm this works around the problem for you too?