Skip to content

Commit

Permalink
Print both NVML and NVAPI GPU name
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Oct 28, 2024
1 parent 0fb4f3a commit 92128bb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 92128bb

Please sign in to comment.