calculate overhead based number of gpu devices (#1875)

This commit is contained in:
Jeffrey Morgan
2024-01-09 15:53:33 -05:00
committed by GitHub
parent e89dc1d54b
commit c336693f07
8 changed files with 13 additions and 6 deletions

View File

@@ -94,8 +94,7 @@ void cuda_check_vram(cuda_handle_t h, mem_info_t *resp) {
return;
}
unsigned int devices;
ret = (*h.getCount)(&devices);
ret = (*h.getCount)(&resp->count);
if (ret != NVML_SUCCESS) {
snprintf(buf, buflen, "unable to get device count: %d", ret);
resp->err = strdup(buf);
@@ -104,8 +103,7 @@ void cuda_check_vram(cuda_handle_t h, mem_info_t *resp) {
resp->total = 0;
resp->free = 0;
for (i = 0; i < devices; i++) {
for (i = 0; i < resp->count; i++) {
ret = (*h.getHandle)(i, &device);
if (ret != NVML_SUCCESS) {
snprintf(buf, buflen, "unable to get device handle %d: %d", i, ret);