-
-
Notifications
You must be signed in to change notification settings - Fork 208
Description
The current reason why epic-games is showing a captcha inside docker (#183) is due to OpenGL not working.
It's likely also the reason why the captcha can't be solved and always fails with 'Incorrect response'.
Likely also the reason why Docker was getting captchas before Playwright was detected.
You can compare chrome://gpu when running with and without Docker:
The results for without Docker are the same as on my native Chrome.
I thought websites can only use WebGL and not OpenGL directly, but maybe 'Software only' vs. 'Hardware accelerated' can be detected due to timing.
Now I don't know if it's an issue with Xvfb/X11 or Chrome arguments.
The added GLX extension for Xvfb (9988f39) and it also not working with TurboVNC (replaces both Xvfb and X11) would suggest it's a Chrome issue.
You can see all available arguments here: https://peter.sh/experiments/chromium-command-line-switches/
You can check the command line and all used arguments here: chrome://version
Patchright already adds many arguments (the screenshot also includes some I tried), my macOS Chrome just has this as Command Line:
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --flag-switches-begin --enable-experimental-web-platform-features --flag-switches-end
Now the question is which arguments are needed.
For example, Chrome whitelists GPUs (see here), but adding --ignore-gpu-blocklist
did not help.
Here's what I tried in somewhat different variations (e.g the different --use-gl
):
args: [
// '--hide-crash-restore-bubble',
'--no-first-run',
'--ignore-gpu-blocklist',
'--use-gl=desktop',
// '--use-gl=egl',
// '--use-gl=angle',
// '--use-angle=gl-egl',
// '--display=:1',
// '--use-gl=omesa',
'--enable-webgl',
'--disable-gpu-sandbox',
// '--no-sandbox',
// '--disable-software-rasterizer'
],
Perplexity gives nice overviews, but in the end it's just pulling random stuff together:
- https://www.perplexity.ai/search/i-m-always-getting-incorrect-r-bGeLI0GjTm2Zxvo_oEF3fQ#0
- https://www.perplexity.ai/search/how-can-i-fix-opengl-being-dis-WXL1vfBdQmiVNluc3V64nQ#0 tried these args, didn't change anything
Now it may be that you actually need to do GPU hardware passthrough, but I don't think so.
Xvfb should do it in software (CPU, not GPU) which should be fast enough on my M1 MBA.
Need to check if other programs can use OpenGL in the container:
- https://unix.stackexchange.com/questions/137567/glx-extension-not-working-properly-with-xvfb
Maybe OpenGL is not working in the browser due to some other unsupported feature. Could try Xdummy (Xdummy in Docker), but I think TurboVNC is a better replacement for Xvfb+X11. I tried it and it's much faster.