Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
CHECK_NVML_API(nvmlDeviceGetCount(&nvmlCounts));

int cudaDev;
int probeDev = 0;
for (i=0;i<nvmlCounts;i++){
cudaDev=nvml_to_cuda_map(i);
if (cudaDev<0) {
Expand All @@ -123,14 +124,15 @@
LOG_ERROR("Device2GetComputeRunningProcesses failed %d,%d\n",res,i);
return res;
}
}while(res==NVML_ERROR_INSUFFICIENT_SIZE);
}while(res==NVML_ERROR_INSUFFICIENT_SIZE);

Check failure on line 127 in src/utils.c

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] reported by reviewdog 🐶 Missing spaces around == [whitespace/operators] [3] Raw Output: src/utils.c:127: Missing spaces around == [whitespace/operators] [3]

Check failure on line 127 in src/utils.c

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] reported by reviewdog 🐶 Missing spaces around == [whitespace/operators] [3] Raw Output: src/utils.c:127: Missing spaces around == [whitespace/operators] [3]
mergepid(&previous,&merged_num,(nvmlProcessInfo_t1 *)tmp_pids_on_device,pre_pids_on_device);
probeDev = cudaDev;
break;
}
previous = merged_num;
merged_num = 0;
memset(tmp_pids_on_device,0,sizeof(nvmlProcessInfo_v1_t)*SHARED_REGION_MAX_PROCESS_NUM);
CHECK_CU_RESULT(cuDevicePrimaryCtxRetain(&pctx,0));
CHECK_CU_RESULT(cuDevicePrimaryCtxRetain(&pctx,probeDev));

Check failure on line 135 in src/utils.c

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] reported by reviewdog 🐶 Missing space after , [whitespace/comma] [3] Raw Output: src/utils.c:135: Missing space after , [whitespace/comma] [3]

Check failure on line 135 in src/utils.c

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] reported by reviewdog 🐶 Missing space after , [whitespace/comma] [3] Raw Output: src/utils.c:135: Missing space after , [whitespace/comma] [3]
for (i=0;i<nvmlCounts;i++) {
cudaDev=nvml_to_cuda_map(i);
if (cudaDev<0) {
Expand Down Expand Up @@ -168,7 +170,7 @@
}
}
}
CHECK_CU_RESULT(cuDevicePrimaryCtxRelease(0));
CHECK_CU_RESULT(cuDevicePrimaryCtxRelease(probeDev));
return NVML_SUCCESS;
}

Expand Down
Loading