Ë
    Û1jè  ã                   ó,   — d dl mZmZ  G d„ dee«      Zy)é    )ÚPluginÚIndependentPluginc                   ó2   — e Zd ZdZdZdZdZed„ «       Zd„ Z	y)ÚSpyreuÖ   Spyre 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 InformationÚspyre)zppc.*c                 óÒ  — g }| sy| j                  «       D ]°  }|j                  «       sŒ	 |j                  d¬«      \  }}}}|j                  «       j                  d«      \  }}|dk(  sŒT|dv sŒY|j                  d«      dk(  rd|z   }	 |j                  d«      \  }	}
}|j                  d	«      \  }}|j                  |	|
||f«       Œ² |S # t        $ r Y ŒÀw xY w# t        $ r Y ŒÏw xY w)
a�  Extract 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ú:Ú1014)Ú06a7Ú06a8é   z0000:ú.)Ú
splitlinesÚstripÚsplitÚlowerÚ
ValueErrorÚcountÚappend)Úlspci_outputÚspyre_cardsÚlineÚpci_addrÚ_classÚidsÚ_restÚvendorÚdeviceÚdomainÚbusÚdev_funcÚ
pci_deviceÚfunctions                 ú:/usr/lib/python3/dist-packages/sos/report/plugins/spyre.pyÚget_ibm_spyre_deviceszSpyre.get_ibm_spyre_devices   s  € ð$ ˆáØà ×+Ñ+Ó-ò 	HˆDØ—:‘:”<ØðØ/3¯z©zÀ1¨zÓ/EÑ,�˜& # uØ!$§¡£×!2Ñ!2°3Ó!7‘�˜ð ˜Ó FÐ.>Ò$>Ø—>‘> #Ó&¨!Ò+Ø&¨Ñ1�HðØ,4¯N©N¸3Ó,?Ñ)�F˜C Ø+3¯>©>¸#Ó+>Ñ(�J ð ×"Ñ" F¨C°¸XÐ#FÕGð'	Hð* Ðøô ò Ùðûô "ò Ùðús#   «9CÂ	)CÃ	CÃCÃ	C&Ã%C&c                 óü   — | j                  d«      }|d   dk7  ry | j                  |d   «      }|sy |D ]3  \  }}}}|› d|› d|› d|› �}d|› d|› d|› d	�}| j                  |d
¬«       Œ5 | j                  g d¢«       y )Nzlspci -nÚstatusr   Úoutputr   r   z/sys/devices/pciú/z	/vfio-devT)Útree)z/etc/modprobe.d/vfio-pci.confz!/etc/udev/rules.d/95-vfio-3.rulesz#/etc/security/limits.d/memlock.conf)Úexec_cmdr'   Úadd_dir_listingÚadd_copy_spec)	ÚselfÚlspcir   r!   r"   r    r%   r   Úpci_vfios	            r&   ÚsetupzSpyre.setupH   s³   € à—‘˜jÓ)ˆØ�‰?˜aÒØà×0Ñ0°°x±ÓAˆñ Øð .9ò 	6Ñ)ˆF�C˜ Ø ˜  3 % q¨¨°°(°Ð<ˆHØ)¨&¨°°3°%°q¸¸
À)ÐLˆHØ× Ñ  °Ð Õ5ð	6ð 	×Ñò 
õ 	ó    N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
short_descÚplugin_nameÚarchitecturesÚstaticmethodr'   r3   © r4   r&   r   r      s0   „ ñð 5€JØ€KØ€Màñ+ó ð+óZr4   r   N)Úsos.report.pluginsr   r   r   r=   r4   r&   ú<module>r?      s   ð÷ 9ôQˆFÐ%õ Qr4   