Skip to content

Unblock hardware acceleration for Intel Arc GPUs - #546

Open
RytoEX wants to merge 2 commits into
obsproject:masterfrom
RytoEX:unblock-intel-arc
Open

RytoEX wants to merge 2 commits into
obsproject:masterfrom
RytoEX:unblock-intel-arc

Conversation

@RytoEX

@RytoEX RytoEX commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Description

The Intel entry in the blocklist here was intended for iGPUs because they could not handle browser hardware acceleration. Intel Arc GPUs are performant enough that they can run browser hardware acceleration. Do an additional check for those so that they can take advantage of hardware acceleration.

As a trivial cleanup, unwrap this logged string.

Motivation and Context

Want to unblock browser hardware acceleration on Intel Arc GPUs.

Simple testing with a FishGL page with 5000 fish at 1920x1080@30 shows reduced GPU utilization when checked in Task Manager on an Intel Arc GPU with this patch.

Metric Before After
GPU 3D 46% 12%
GPU Copy 6% 5%
Process GPU% Before GPU% After
obs-browser-page.exe 28% 10%
obs64.exe 20% 6%

How Has This Been Tested?

Tested on Windows 11 with an Intel Arc A770M. Would welcome more testing.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Comment thread obs-browser-plugin.cpp Outdated
Comment on lines +688 to +700
static void check_hwaccel_support(void)
{
/* do not use hardware acceleration if a blacklisted device is the
* default and on 2 or more adapters */
const wchar_t **device = blacklisted_devices;

if (adapterCount >= 2 || !is_intel(deviceId)) {
const bool isIntelArc = is_intel_arc(deviceId);
while (*device) {
if (!!wstrstri(deviceId.c_str(), *device)) {
if (!!wstrstri(deviceId.c_str(), *device) && !isIntelArc) {
hwaccel = false;
blog(LOG_INFO, "[obs-browser]: "
"Blacklisted device "
"detected, "
"disabling browser "
"source hardware "
"acceleration.");
blog(LOG_INFO,
"[obs-browser]: Blacklisted device detected, disabling browser source hardware acceleration.");

@Warchamp7 Warchamp7 Oct 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is getting ugly enough it's worth pulling the check out into it's own function, which also gives us an excuse to update it to a range loop too.

Suggested change
static void check_hwaccel_support(void)
{
/* do not use hardware acceleration if a blacklisted device is the
* default and on 2 or more adapters */
const wchar_t **device = blacklisted_devices;
if (adapterCount >= 2 || !is_intel(deviceId)) {
const bool isIntelArc = is_intel_arc(deviceId);
while (*device) {
if (!!wstrstri(deviceId.c_str(), *device)) {
if (!!wstrstri(deviceId.c_str(), *device) && !isIntelArc) {
hwaccel = false;
blog(LOG_INFO, "[obs-browser]: "
"Blacklisted device "
"detected, "
"disabling browser "
"source hardware "
"acceleration.");
blog(LOG_INFO,
"[obs-browser]: Blacklisted device detected, disabling browser source hardware acceleration.");
static inline bool is_blacklisted_device(const std::wstring &deviceId)
{
if (is_intel_arc(deviceId)) {
return false;
}
for (const wchar_t **device = blacklisted_devices; *device; ++device) {
if (wstrstri(deviceId.c_str(), *device)) {
return true;
}
}
return false;
}
static void check_hwaccel_support(void)
{
/* do not use hardware acceleration if a blacklisted device is the
* default and on 2 or more adapters */
const bool shouldCheckBlacklist = adapterCount >= 2 || !is_intel(deviceId);
if (shouldCheckBlacklist && is_blacklisted_device(deviceId)) {
hwaccel = false;
blog(LOG_INFO,
"[obs-browser]: Blacklisted device detected, disabling browser source hardware acceleration.");
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied this suggestion.

@RytoEX
RytoEX force-pushed the unblock-intel-arc branch from bb8097a to 6d62d46 Compare October 30, 2026 16:59
@RytoEX

RytoEX commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Rebasing first.

Use a ranged-for instead of a while loop.

As a trivial cleanup, unwrap this logged string.
The Intel entry in the blocklist here was intended for iGPUs because
they could not handle browser hardware acceleration. Intel Arc GPUs are
performant enough that they can run browser hardware acceleration. Do an
additional check for those so that they can take advantage of hardware
acceleration.
@RytoEX
RytoEX force-pushed the unblock-intel-arc branch from 6d62d46 to 636d1dc Compare October 30, 2026 17:39
@RytoEX

RytoEX commented Oct 30, 2026 •

Copy link
Copy Markdown
Member Author

Applied the suggested changes.

Simple testing with a FishGL page with 5000 fish at 1920x1080@30 shows reduced GPU utilization when checked in Task Manager on an Intel Arc GPU with this patch.

Metric Before After
GPU 3D 46% 12%
GPU Copy 6% 5%
Process GPU% Before GPU% After
obs-browser-page.exe 28% 10%
obs64.exe 20% 6%

Someone with a non-Intel Arc system should test to make sure that the refactored code works as expected.

Comment thread obs-browser-plugin.cpp
Comment on lines +697 to +713
static inline bool is_intel_arc(const std::wstring &str)
{
return wstrstri(str.c_str(), L"Intel(R) Arc") != 0;
}

static inline bool is_blacklisted_device(const std::wstring &deviceId)
{
if (is_intel_arc(deviceId)) {
return false;
}
for (const wchar_t **device = blacklisted_devices; *device; ++device) {
if (wstrstri(deviceId.c_str(), *device)) {
return true;
}
}
return false;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functions with local visibility should be put in an anonymous namespace at the top of the file. Also inline should only be used in header files to resolve potential ODR violations.

Functions should be named isIntelArcGpu and isDeviceOnBlocklist, using camelCase per our code style guidelines.

Comment thread obs-browser-plugin.cpp
}
const bool shouldCheckBlacklist = adapterCount >= 2 || !is_intel(deviceId);
if (shouldCheckBlacklist && is_blacklisted_device(deviceId)) {
hwaccel = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it hwaccel is a magic global variable?

@WizardCM WizardCM added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants