forked from tinygrad/tinygrad
The Linux path of pci_scan_bus reads /sys/bus/pci/devices/.../class and skips devices whose base class doesn't match. The macOS (IOKit) path appended every IOPCIDevice unconditionally, so callers that supplied base_class to narrow down to e.g. display devices would also get the audio companion function of a multifunction GPU. Concretely, an NVIDIA RTX Pro 6000 Blackwell exposes: 10de:2bb1 class 0x030000 (display) 10de:22e8 class 0x040300 (multimedia audio) A PROBE for base_class=3 returned both. With the sorted() at the end of pci_scan_bus, 22e8 (audio) came first, so the NV runtime picked the audio function as device 0 and stalled on RESIZE_BAR. This mirrors the Linux filter on line 70 using the existing read_prop helper. Co-authored-by: Christopher Bradford <[email protected]>