Explorar o código

exit(77) instead of aborting when CUDA devices are busy.

Samuel Thibault %!s(int64=13) %!d(string=hai) anos
pai
achega
afa5e54519
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/drivers/cuda/driver_cuda.c

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

@@ -118,8 +118,13 @@ static void init_context(int devid)
 
 	/* force CUDA to initialize the context for real */
 	cures = cudaFree(0);
-	if (STARPU_UNLIKELY(cures))
+	if (STARPU_UNLIKELY(cures)) {
+		if (cures == cudaErrorDevicesUnavailable) {
+			fprintf(stderr,"All CUDA-capable devices are busy or unavailable\n");
+			exit(77);
+		}
 		STARPU_CUDA_REPORT_ERROR(cures);
+	}
 
 	cures = cudaGetDeviceProperties(&props[devid], devid);
 	if (STARPU_UNLIKELY(cures))