question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot enable GPU acceleration

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.9.0
  • Platform / OS version: Linux version 4.15.0-39-generic (buildd@lgw01-amd64-054) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3))
  • Node.js version: v10.10.0

What steps will reproduce the problem?

  1. Run code given below that opens chrome://gpu page + takes screenshot
const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({ args: ['--headless'] });
    const page = await browser.newPage();
    await page
        .goto('chrome://gpu', { waitUntil: 'networkidle0', timeout: 20 * 60 * 1000 })
        .catch(e => console.log(e));
    await page.screenshot({
        path: 'gpu_stats.png'
    });
    await browser.close();
})();
  1. View resulting gpu_stats.png screenshot

What is the expected result?

Same result as in Chrome browser, in my case:

gpu_stats_local

What happens instead?

This is the resulting screenshot:

gpu_stats

I’m mainly concerned with the WebGL: Software only, hardware acceleration unavailable vs. WebGL: Hardware accelerated but at reduced performance, as I would like GPU acceleration for OpenGL rendering.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
goofivacommented, Sep 13, 2021

–use-gl=desktop didn’t work for me. This did.

  const browser = await puppeteer.launch({
    headless: true,
    args: [
        '--use-gl=egl'
    ]
  });
5reactions
aslushnikovcommented, Dec 13, 2018

@giokara Chrome headless currently relies on software WebGL by default. You can override this using the --use-gl=desktop flag; for example, the following works for me:

const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({
      headless: true,
      args: ['--use-gl=desktop'],
    });
    const page = await browser.newPage();
    await page
        .goto('chrome://gpu', { waitUntil: 'networkidle0', timeout: 20 * 60 * 1000 })
        .catch(e => console.log(e));
    await page.screenshot({
        path: 'gpu_stats.png'
    });
    await browser.close();
})();

More on the --use-gl flag could be found in Chromium sources: https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?type=cs&q=kUseGL&sq=package:chromium&g=0&l=69

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't Enable GPU Rendering/ Acceleration In Premiere
Solved: Hello! I'm here to ask, So I have Adobe Premiere CC 2019 and i Used to use the GPU rendering, But Suddenly...
Read more >
This Effect Requires GPU Acceleration in Premiere Pro ...
This Effect Requires GPU Acceleration in Premiere Pro? Check 8 Workable Methods · Method 2. Update Graphics Driver · Method 3. Save as...
Read more >
How to enable Windows 10 hardware accelerated GPU ...
To enable hardware accelerated GPU scheduling on Windows 10, use these steps: Open Start Menu and tap on Settings cog icon.
Read more >
Fix: This Effect Requires GPU Acceleration | SoftwareKep.com
Method 1. Change Mercury GPU Acceleration in Your Project Settings · Method 2. Change the Order of Effects on Your Clip(s) · Method...
Read more >
I cannot enable NVIDIA hardware acceleration - Movavi Support
To enable NVIDIA hardware acceleration in the newer versions of converter/editor/screen recorder, try installing the latest available driver for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found