diff --git a/src/utils.c b/src/utils.c index e96b43e3..a86bad30 100755 --- a/src/utils.c +++ b/src/utils.c @@ -101,7 +101,7 @@ nvmlReturn_t set_task_pid() { nvmlProcessInfo_t1 pre_pids_on_device[SHARED_REGION_MAX_PROCESS_NUM]; nvmlProcessInfo_t1 pids_on_device[SHARED_REGION_MAX_PROCESS_NUM]; nvmlDevice_t device; - nvmlReturn_t res; + nvmlReturn_t res = NVML_SUCCESS; CUcontext pctx; int i; CHECK_NVML_API(nvmlInit()); @@ -111,65 +111,82 @@ nvmlReturn_t set_task_pid() { CHECK_NVML_API(nvmlDeviceGetCount(&nvmlCounts)); int cudaDev; + int probeDev = -1; for (i=0;i