|
@@ -530,7 +530,7 @@ static int start_job_on_cuda(struct _starpu_job *j, struct _starpu_worker *worke
|
|
|
#ifdef HAVE_LIBNVIDIA_ML
|
|
|
unsigned long long energy_start = 0;
|
|
|
nvmlReturn_t nvmlRet = -1;
|
|
|
- if (profiling)
|
|
|
+ if (profiling && task->profiling_info)
|
|
|
{
|
|
|
nvmlRet = nvmlDeviceGetTotalEnergyConsumption(nvmlDev[worker->devid], &energy_start);
|
|
|
if (nvmlRet == NVML_SUCCESS)
|
|
@@ -552,7 +552,7 @@ static void finish_job_on_cuda(struct _starpu_job *j, struct _starpu_worker *wor
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBNVIDIA_ML
|
|
|
- if (profiling && j->task->profiling_info->energy_consumed)
|
|
|
+ if (profiling && j->task->profiling_info && j->task->profiling_info->energy_consumed)
|
|
|
{
|
|
|
unsigned long long energy_end;
|
|
|
nvmlReturn_t nvmlRet = -1;
|