Don't print that nvmlDeviceGetHandleByPciBusId failed if it wasn't even called

pull/131/head
jackun 4 years ago
parent 723c6bedeb
commit ad0f010951
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -18,15 +18,14 @@ bool checkNVML(const char* pciBusId){
std::cerr << "MANGOHUD: Nvidia module not loaded\n";
} else {
nvmlReturn_t ret = NVML_ERROR_UNKNOWN;
if (pciBusId)
ret = nvml.nvmlDeviceGetHandleByPciBusId(pciBusId, &nvidiaDevice);
if (ret != NVML_SUCCESS) {
if (pciBusId && ((ret = nvml.nvmlDeviceGetHandleByPciBusId(pciBusId, &nvidiaDevice)) != NVML_SUCCESS)) {
std::cerr << "MANGOHUD: Getting device handle by PCI bus ID failed: " << nvml.nvmlErrorString(ret) << "\n";
std::cerr << " Using index 0.\n";
ret = nvml.nvmlDeviceGetHandleByIndex(0, &nvidiaDevice);
}
if (ret != NVML_SUCCESS)
ret = nvml.nvmlDeviceGetHandleByIndex(0, &nvidiaDevice);
if (ret != NVML_SUCCESS)
std::cerr << "MANGOHUD: Getting device handle failed: " << nvml.nvmlErrorString(ret) << "\n";

Loading…
Cancel
Save