-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I enable WebGL testing? #1194
Comments
You're right that you won't be able to run this in Electron - however you should be able to run this in Chrome no problem. Can you install chrome or use our docker containers in CI? Then it should work with |
@brian-mann hmm I did try using chrome. I'll see if I can get an example repo up & running on public gitlab and report back |
@brian-mann yup you're right, Chrome works fine. It must be something in my config. See https://gitlab.com/zakhenry/cypress-bug/pipelines if you're interested, (attached screenshots below) |
@zakhenry @brian-mann I'm running into the same problem. I can't test WebGL components when using Electron. I would really like to continue to use Electron because of the video recording capability. The strange thing is, when running the test with Electron on an OSX host or in a Linux Virtual Machine, all the WebGL pieces work fine. It's only broken when running in a Docker container. My base image in Do you have any ideas why WebGL works in Electron on any OS that's not in Docker? |
@gkrizek we'll have a more comprehensive answer for you shortly - but the gist is this...
The reason GPU acceleration is disabled when running in linux is because linux is literally a shit-show of GPU support and Chromium itself has lots of fallbacks to detect incompatible drivers. The only consistent way for us to make Chrome / Chromium run was always turning off GPU support in linux. We can likely make a flag that partially enables this - but there is no guarantee it will work in the docker container, and will be affected by the underlying capabilities of the hardware. Docker / Linux running headlessly were not really designed for this use case - and the only workaround here may be to run it in OSX / Windows in CI with CircleCI or Appveyor. We're looking into this and will try to give you some guidance. As a footnote - we already enable I'll have more details for you once we do more research. It may be a simple fix after all, but possibly not. |
Hi @brian-mann! This is what I've tried: on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chrome') {
const index = args.indexOf('--disable-gpu');
if (index > -1) {
args.splice(index, 1);
}
args.push('--ignore-gpu-blacklist');
console.log(args);
return args;
}
}); And this is what is being logged when running in a Linux container:
But hardware acceleration is still not working 😞 |
I have the exact same issue. I tried a very similar approach, of adding
the code from chromium suggests |
This is a huge blocker for my team and I, as our tests only fail when running from containers (CodeFresh). Anyone have a work around for this yet? |
Any solution yet? Is it possible to use a Linux machine that supports GPU acceleration? As a workaround, I managed to run the WebGL tests on windows instances in EC2. The tests must be run in chrome. |
@rafael-anachoreta ’s solution actually worked for me to enable WebGL in chromium 73 I just edited module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chromium') {
const newArgs = args.filter(arg => arg !== '--disable-gpu')
newArgs.push('--ignore-gpu-blacklist')
return newArgs;
}
});
}; |
Has anyone had success enabling WebGL in electron using a similar workaround to the argument mangling? Setting |
Following cypress-io/cypress#1194 (comment) Work on #107.
Could you elaborate a bit how to make this work? I initialized Cypress for my project but the Attempting to run cypress with Chromium on Linux with WebGL support enabled. |
Is this a Feature or Bug?
Feature
Current behavior:
WebGL is not supported due to
app.disableHardwareAcceleration()
Desired behavior:
e2e testing of components with GPU accelerated WebGL components is possible.
How to reproduce:
Create a project with a webgl component (e.g. Three.js or Babylon.js) See that WebGL reports that it is disabled
The text was updated successfully, but these errors were encountered: