diff --git a/src/common/pci.cpp b/src/common/pci.cpp index 47380dc..2a25ad6 100644 --- a/src/common/pci.cpp +++ b/src/common/pci.cpp @@ -1,3 +1,4 @@ +#include "global.hpp" #include "pci.hpp" #include @@ -14,6 +15,7 @@ uint16_t pciutils_get_pci_vendor_id(struct pci_dev *devices) { return dev->vendor_id; } } + printErr("Unable to find a CUDA device using pciutils"); return 0; } @@ -23,15 +25,21 @@ uint16_t pciutils_get_pci_device_id(struct pci_dev *devices) { return dev->device_id; } } + printErr("Unable to find a CUDA device using pciutils"); return 0; } struct pci_dev *get_pci_devices_from_pciutils() { struct pci_access *pacc; + struct pci_dev *dev; pacc = pci_alloc(); pci_init(pacc); pci_scan_bus(pacc); + for (dev=pacc->devices; dev; dev=dev->next) { + pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_CLASS); + } + return pacc->devices; }