Skip to content

hwloc misconfigured with precedence over system hwloc

Description:

/etc/ld.so.conf.d/intel-oneapi-compiler-shared-runtime-libs.conf lists /opt/intel/oneapi/compiler/latest/lib, which causes the libhwloc.so there to take precedent.

$ ldconfig -p |rg hwloc
        libhwloc.so.15 (libc6,x86-64) => /opt/intel/oneapi/compiler/latest/lib/libhwloc.so.15
        libhwloc.so.15 (libc6,x86-64) => /usr/lib/libhwloc.so.15
        libhwloc.so (libc6,x86-64) => /usr/lib/libhwloc.so

When compiling with MPICH, we're obtaining this version and get this warning (doesn't matter if run using mpiexec or not).

$ /opt/mpich/bin/mpicc a.c -o a
$ ./a
hwloc/linux: Ignoring PCI device with non-16bit domain.
Pass --enable-32bits-pci-domain to configure to support such devices
(warning: it would break the library ABI, don't enable unless really needed).

This isn't an issue currently with Open MPI, but only because the wrapper is putting /usr/lib in RPATH and RUNPATH, which is normally discouraged for system paths and would create conflicts if we did the same for MPICH (where we want to guarantee that libraries in other paths take precedence over ABI-incompatible Open MPI libraries in /usr/lib).

$ /usr/bin/mpicc -show     # Open MPI
gcc -I/usr/include -Wl,-rpath -Wl,/usr/lib -Wl,--enable-new-dtags -lmpi
$ /opt/mpich/bin/mpicc -show
gcc -I/opt/mpich/include -L/opt/mpich/lib -Wl,-rpath -Wl,/opt/mpich/lib -Wl,--enable-new-dtags -lmpi
$ readelf -d /usr/lib/libmpi.so |rg RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/usr/lib]

Possible solution

I think the best option would be for intel-oneapi-compiler-shared-runtime-libs to use system hwloc instead of bundling its own libhwloc.so.

Additional info:

  • package version(s): intel-oneapi-compiler-shared-runtime-libs 2025.0.4-2 hwloc 2.11.2-1

Steps to reproduce:

Source file a.c:

#include <mpi.h>

int main(int argc, char **argv) {
  MPI_Init(&argc, &argv);
  MPI_Finalize();
  return 0;
}

compile and run as above using /opt/mpich/bin/mpicc.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information