mirror of
https://github.com/GOSTSec/ccminer
synced 2025-01-22 12:34:17 +00:00
nvapi: x86 can also get sub vendor ids
This commit is contained in:
parent
355b835ae0
commit
59a6cd133b
@ -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
12
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user