how can I identify which video card on a mutli-card linux box a display belongs to

Aaron Plattner aplattner at nvidia.com
Fri Nov 21 09:40:55 PST 2014


On 11/10/2014 12:56 AM, Chris Wilson wrote:
> On Mon, Nov 10, 2014 at 04:31:59PM +0800, Zhang Fan wrote:
>> Hi all,
>> I'm developing a video matrix system for Linux.  Typically multiple
>> vendors' video card and/or multiple cards of same vendor/model might
>> be used in one system.
>> I can list the display by using 'xrandr' program and read the
>> display card information from /sys/class/drm/ directory. But I can't
>> figure out how to relate these two kinds information. i.e, which
>> card/port does a display belongs to?
>> 'xrandr --verbose' command lists the 'Identifier' of each display
>> but it seems volatile and might change after reboot and has nothing
>> to do with the information in /sys/class/drm.
>
> If your devices support DRI2/DRI3, you can send a DRI request to query
> the device node for a screen. Might be a nice extension to xrandr
> --verbose, or perhaps a new dri[23]info.

Seems like that would make a pretty good standard property for RandR 
Provider objects.

In general, there's no 1-1 mapping from an X screen to a GPU.  E.g., 
with the NVIDIA driver with SLI enabled, multiple GPUs are used to 
render one screen.  With various forms of PRIME, multiple GPUs can be 
used to handle various aspects of rendering or scanout on a single X screen.

> -Chris

-- 
Aaron


More information about the xorg mailing list