[v0.01] Reading PCI vendor/device values, needed to deduce the GPU chip and thus manufacturing process
This commit is contained in:
22
src/cuda/pci.cpp
Normal file
22
src/cuda/pci.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "pci.hpp"
|
||||
#include "nvmlb.hpp"
|
||||
#include "../common/global.hpp"
|
||||
|
||||
struct pci {
|
||||
uint16_t vendor_id;
|
||||
uint16_t device_id;
|
||||
};
|
||||
|
||||
struct pci* get_pci_from_nvml(struct nvml_data* data) {
|
||||
struct pci* pci = (struct pci*) emalloc(sizeof(struct pci));
|
||||
|
||||
pci->vendor_id = nvml_get_pci_vendor_id(data);
|
||||
pci->device_id = nvml_get_pci_device_id(data);
|
||||
|
||||
printf("pci->vendor_id=0x%.4X\n", pci->vendor_id);
|
||||
printf("pci->device_id=0x%.4X\n", pci->device_id);
|
||||
|
||||
return pci;
|
||||
}
|
||||
Reference in New Issue
Block a user