Closed Bug 1649490 Opened 5 years ago Closed 5 years ago

Detect / enumerate all GPUs on macOS, not just the GPU that was active during Firefox startup

Categories

(Core :: Graphics, defect, P3)

All
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: mstange, Assigned: bpeers)

References

Details

Attachments

(1 file)

On Macs with multiple GPUs, we currently only report one GPU in about:support and in telemetry: The GPU that was active while Firefox started.

This is giving us an incomplete picture in telemetry and it makes it hard to make decisions during WebRender initialization that are based on all available GPUs.

The current method of obtaining the GPU information also uses a deprecated method and causes a compiler warning (bug 1024731):

33:24.02 /Users/mstange/code/mozilla/widget/cocoa/GfxInfo.mm:81:34: warning: 'CGDisplayIOServicePort' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
33:24.03   io_registry_entry_t dsp_port = CGDisplayIOServicePort(kCGDirectMainDisplay);
33:24.03                                  ^
33:24.03 /Users/mstange/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:372:24: note: 'CGDisplayIOServicePort' has been explicitly marked deprecated here
33:24.03 CG_EXTERN io_service_t CGDisplayIOServicePort(CGDirectDisplayID display)
33:24.03                        ^

We should fix this to use different APIs and enumerate all GPUs. Chrome has a GetPCIDevices function that we can probably mostly copy. And then we need to report the information from the GetAdapter[...]2() methods. I wonder if it's necessary to enforce a consistent sort order.

Since this will report different data to telemetry than before, it might shift some numbers in some dashboards. I don't know what the impact of that will be.

Severity: -- → S3
Priority: -- → P3

Should a single GfxInfo contain an array of mAdapterVendorID ? Or do we continue to AppendPrintf into a single instance?
Or should there be an array of GfxInfo instances somewhere, one per device?
Or should all of this be moved into GfxDriverInfo?

If I switch the code over to use IOServiceMatching etc. instead, it reports the same device & vendor as the original code on my single GPU Mac. So that's good, I'm just not sure where all the info belongs now.

Thanks.

Flags: needinfo?(mstange.moz)

(In reply to Bert Peers [:bpeers] from comment #1)

Should a single GfxInfo contain an array of mAdapterVendorID ?

Yes, a single GfxInfo should have multiple mAdapter[...] members.
Windows already supports reporting two GPUs. It's a bit annoying that it's currently hardcoded to only 2 adapters. But if there's more than two (which should be extremely rare) it's probably fine to just report the first two. So rather than arrays we can have just two values for each field.

Look at this link if you haven't yet:

(In reply to Markus Stange [:mstange] from comment #0)

And then we need to report the information from the GetAdapter[...]2() methods.

Flags: needinfo?(mstange.moz)
Assignee: nobody → bpeers
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80

It's working! Here's what about:support shows on my machine now:

GPU #1
Active Yes
Vendor ID 0x8086
Device ID 0x191b
RAM 0
GPU #2
Active Yes
Vendor ID 0x1002
Device ID 0x67ef
RAM 0

Regressions: 1664843
Regressions: 1663361
No longer regressions: 1663361

This was backed out in bug 1664843 and will re-land in bug 1668145.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: