[Intel-gfx] [igt-dev] [RFC i-g-t 0/5] User friendly lsgpu/intel_gpu_top device listing

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Nov 16 13:08:07 UTC 2020


On 13/11/2020 16:27, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Please see individual path commit messages for details, but essentially I
> implemented this:
> 
> $ sudo tools/lsgpu
> card1                   8086:4905    drm:/dev/dri/card1
> └─renderD129                         drm:/dev/dri/renderD129
> card0                   8086:3E98    drm:/dev/dri/card0
> └─renderD128                         drm:/dev/dri/renderD128
> 
> $ sudo tools/lsgpu --pci
> card1                   8086:4905    pci:vendor=8086,device=4905,card=0
> └─renderD129
> card0                   8086:3E98    pci:vendor=8086,device=3E98,card=0
> └─renderD128
> 
> $ sudo tools/lsgpu --sysfs
> card1                   8086:4905    sys:/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:01.0/0000:03:00.0
> └─renderD129                         sys:/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:01.0/0000:03:00.0/drm/renderD129
> card0                   8086:3E98    sys:/sys/devices/pci0000:00/0000:00:02.0
> └─renderD128                         sys:/sys/devices/pci0000:00/0000:00:02.0/drm/renderD128
> 
> I need to find a machine with two GPUs of the same device id to finish testing
> this hence still RFC.

I mock tested the PCI card index generating code and it seems to work fine:

$ tools/lsgpu --pci
card0                   8086:193B    pci:vendor=8086,device=193B,card=0
├─renderD128
└─renderD128
card0x                  8086:193B    pci:vendor=8086,device=193B,card=1
├─renderD128
└─renderD128

Regards,

Tvrtko

> Tvrtko Ursulin (5):
>    intel_gpu_top: User friendly device listing
>    lsgpu: User friendly device listing
>    lib/igt_device_scan: Remember PCI card index after scanning
>    lsgpu: Add filter type print-out selection
>    intel_gpu_top: Default GPU list to PCI mode
> 
>   lib/igt_device_scan.c | 205 +++++++++++++++++++++++++++++++++++++-----
>   lib/igt_device_scan.h |  16 +++-
>   tools/intel_gpu_top.c |   8 +-
>   tools/lsgpu.c         |  38 ++++++--
>   4 files changed, 233 insertions(+), 34 deletions(-)
> 


More information about the Intel-gfx mailing list