a >h @s&ddlmZmZGdddeeZdS))PluginIndependentPluginc@s0eZdZdZdZdZdZeddZddZ d S) SpyreuSpyre chip is IBM’s AI accelerator, designed to handle AI inferencing and workloads. The Spyre plugin collects data about the Spyre card’s VFIO device node tree, configuration files, and more. z!IBM Spyre Accelerator InformationZspyre)zppc.*c Csg}|s dS|D]}|s"qz*|jdd\}}}}|d\}}WntybYqYn0|dkr|dvr|ddkrd|}z"|d\} } } | d \} } WntyYqYn0|| | | | fq|S) aExtract PCI domain, bus, device, function for devices that match: - Vendor ID = 0x1014 (IBM) - Device ID = 0x06a7 or 0x06a8 Parameters ---------- lspci_out : str The output string from `lspci -n`. Returns ------- list of tuples A list of (domain, bus, device, function) tuples for each matching card. N)maxsplit:Z1014)Z06a7Z06a8z0000:.) splitlinesstripsplitlower ValueErrorcountappend)Z lspci_output spyre_cardslinepci_addrZ_classZidsZ_restZvendordevicedomainbusZdev_funcZ pci_devicefunctionr s