Closed Bug 1676883 Opened 1 year ago Closed 1 year ago

Add GPU detection via libpci

Categories

(Core :: Graphics, defect, P3)

Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 1 open bug, Regressed 2 open bugs)

Details

Attachments

(1 file)

We should try to detect GPUs via libpci. This allows us to go from a Mesa DRI driver to a vendor ID, and from there to a device ID without relying upon GLX. This also allows us to detect secondary GPUs.

Summary: Add GPU detecting via libpci → Add GPU detection via libpci

There are a few scenarios in which we may have difficulty determining
the exact GPU that a user has with Linux/BSD. We might not have access
to the GLX_EXT_query_renderer extension, either because it is
unavailable, or because we don't want to use GLX and cause the OS to
spin up XWayland. We would also like to detect when the user has
multiple GPUs, as this may be useful when diagnosing issues (e.g. one
GPU is slaved to another for output to the display on a laptop).

This looks really good and a nice alternative to https://gitlab.freedesktop.org/mesa/mesa/-/issues/2976

I'll just double check we now correctly detect things on Wayland without Xwayland.
https://treeherder.mozilla.org/jobs?repo=try&revision=e405358b172ad9f35d589cc6c30eb218fd196351

Blocks: 1640053

I'd love to have the EGL extensions to do it properly, but this will work in a pinch with what we have today. I wanted it anyways to be able to detect multiple GPUs for bug 1675768.

Any EGL extension would still take month or years to be available everywhere, so this is a nice solution to get around that.

Great to see it happens! I'm going to have 2 AMD GPU system soon so I'll test it there. It may also helps with VA-API playback on correct GPU when multiple GPU are used.

Awesome, I'll be landing this once we hit 85 since we are in the soft freeze.

Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bcb085493bbe
Detect GPUs with libpci if available. r=rmader
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

we don't want to use GLX and cause the OS to spin up XWayland

Don't forget that to actually avoid spinning Xwayland up (when it is available), you would have to change the condition in fire_glxtest_process, it is currently IsWaylandDisabled() || getenv("DISPLAY") || !wayland_egltest() i.e. if there is a $DISPLAY we go ahead with GLX and wake Xwayland up if it wasn't up already.

I can confirm that unset DISPLAY; ./mach run --temp-profile does auto-enable WebRender for me now \o/

See Also: → 1694258
See Also: → 1692024
Regressions: 1696691
Regressions: 1700601
See Also: → 1711027
You need to log in before you can comment on or make changes to this bug.