From 35b728907c0c957dc0362a6e6353284017febaca Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sun, 15 May 2016 21:04:11 +0200 Subject: [PATCH] nvapi: product id was wrong when subsystem id is set also test its filled... (cf Inno3D), use generic nvidia ids else --- nvml.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvml.cpp b/nvml.cpp index 9ece71a..8f25fbd 100644 --- a/nvml.cpp +++ b/nvml.cpp @@ -695,6 +695,7 @@ int nvml_get_info(nvml_handle *nvmlh, int cudaindex, uint16_t &vid, uint16_t &pi return -ENODEV; subids = nvmlh->nvml_pci_subsys_id[gpuindex]; + if (!subids) subids = nvmlh->nvml_pci_device_id[gpuindex]; pid = subids >> 16; vid = subids & 0xFFFF; return 0; @@ -845,8 +846,9 @@ int nvapi_getinfo(unsigned int devNum, uint16_t &vid, uint16_t &pid) pid = pDeviceId >> 16; vid = pDeviceId & 0xFFFF; - if (vid == 0x10DE) { + if (vid == 0x10DE && pSubSystemId) { vid = pSubSystemId & 0xFFFF; + pid = pSubSystemId >> 16; } return 0;