[igt-dev] [PATCH i-g-t 0/4] device selection && lsgpu
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Tue Dec 3 13:59:07 UTC 2019
On 02/12/2019 12:37, Arkadiusz Hiler wrote:
> On Tue, Nov 12, 2019 at 10:14:13AM +0000, Tvrtko Ursulin wrote:
>>
>> On 24/10/2019 12:05, Arkadiusz Hiler wrote:
>>> Hey,
>>>
>>> This series aims to make running IGT on hosts with multiple GPUs manageable
>>> without the need to unload modules / unbind devices.
>>>
>>> Suggested reviewing order:
>>> * lsgpu
>>> * igt_core && drm_test changes
>>> * implementation internals in igt_device_scan.c
>>>
>>> Changes since Zbigniew's last revision:
>>> * rewritten most of the parts that were using glib
>>> * removed multiple filter support - this will be added back when the need
>>> arises
>>> * we don't second guess the "chipset" of the device and just let the underlying
>>> open to fail if it has to
>>> * extra looging around opening device when filter is set
>>> * sysfs filter now has it's own prefix
>>> * no "platform" filter - sysfs should suffice for now, it can be added by
>>> someone more knowledgeable if the need arises
>>>
>>> TODO:
>>> * API for opening multiple devices in a single test (e.g. for prime) - I don't
>>> want to design this upfront
>>>
>>> Example usage:
>>> $ 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 -d "sys:/sys/devices/pci0000:00/0000:00:02.0"
>>> Notice: Using --device filters
>>> === Device filter ===
>>> sys:/sys/devices/pci0000:00/0000:00:02.0
>>>
>>> === 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/tests/core_auth --run-subtest getclient-simple --device "pci:vendor=intel"
>>> IGT-Version: 1.24-g64068440 (x86_64) (Linux: 5.3.7-250.vanilla.knurd.1.fc30.x86_64 x86_64)
>>> Starting subtest: getclient-simple
>>> Looking for devices to open using filter: pci:vendor=intel
>>> Filter matched /dev/dri/card0 | /dev/dri/renderD128
>>> Looking for devices to open using filter: pci:vendor=intel
>>> Filter matched /dev/dri/card0 | /dev/dri/renderD128 > Subtest getclient-simple: SUCCESS (0.007s)
>>
>> Looks very usable!
>>
>> Can I be cheeky and ask if you could also cover the existing tools
>> (especially intel_gpu_top (VLK-5588))?
>
> I am happy to do this but I would prefer to do that in the folowup
> patches to not bloat this series any more.
>
> https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/51
Thanks a lot!
>> Plus I would need a helper to get the selected device PCI string to use with
>> i915 PMU? There I'd need to get a string like "0000:01:00.0" since the i915
>> PMU registers the device as either:
>>
>>
>> "/sys/bus/event_source/devices/i915" for integrated.
>>
>> Or:
>>
>> "/sys/bus/event_source/devices/i915-0000:01:00.0" for discrete.
>>
>> So I am thinking something like igt_device_get_pci_string() could work for
>> lib/igt_perf.c/i915_type_id().
>
> same as above
>
> https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/52
And thanks again!
Regards,
Tvrtko
More information about the igt-dev
mailing list