Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Disable GPU with context manager #3660

Answered by mdmintz
oooyiyangc asked this question in Q&A
Discussion options

Hello! I'm working on a scraper, but it tends to freeze after a few successful iterations. In the past, when using Selenium directly, I found that adding the --disable-gpu option helped resolve similar issues. However, it seems that the SeleniumBase context manager doesn’t support disabling the GPU (as the following is being hardcoded).

sb_config.disable_gpu = None

I was wondering if there is any possible walkaround to this. Any help would be appreciated—thanks in advance!

You must be logged in to vote

It's already set by default when not using UC Mode:

chrome_options.add_argument("--disable-gpu")

You can add in custom Chromium args via chromium_arg, eg. SB(chromium_arg="--disable-gpu"), although note that UC Mode might not work properly when the GPU is disabled.

Replies: 1 comment 1 reply

Comment options

It's already set by default when not using UC Mode:

chrome_options.add_argument("--disable-gpu")

You can add in custom Chromium args via chromium_arg, eg. SB(chromium_arg="--disable-gpu"), although note that UC Mode might not work properly when the GPU is disabled.

You must be logged in to vote
1 reply
Comment options

Thank you!

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /