From 92128bb18277c03cf198696875ea6a1c93b5c48b Mon Sep 17 00:00:00 2001 From: sasha0552 Date: Mon, 28 Oct 2024 01:41:46 +0000 Subject: [PATCH] Print both NVML and NVAPI GPU name --- src/main.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 11c99b5..90fa212 100644 --- a/src/main.c +++ b/src/main.c @@ -297,14 +297,23 @@ int main(int argc, char *argv[]) { // If GPU is managed if (state->managed) { - // Buffer to store the GPU name - char gpuName[256]; + // Buffer to store the NVML GPU name + char nvmlGpuName[256]; - // Retrieve the GPU name + // Buffer to store the NVAPI GPU name + NvAPI_ShortString nvapiGpuName; + + // Retrieve the NVML GPU name NVML_CALL(nvmlDeviceGetName(nvmlDevices[i], gpuName, sizeof(gpuName)), errored); + // Retrieve the NVAPI GPU name + NVAPI_CALL(NvAPI_GPU_GetFullName(nvapiDevices[i], )) + + // Print the managed GPU details + printf("(NVML) %u. %s (GPU id = %u)\n", managedGPUs, nvmlGpuName, i); + // Print the managed GPU details - printf("%u. %s (GPU id = %u)\n", managedGPUs, gpuName, i); + printf("(NVAPI) %u. %s (GPU id = %u)\n", managedGPUs, nvapiGpuName, i); // Increment the managed GPU counter managedGPUs++;