Hey guys.
I'm trying to create a pdf of a page that contains webgl content (a map with some stuff on top of it)
It doesn't work with the normal current flags. I'm getting
trimblemaps-3.4.0.js:35 Error: Failed to initialize WebGL
I've checked chrome://gpu
and WebGL
WebGL2
is disabled.
(I've set the headless
flag to false so i could see the window through xquartz and debug easier)
I've opened an issue on chromedp because I initially assumed it was on their side
Made a playground to experiment different flags (mainly --use-gl
& --use-angle
).
https://github.com/robiXxu/chromedp-playground
The goal was to get WebGL working with swiftshader
(since gotenberg is running in a docker container and don't have access to a gpu)
A contributer (Zekelu) pointed in the right direction and I was able to render webgl content inside my playground
I tried to do the same thing in gotenberg however I'm not able to get webgl supported with the same flags.
I assumed that we need to install something and tried including mesa-utils & related packages in the Dockerfile as it was sugested by people on other packages which encountered the same issue
( eg https://github.com/DevExpress/testcafe/issues/2116 , https://github.com/accetto/headless-drawing-g3/blob/master/docker/xfce/README.md#using-openglwebgl-and-hw-acceleration )
apt-get install cmake pkg-config mesa-utilslibglu1-mesa-dev freeglut3-dev mesa-common-dev libglew-dev libglfw3-dev libglm-dev libao-dev libmpg123-dev -y &&\
But after a lot of trial and error I've figured that it might be time to open an issue and ask others if they found themselves in the same situation and how they overcome it?