[igt-dev] [PATCH i-g-t 3/4] Introduce device selection lsgpu tool

Arkadiusz Hiler arkadiusz.hiler at intel.com
Mon Oct 28 11:21:48 UTC 2019


On Thu, Oct 24, 2019 at 02:06:18PM +0100, Chris Wilson wrote:
> Quoting Arkadiusz Hiler (2019-10-24 12:05:14)
> > From: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> > 
> > Tool uses device selection API to scan and display GPU devices.
> > It can be used to check filter correctness as well as order
> > of applying the filters (.igtrc, IGT_DEVICE and --device argument).
> 
> A couple of examples of use and output?

I put some of that in the cover letter, but yeah, we can add some more
here. (command output indented with 2 spaces for readability)


$ ./build/tools/lsgpu --help
  usage: lsgpu [options]

  Options:
    -p, --print-details         Print devices with details
    -v, --list-vendors          List recognized vendors
    -l, --list-filter-types     List registered device filters types
    -d, --device filter         Device filter, can be given multiple times
    -h, --help                  Show this help message and exit

$ ./build/tools/lsgpu
  sys:/sys/devices/pci0000:00/0000:00:02.0/drm/card0
      subsystem       : drm
      drm card        : /dev/dri/card0
      parent          : sys:/sys/devices/pci0000:00/0000:00:02.0

  sys:/sys/devices/pci0000:00/0000:00:02.0/drm/renderD128
      subsystem       : drm
      drm render      : /dev/dri/renderD128
      parent          : sys:/sys/devices/pci0000:00/0000:00:02.0

  sys:/sys/devices/platform/vgem/drm/card1
      subsystem       : drm
      drm card        : /dev/dri/card1
      parent          : sys:/sys/devices/platform/vgem

  sys:/sys/devices/platform/vgem/drm/renderD129
      subsystem       : drm
      drm render      : /dev/dri/renderD129
      parent          : sys:/sys/devices/platform/vgem

  sys:/sys/devices/pci0000:00/0000:00:02.0
      subsystem       : pci
      drm card        : /dev/dri/card0
      drm render      : /dev/dri/renderD128
      vendor          : 8086
      device          : 5927

  sys:/sys/devices/platform/vgem
      subsystem       : platform
      drm card        : /dev/dri/card1
      drm render      : /dev/dri/renderD129

$ ./build/tools/lsgpu -l
  Filter types:
  ---
  filter        syntax
  ---
  sys           sys:/sys/devices/pci0000:00/0000:00:02.0
                find device by its sysfs path

  drm           drm:/dev/dri/* path
                find drm device by /dev/dri/* node

  pci           pci:[vendor=%04x/name][,device=%04x][,card=%d]
                vendor is hex number or vendor name

$ ./build/tools/lsgpu -d pci:vendor=Intel
  Notice: Using --device filters
  === Device filter ===
  pci:vendor=Intel

  === Testing device open ===
  Device detail:
  subsystem   : pci
  drm card    : /dev/dri/card0
  drm render  : /dev/dri/renderD128
  Device /dev/dri/card0 successfully opened
  Device /dev/dri/renderD128 successfully opened
  -------------------------------------------

$ ./build/tools/lsgpu -d pci:vendor=intel
  Notice: Using --device filters
  === Device filter ===
  pci:vendor=intel

  === Testing device open ===
  Device detail:
  subsystem   : pci
  drm card    : /dev/dri/card0
  drm render  : /dev/dri/renderD128
  Device /dev/dri/card0 successfully opened
  Device /dev/dri/renderD128 successfully opened
  -------------------------------------------

$ ./build/tools/lsgpu -d pci:vendor=intel -p
  Notice: Using --device filters
  === Device filter ===
  pci:vendor=intel

  === Testing device open ===
  Device detail:
  subsystem   : pci
  drm card    : /dev/dri/card0
  drm render  : /dev/dri/renderD128
  Device /dev/dri/card0 successfully opened
  Device /dev/dri/renderD128 successfully opened

  ========== pci:/sys/devices/pci0000:00/0000:00:02.0 ==========
  card device                     : /dev/dri/card0
  render device                   : /dev/dri/renderD128

  [properties]
  DEVPATH                         : /devices/pci0000:00/0000:00:02.0
  DRIVER                          : i915
  FWUPD_GUID                      : 0x8086:0x5927
  ID_MODEL_FROM_DATABASE          : Iris Plus Graphics 650
  ID_PCI_CLASS_FROM_DATABASE      : Display controller
  ID_PCI_INTERFACE_FROM_DATABASE  : VGA controller
  ID_PCI_SUBCLASS_FROM_DATABASE   : VGA compatible controller
  ID_VENDOR_FROM_DATABASE         : Intel Corporation
  MODALIAS                        : pci:v00008086d00005927sv00008086sd00002068bc03sc00i00
  PCI_CLASS                       : 30000
  PCI_ID                          : 8086:5927
  PCI_SLOT_NAME                   : 0000:00:02.0
  PCI_SUBSYS_ID                   : 8086:2068
  SUBSYSTEM                       : pci
  USEC_INITIALIZED                : 22881171

  [attributes]
  ari_enabled                     : 0
  boot_vga                        : 1
  broken_parity_status            : 0
  class                           : 0x030000
  consistent_dma_mask_bits        : 39
  current_link_speed              : Unknown speed
  current_link_width              : 0
  d3cold_allowed                  : 1
  device                          : 0x5927
  dma_mask_bits                   : 39
  driver_override                 : (null)
  enable                          : 1
  firmware_node                   : LNXVIDEO:00
  index                           : 1
  irq                             : 129
  label                           :  CPU
  local_cpulist                   : 0-3
  local_cpus                      : f
  max_link_speed                  : Unknown speed
  max_link_width                  : 255
  msi_bus                         : 1
  numa_node                       : -1
  revision                        : 0x06
  subsystem                       : pci
  subsystem_device                : 0x2068
  subsystem_vendor                : 0x8086
  vendor                          : 0x8086

  -------------------------------------------

>  
> > v2 (Arek):
> >  * don't print chip as it's no longer there
> >  * make it a second patch, before any alterations to igt_core or drmtest
> >  * use only a single filter
> > 
> > Cc: Petri Latvala <petri.latvala at intel.com>
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>


More information about the igt-dev mailing list