|
|
@ -68,25 +68,26 @@ void cuda_devicenames() |
|
|
|
for (int i=0; i < GPU_N; i++) |
|
|
|
for (int i=0; i < GPU_N; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char vendorname[32] = { 0 }; |
|
|
|
char vendorname[32] = { 0 }; |
|
|
|
|
|
|
|
int dev_id = device_map[i]; |
|
|
|
cudaDeviceProp props; |
|
|
|
cudaDeviceProp props; |
|
|
|
cudaGetDeviceProperties(&props, device_map[i]); |
|
|
|
cudaGetDeviceProperties(&props, dev_id); |
|
|
|
|
|
|
|
|
|
|
|
device_sm[i] = (props.major * 100 + props.minor * 10); |
|
|
|
device_sm[dev_id] = (props.major * 100 + props.minor * 10); |
|
|
|
|
|
|
|
|
|
|
|
if (device_name[i]) { |
|
|
|
if (device_name[dev_id]) { |
|
|
|
free(device_name[i]); |
|
|
|
free(device_name[dev_id]); |
|
|
|
device_name[i] = NULL; |
|
|
|
device_name[dev_id] = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef USE_WRAPNVML |
|
|
|
#ifdef USE_WRAPNVML |
|
|
|
if (gpu_vendor((uint8_t)props.pciBusID, vendorname) > 0 && strlen(vendorname)) { |
|
|
|
if (gpu_vendor((uint8_t)props.pciBusID, vendorname) > 0 && strlen(vendorname)) { |
|
|
|
device_name[i] = (char*) calloc(1, strlen(vendorname) + strlen(props.name) + 2); |
|
|
|
device_name[dev_id] = (char*) calloc(1, strlen(vendorname) + strlen(props.name) + 2); |
|
|
|
if (!strncmp(props.name, "GeForce ", 8)) |
|
|
|
if (!strncmp(props.name, "GeForce ", 8)) |
|
|
|
sprintf(device_name[i], "%s %s", vendorname, &props.name[8]); |
|
|
|
sprintf(device_name[dev_id], "%s %s", vendorname, &props.name[8]); |
|
|
|
else |
|
|
|
else |
|
|
|
sprintf(device_name[i], "%s %s", vendorname, props.name); |
|
|
|
sprintf(device_name[dev_id], "%s %s", vendorname, props.name); |
|
|
|
} else |
|
|
|
} else |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
device_name[i] = strdup(props.name); |
|
|
|
device_name[dev_id] = strdup(props.name); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -95,11 +96,11 @@ void cuda_print_devices() |
|
|
|
int ngpus = cuda_num_devices(); |
|
|
|
int ngpus = cuda_num_devices(); |
|
|
|
cuda_devicenames(); |
|
|
|
cuda_devicenames(); |
|
|
|
for (int n=0; n < ngpus; n++) { |
|
|
|
for (int n=0; n < ngpus; n++) { |
|
|
|
int m = device_map[n % MAX_GPUS]; |
|
|
|
int dev_id = device_map[n % MAX_GPUS]; |
|
|
|
cudaDeviceProp props; |
|
|
|
cudaDeviceProp props; |
|
|
|
cudaGetDeviceProperties(&props, m); |
|
|
|
cudaGetDeviceProperties(&props, dev_id); |
|
|
|
if (!opt_n_threads || n < opt_n_threads) { |
|
|
|
if (!opt_n_threads || n < opt_n_threads) { |
|
|
|
fprintf(stderr, "GPU #%d: SM %d.%d %s\n", m, props.major, props.minor, device_name[n]); |
|
|
|
fprintf(stderr, "GPU #%d: SM %d.%d %s\n", dev_id, props.major, props.minor, device_name[dev_id]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|