Kaynağa Gözat

fix when hwloc doesn't find some CUDA/OpenCL devices

Corentin Salingue 8 yıl önce
ebeveyn
işleme
62bcf99d5a
1 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 10 0
      src/core/topology.c

+ 10 - 0
src/core/topology.c

@@ -1929,6 +1929,11 @@ static void _starpu_init_numa_node(struct _starpu_machine_config *config)
 	for (i = 0; i < config->topology.ncudagpus; i++)
 	{
 		hwloc_obj_t obj = hwloc_cuda_get_device_osdev_by_index(config->topology.hwtopology, i);
+		
+		/* Hwloc cannot recognize some devices */
+		if (!obj)
+			continue;
+			
 		while (obj->type != HWLOC_OBJ_NODE)
 		{
 			obj = obj->parent;
@@ -1992,6 +1997,11 @@ static void _starpu_init_numa_node(struct _starpu_machine_config *config)
 			for (i = 0; i < num; i++)
 			{
 				hwloc_obj_t obj = hwloc_opencl_get_device_osdev_by_index(config->topology.hwtopology, platform, i);
+
+				/* Hwloc cannot recognize some devices */
+				if (!obj)
+					continue;
+
 				while (obj->type != HWLOC_OBJ_NODE)
 				{
 					obj = obj->parent;