[v0.01] Reading PCI vendor/device values, needed to deduce the GPU chip and thus manufacturing process

This commit is contained in:
Dr-Noob
2021-08-13 11:31:51 +02:00
parent 8bc37d9d71
commit bdc4fd7c45
7 changed files with 134 additions and 3 deletions

22
src/cuda/pci.cpp Normal file
View 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;
}