Skip to content
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

[Bug]: Unable to use vulkan for hardware acceleration in headless mode #12048

Closed
2 tasks
ruochenjia opened this issue Mar 5, 2024 · 4 comments
Closed
2 tasks

Comments

@ruochenjia
Copy link

Minimal, reproducible example

import puppeteer from "puppeteer";

const chrome = await puppeteer.launch({
	pipe: true,
	dumpio: true,
	channel: "chrome",
	product: "chrome",
	timeout: 10000,
	headless: false,
	handleSIGHUP: false,
	handleSIGINT: false,
	handleSIGTERM: false,
	protocolTimeout: 5000,
	defaultViewport: {
		width: 1280,
		height: 720,
		isMobile: false,
		hasTouch: false,
		isLandscape: true,
		deviceScaleFactor: 1
	},
	args: [
		// Flags for using vulkan is explicitly specified
		"--enable-gpu",
		"--use-vulkan"
	]
});

Error string

no error

Bug behavior

  • Flaky
  • PDF

Background

No response

Expectation

Hardware acceleration for the headless browser should be enabled, and use vulkan for rendering.

Reality

Hardware acceleration is enabled, but vulkan is disabled.

Screenshot for the browser instance at chrome://gpu:
image

Puppeteer configuration file (if used)

No response

Puppeteer version

22.4.0

Node version

20.11.1

Package manager

npm

Package manager version

10.5.0

Operating system

Linux

Copy link

github-actions bot commented Mar 5, 2024

This issue was not reproducible. Please check that your example runs locally and the following:

  • Ensure the script does not rely on dependencies outside of puppeteer and puppeteer-core.
  • Ensure the error string is just the error message.
    • Bad:

      Error: something went wrong
        at Object.<anonymous> (/Users/username/repository/script.js:2:1)
        at Module._compile (node:internal/modules/cjs/loader:1159:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
        at Module.load (node:internal/modules/cjs/loader:1037:32)
        at Module._load (node:internal/modules/cjs/loader:878:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:23:47
    • Good: Error: something went wrong.

  • Ensure your configuration file (if applicable) is valid.
  • If the issue is flaky (does not reproduce all the time), make sure 'Flaky' is checked.
  • If the issue is not expected to error, make sure to write 'no error'.

Once the above checks are satisfied, please edit your issue with the changes and we will
try to reproduce the bug again.


Analyzer run

@OrKoN
Copy link
Collaborator

OrKoN commented Mar 6, 2024

Could you try the instructions from https://developer.chrome.com/blog/supercharge-web-ai-testing ? It's possible that drivers are missing? If that does not work, please file a crbug.com/new for the Headless component.

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
@ruochenjia
Copy link
Author

ruochenjia commented Mar 6, 2024

@OrKoN The instructions worked for me, but the documentation in troubleshooting.md for enabling GPU in headless mode should be updated. Currently the only option specified in the documentation is --enable-gpu, which no longer works in the new headless mode.

@OrKoN
Copy link
Collaborator

OrKoN commented Mar 7, 2024

Updated in #12052 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants