Browse Source

nvapi: x86 can also get sub vendor ids

2upstream
Tanguy Pruvot 9 years ago
parent
commit
59a6cd133b
  1. 4
      ccminer.cpp
  2. 12
      nvml.cpp

4
ccminer.cpp

@ -3243,8 +3243,10 @@ int main(int argc, char *argv[]) @@ -3243,8 +3243,10 @@ int main(int argc, char *argv[])
}
}
#ifdef WIN32
if (!hnvml && nvapi_init() == 0)
if (!hnvml && nvapi_init() == 0) {
applog(LOG_INFO, "NVAPI GPU monitoring enabled.");
cuda_devicenames(); // refresh gpu vendor name
}
#endif
else if (!hnvml)
applog(LOG_INFO, "GPU monitoring is not available.");

12
nvml.cpp

@ -845,6 +845,9 @@ int nvapi_getinfo(unsigned int devNum, uint16_t &vid, uint16_t &pid) @@ -845,6 +845,9 @@ int nvapi_getinfo(unsigned int devNum, uint16_t &vid, uint16_t &pid)
pid = pDeviceId >> 16;
vid = pDeviceId & 0xFFFF;
if (vid == 0x10DE) {
vid = pSubSystemId & 0xFFFF;
}
return 0;
}
@ -1154,6 +1157,15 @@ int gpu_vendor(uint8_t pci_bus_id, char *vendorname) @@ -1154,6 +1157,15 @@ int gpu_vendor(uint8_t pci_bus_id, char *vendorname)
nvml_get_info(hnvml, id, vid, pid);
}
}
} else {
#ifdef WIN32
for (unsigned id = 0; id < nvapi_dev_cnt; id++) {
if (device_bus_ids[id] == pci_bus_id) {
nvapi_getinfo(nvapi_dev_map[id], vid, pid);
break;
}
}
#endif
}
return translate_vendor_id(vid, vendorname);
#endif

Loading…
Cancel
Save