From 59a6cd133b37f9ea8097d7d10c1fe9b84fdf8278 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Thu, 22 Oct 2015 12:12:47 +0200 Subject: [PATCH] nvapi: x86 can also get sub vendor ids --- ccminer.cpp | 4 +++- nvml.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ccminer.cpp b/ccminer.cpp index 83b67ed..cb40699 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -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."); diff --git a/nvml.cpp b/nvml.cpp index 2691057..cc55bb5 100644 --- a/nvml.cpp +++ b/nvml.cpp @@ -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) 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