Browse Source

Revert "No need to get nvml device handle several times"

This reverts commit a8cbf7391142dabd810ba23f5890e397ae889493.
Samuel Thibault 6 years ago
parent
commit
cd2cea3711
1 changed files with 5 additions and 6 deletions
  1. 5 6
      src/drivers/cuda/driver_cuda.c

+ 5 - 6
src/drivers/cuda/driver_cuda.c

@@ -700,12 +700,6 @@ int _starpu_cuda_driver_init(struct _starpu_worker_set *worker_set)
 #endif /* !STARPU_SIMGRID */
 	}
 
-#if !defined(STARPU_SIMGRID) && defined(STARPU_HAVE_BUSID) && defined(STARPU_HAVE_DOMAINID) && defined(HAVE_LIBNVIDIA_ML)
-	char busid[13];
-	snprintf(busid, sizeof(busid), "%04x:%02x:%02x.0", props[devid].pciDomainID, props[devid].pciBusID, props[devid].pciDeviceID);
-	nvmlDeviceGetHandleByPciBusId(busid, &nvmlDev[devid]);
-#endif
-
 	/* one more time to avoid hacks from third party lib :) */
 	_starpu_bind_thread_on_cpu(worker0->bindid, worker0->workerid);
 
@@ -728,6 +722,11 @@ int _starpu_cuda_driver_init(struct _starpu_worker_set *worker_set)
 
 #if defined(STARPU_HAVE_BUSID) && !defined(STARPU_SIMGRID)
 #if defined(STARPU_HAVE_DOMAINID) && !defined(STARPU_SIMGRID)
+#ifdef HAVE_LIBNVIDIA_ML
+		char busid[13];
+		snprintf(busid, sizeof(busid), "%04x:%02x:%02x.0", props[devid].pciDomainID, props[devid].pciBusID, props[devid].pciDeviceID);
+		nvmlDeviceGetHandleByPciBusId(busid, &nvmlDev[devid]);
+#endif
 		if (props[devid].pciDomainID)
 			snprintf(worker->name, sizeof(worker->name), "CUDA %u.%u (%s %.1f GiB %04x:%02x:%02x.0)", devid, subdev, devname, size, props[devid].pciDomainID, props[devid].pciBusID, props[devid].pciDeviceID);
 		else