Open rkunwar opened 2 years ago
It would be great to know how to run the hardware acceleration in windows and in linux in headless mode
This would be great to know as I'm doing the same thing and trying to run the tests in DevOps pipelines running on Ubuntu
Was anyone able to run with hardware acceleration enabled while in headless mode on Linux?
For those having issues with this on Windows, it worked for me using:
{
channel: "chrome",
args: [
"--use-angle=vulkan",
],
}
If that won't work, maybe tinker with these:
[
// "--enable-features=Vulkan,UseSkiaRenderer",
// "--use-vulkan=swiftshader",
// "--use-gl=swiftshader",
// "--ignore-gpu-blacklist",
// "--enable-unsafe-webgpu",
// "--disable-vulkan-fallback-to-gl-for-testing",
],
I'm on Ubuntu 22.04, I've tried different args but --enable-gpu
was the only one that allowed me to run WebGL in headless mode.
launchOptions: {
// Force hardware acceleration
args: ["--enable-gpu"],
}
https://peter.sh/experiments/chromium-command-line-switches/#enable-gpu
This configuration is working for me. Ubuntu 20.04
launchOptions: {
args: [
'--ignore-gpu-blocklist',
'--use-gl=angle',
'--use-angle=gl-egl',
],
},
This is not working now. Does any one have idea how do we enable hardware acceleration browser stack browsers when integrating with playwright?
We currently are writing a browser tests for our application that involves a heavy use of WebGL for rendering graphics. Running tests on '--headed' mode is all running fine, however when we want to run the tests on CI pipelines or even locally in '--headless' mode, we have issues with tests taking super long time to render graphics and leads to the test failure several times.
For now we have found a workaround that enables to use Hardware Acceleration on '--headless' mode by enabling this flag on MAC OSX.
await chromium.launch( {args: [ // This works in MAC '--use-gl=egl', '--use-gl=egl' ]},)
We are still facing the issue when it comes to the use in Windows as above browser launch arguments does not seem to work on Windows System.
This is very important for us to be able to run the tests on CI Pipeline as currently we are having to manually trigger the test on '--headed' mode on Windows systems.
I feel this will be useful for anyone running tests that involves the use of WebGL and heavy graphics. Other parts of application that do not use the WebGL is running fine on '--headless' mode.
I have attached the screenshots with the sample how long the difference is in running the tests.