open-mpi/hwloc

No CUDA GPUs reported on Windows

mkre opened this issue · 3 comments

mkre commented

What version of hwloc are you using?

2.10.0

Which operating system and hardware are you running on?

Windows

Details of the problem

HWLOC does not report CUDA GPUs on Windows.

Additional information

If your issue consists in a wrong topology detection, we also need the following for debugging remotely:

It seems like the static component registration for CUDA is missing on Windows in contrib/windows-cmake/static-components.h.in. Duplicating the HWLOC_HAVE_OPENCL parts in that file with HWLOC_HAVE_CUDART and hwloc_cuda_component seems to do the job.

Hello. I guess we're talking about the Windows CMake build, right?
Is this the patch you applied?

--- a/contrib/windows-cmake/static-components.h.in
+++ b/contrib/windows-cmake/static-components.h.in
@@ -25,6 +25,9 @@ static const struct hwloc_component * hwloc_static_components[] = {
 #ifdef HWLOC_HAVE_OPENCL
   &hwloc_opencl_component,
 #endif
+#ifdef HWLOC_HAVE_CUDART
+  &hwloc_cuda_component,
+#endif
 #ifdef HWLOC_HAVE_LIBXML2
   &hwloc_xml_libxml_component,
 #endif

@scivision Looks like this was forgotten a while ago, unless there was a reason against it?

mkre commented

Yes, this is about the Windows CMake build. Besides your patch, we also need this addition to the file:

#ifdef HWLOC_HAVE_CUDART
HWLOC_DECLSPEC extern const struct hwloc_component hwloc_cuda_component;
#endif

The fix will be in the next release, either 2.10.1 or 2.11. Thanks.