+
    i  c                   s.    ^ RI HtHt  ! R R]]4      tR# )i    )PluginIndependentPluginc                   sF   a  ] tR t^t o RtRtRtRt]R 4       t	R t
RtV tR# )	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 InformationZspyrec                s
   . pV '       g   R# V P                  4        F  pVP                  4       '       g   K   VP                  ^R7      w  r4rVVP                  4       P                  R4      w  rxTR8X  g   K[  TR9   g   Kd  TP                  R4      ^8X  d
   RT,           p TP                  R4      w  rpTP                  R4      w  rTP                  YY34       K  	  V#   \         d     K  i ; i  \         d     K  i ; i)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)Zmaxsplit:Z1014z0000:.)Z06a7Z06a8)Z
splitlinesZstripZsplitZlowerZ
ValueErrorZcountZappend)Zlspci_outputspyre_cardsZlinepci_addrZ_classZidsZ_restZvendordevicedomainbusZdev_funcZ
pci_devicefunctions   &             =/usr/lib/python3.14/site-packages/sos/report/plugins/spyre.pyget_ibm_spyre_devicesZSpyre.get_ibm_spyre_devices   s    $  ++-D::<</3zz1z/E,#!$!2!23!7 F.>$>>>#&!+&1H,4NN3,?)F+3>>#+>(J ""F#FG' .*    " s#   6C!!'C3!C0/C03DDc                s"   V P                  R 4      pVR,          ^ 8w  d   R# V P                  VR,          4      pV'       g   R# V F2  w  r4rVV RV RV RV 2pRV RV RV R2pV P                  VR	R
7       K4  	  V P                  . RO4       R# )zlspci -nZstatusNZoutputr   r   z/sys/devices/pciZ/z	/vfio-devT)Ztree)z/etc/modprobe.d/vfio-pci.confz!/etc/udev/rules.d/95-vfio-3.rulesz#/etc/security/limits.d/memlock.conf)Zexec_cmdr   Zadd_dir_listingZadd_copy_spec)	ZselfZlspcir   r   r	   r   r
   r   Zpci_vfios	   &        r   setupZSpyre.setupH   s    j)?a00xA  .9)F 3%q(<H)&3%q
)LH   5 .9 	 
 	     N)zppc.*)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z
short_descZplugin_nameZarchitecturesZstaticmethodr   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      s8      5JKM+ +Z r   r   N)Zsos.report.pluginsr    r   r   r   r   r   <module>r      s    9QF% Qr   