Accepting request 1227162 from home:NMorey:branches:science:HPC

- Add psm3-fix-SIGILL-on-system-not-supporting-AVX.patch to fix
  SIGILL hapening during init on older CPU (bsc#1213538, bsc#1233356).
- Refresh libfabric-libtool.patch tu support patch -p0

OBS-URL: https://build.opensuse.org/request/show/1227162
OBS-URL: https://build.opensuse.org/package/show/science:HPC/libfabric?expand=0&rev=106
This commit is contained in:
Nicolas Morey 2024-11-29 15:18:23 +00:00 committed by Git OBS Bridge
commit 4e8479a47e
13 changed files with 2734 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<package>fabtests</package>
</multibuild>

18
_service Normal file
View File

@ -0,0 +1,18 @@
<services>
<service name="tar_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/ofiwg/libfabric.git</param>
<param name="package-meta">no</param>
<param name="exclude">.git</param>
<param name="filename">libfabric</param>
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@.%h</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="revision">159219639b7fd69d140892120121bbb4d694e295</param>
</service>
<service name="recompress" mode="manual">
<param name="file">libfabric*.tar</param>
<param name="compression">bz2</param>
</service>
</services>

4
baselibs.conf Normal file
View File

@ -0,0 +1,4 @@
libfabric1
libfabric-devel
requires -libibmad-<targettype>
requires "libfabric1-<targettype> = <version>"

6
fabtests-rpmlintrc Normal file
View File

@ -0,0 +1,6 @@
# This line is mandatory to access the configuration functions
from Config import *
addFilter("no-manual-page-for-binary fi_.*")
addFilter("no-manual-page-for-binary runfabtests.sh")
addFilter("no-manual-page-for-binary rft_yaml_to_junit_xml")

64
fabtests.spec Normal file
View File

@ -0,0 +1,64 @@
#
# spec file for package fabtests
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define git_ver .0.159219639b7f
Name: fabtests
Version: 1.22.0
Release: 0
Summary: Test suite for libfabric API
License: BSD-2-Clause OR GPL-2.0-only
Group: Development/Tools/Other
URL: http://www.github.com/ofiwg/libfabric
Source: libfabric-%{version}%{git_ver}.tar.bz2
Source1: fabtests-rpmlintrc
Patch0: libfabric-libtool.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libfabric-devel = %{version}
BuildRequires: libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Fabtests provides a set of examples that uses libfabric, a fabric software library.
%prep
%autosetup -p0 -n libfabric-%{version}%{git_ver}
%build
cd fabtests
./autogen.sh
%configure %{?_with_libfabric}
%make_build
%install
%make_install -C fabtests
%files
%defattr(-,root,root)
%dir %{_datadir}/fabtests/
%{_bindir}/*
%{_mandir}/man1/*
%{_mandir}/man7/*
%{_datadir}/fabtests/*
%doc AUTHORS README NEWS.md
%license COPYING
%changelog

BIN
libfabric-1.22.0.0.159219639b7f.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

23
libfabric-libtool.patch Normal file
View File

@ -0,0 +1,23 @@
commit 81de541fdd4abc77167f955f8ddd85f195888e5c
Author: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Fri Sep 30 13:49:16 2022 +0200
libfabric libtool
Disable static libs
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
diff --git configure.ac configure.ac
index 7dacf69c9a69..90fcdc610754 100644
--- configure.ac
+++ configure.ac
@@ -193,7 +193,7 @@ m4_version_prereq([2.70],
dnl Check for compiler features
AC_C_TYPEOF
-LT_INIT
+LT_INIT([disable-static])
LT_OUTPUT
dnl dlopen support is optional

2359
libfabric.changes Normal file

File diff suppressed because it is too large Load Diff

161
libfabric.spec Normal file
View File

@ -0,0 +1,161 @@
#
# spec file for package libfabric
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#
%define git_ver .0.159219639b7f
%ifarch aarch64 %power64 x86_64 s390x
%if 0%{?suse_version} > 1530
%define with_ucx 1
%endif
%define with_efa 1
%endif
Name: libfabric
Version: 1.22.0
Release: 0
Summary: User-space RDMA Fabric Interfaces
License: BSD-2-Clause OR GPL-2.0-only
Group: Development/Libraries/C and C++
Source: %{name}-%{version}%{git_ver}.tar.bz2
Source1: baselibs.conf
Patch0: libfabric-libtool.patch
Patch1: psm3-fix-SIGILL-on-system-not-supporting-AVX.patch
URL: http://www.github.com/ofiwg/libfabric
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libibverbs-devel
BuildRequires: libnl3-devel
%ifarch x86_64
BuildRequires: libnuma-devel
BuildRequires: libpsm2-devel
%endif
BuildRequires: fdupes
BuildRequires: librdmacm-devel
BuildRequires: libtool
%if 0%{?with_ucx}
BuildRequires: libucm-devel
BuildRequires: libucp-devel
# 1.10 Needed for UCS_MEMORY_TYPE_UNKNOWN
BuildRequires: libucs-devel >= 1.10
BuildRequires: libuct-devel
%endif
BuildRequires: pkg-config
%define lib_major 1
%description
libfabric provides a user-space API to access high-performance fabric
services, such as RDMA. This package only contains the fi_info binary.
%package -n libfabric%{lib_major}
Summary: User-space RDMA fabric interfaces
Group: System/Libraries
%description -n libfabric%{lib_major}
libfabric provides a user-space API to access high-performance fabric
services, such as RDMA. This package contains the runtime library.
%package devel
Summary: Development files for the libfabric library
Group: Development/Libraries/C and C++
Requires: libfabric%{lib_major} = %{version}
%description devel
libfabric provides a user-space API to access high-performance fabric
services, such as RDMA. This package contains the development files.
%prep
%autosetup -p0 -n %{name}-%{version}%{git_ver}
%build
export CFLAGS=-Wno-incompatible-pointer-types
rm -f config/libtool.m4
autoreconf -fi
# defaults: with-dlopen and without-valgrind can be over-rode:
%configure %{?_without_dlopen} %{?_with_valgrind} \
--enable-sockets --enable-verbs --enable-usnic \
%if 0%{?with_efa}
--enable-efa \
%endif
%if 0%{?with_ucx}
--enable-ucx \
%endif
%ifarch x86_64
--enable-psm2 \
--enable-psm3 \
%endif
--disable-static
%make_build
%install
%make_install
# remove unpackaged files from the buildroot
rm -f %{buildroot}%{_libdir}/*.la
%fdupes %{buildroot}/%{_prefix}
%post -n libfabric%{lib_major} -p /sbin/ldconfig
%postun -n libfabric%{lib_major} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/man1/*
%doc NEWS.md
%license COPYING
%files -n libfabric%{lib_major}
%defattr(-,root,root,-)
%{_libdir}/%{name}.so.%{lib_major}*
%doc AUTHORS README
%license COPYING
%files devel
%defattr(-,root,root)
%{_libdir}/%{name}.so
%dir %{_includedir}/rdma
%{_includedir}/rdma/fabric.h
%{_includedir}/rdma/fi_atomic.h
%{_includedir}/rdma/fi_cm.h
%{_includedir}/rdma/fi_collective.h
%{_includedir}/rdma/fi_domain.h
%{_includedir}/rdma/fi_endpoint.h
%{_includedir}/rdma/fi_eq.h
%{_includedir}/rdma/fi_errno.h
%{_includedir}/rdma/fi_ext.h
%{_includedir}/rdma/fi_profile.h
%{_includedir}/rdma/fi_rma.h
%{_includedir}/rdma/fi_tagged.h
%{_includedir}/rdma/fi_trigger.h
%dir %{_includedir}/rdma/providers
%{_includedir}/rdma/providers/fi_log.h
%{_includedir}/rdma/providers/fi_peer.h
%{_includedir}/rdma/providers/fi_prov.h
%{_includedir}/rdma/fi_ext_usnic.h
%ifarch x86_64
%{_includedir}/rdma/fi_ext_psm2.h
%endif
%if 0%{?with_efa}
%{_includedir}/rdma/fi_ext_efa.h
%endif
%{_mandir}/man3/*
%{_mandir}/man7/*
%{_libdir}/pkgconfig/%{name}.pc
%changelog

8
pre_checkin.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# This script has to be run prior to a check-in if changes were done
# to spec and/or changes
GIT_VER=$(grep "%define git_ver" libfabric.spec)
VERSION=$(egrep "^Version:" libfabric.spec)
sed -i -e 's/^%define git_ver.*$/'"$GIT_VER/" -e 's/^Version:.*$/'"$VERSION/" fabtests.spec
osc service run format_spec_file

View File

@ -0,0 +1,60 @@
commit fd049a0a053502a85b839a715fc6f9fdbfc4439a
Author: Nicolas Morey <nmorey@suse.com>
Date: Thu Nov 28 16:44:12 2024 +0100
psm3: fix SIGILL on system not supporting AVX
Even though code was added to not use the PSM3 provider on system
without AVX/AVX2 support, logs triggered by the detection code can
be using AVX instructions causing psmx3_getinfo to SIGILL
Move the detection even earlier in the provider init and use OFI
standard print functions to avoid using any code that might have
been compiled with AVX instructions.
Fixes: 3ef633408edf ("prov/psm3: update provider to sync with IEFS 11.5.1.0.3")
Signed-off-by: Nicolas Morey <nmorey@suse.com>
diff --git prov/psm3/src/psmx3_init.c prov/psm3/src/psmx3_init.c
index 29359d3ea348..cc259a1b6301 100644
--- prov/psm3/src/psmx3_init.c
+++ prov/psm3/src/psmx3_init.c
@@ -680,18 +680,6 @@ static int psmx3_getinfo(uint32_t api_version, const char *node,
PSMX3_INFO(&psmx3_prov, FI_LOG_CORE,"\n");
- __builtin_cpu_init();
- if (!__builtin_cpu_supports(PSM3_MARCH)) {
- PSMX3_INFO(&psmx3_prov, FI_LOG_CORE,
- "CPU does not support '%s'.\n", PSM3_MARCH);
- OFI_INFO_STR(&psmx3_prov,
- (__builtin_cpu_supports("avx2") ? "AVX2" :
- (__builtin_cpu_supports("avx") ? "AVX" :
- (__builtin_cpu_supports("sse4.2") ? "SSE4.2" : "unknown"))),
- PSM3_MARCH, "CPU Supports", "PSM3 Built With");
- goto err_out;
- }
-
if (psmx3_init_prov_info(hints, &prov_info))
goto err_out;
@@ -895,6 +883,19 @@ struct fi_provider psmx3_prov = {
PROVIDER_INI
{
+ __builtin_cpu_init();
+ if (!__builtin_cpu_supports(PSM3_MARCH)) {
+ FI_INFO(&core_prov, FI_LOG_CORE,
+ "PSM3: CPU does not support '%s'.\n", PSM3_MARCH);
+ OFI_INFO_STR(&core_prov,
+ (__builtin_cpu_supports("avx2") ? "AVX2" :
+ (__builtin_cpu_supports("avx") ? "AVX" :
+ (__builtin_cpu_supports("sse4.2") ? "SSE4.2" : "unknown"))),
+ PSM3_MARCH, "CPU Supports", "PSM3 Built With");
+ return NULL;
+ }
+
+
psmx3_prov.version = get_psm3_provider_version();
PSMX3_INFO(&psmx3_prov, FI_LOG_CORE, "build options: VERSION=%u.%u=%u.%u.%u.%u, "