News: 1678375931

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

openSUSE finds an elegant solution to x86-64 version support

(2023/03/09)


SUSE, and the openSUSE project it sponsors, has a way around the issue of optimizing its distro for specific versions of the x86-64 architecture.

This new move was [1]announced last week and will, hopefully, resolve the issues over x86-64 support that have been causing dissent in the distros' communities. Back in July [2]we reported that SUSE's new ALP distro might need x86-64-v3 . Then, later, the rolling-release [3]Tumbleweed distro considered requiring x86-64-v2 . Apparently, though, enough users still ran older kit that didn't support v2 and complained that the project leaders [4]backed down and decided the new requirement would be dropped .

The resolution uses a new feature called Hardware Capability Tunables or [5]hwcaps in the GNU C Library [6]glibc . The feature was introduced in glibc [7]v2.33 . Here's how the release notes described it:

The dynamic linker loads optimized implementations of shared objects from subdirectories under the glibc-hwcaps directory on the library search path if the system's capabilities meet the requirements for that subdirectory.

Initially supported subdirectories include… x86-64-v2 , x86-64-v3 , x86-64-v4 for x86_64-linux-gnu … The subdirectory names correspond to the vendor-independent x86-64 microarchitecture levels defined in the x86-64 psABI [8]supplement [PDF].

Support for this came from a SUSE Hackweek [9]project by developer Antonio Larrosa, who also [10]explained how to use it.

The gist is that while the main Tumbleweed distro will still be compiled for the most basic level of x86-64 support, x86-64-v1 , this new feature in glibc enables libraries to use newer CPU features if they'd benefit from them. If a particular library would be substantially faster thanks to specific features from newer versions of the processor architecture, then its developer can provide different versions of the library: fast ones that use the new feature, and slower ones that don't and have to work around it in software on older CPUs that lack the instructions.

[11]

The best part is that this is automatic. Glibc will automatically load the appropriate libraries on CPUs that match that revision of the specification: the program calling the library doesn't need to know or care. The [12]change was accepted a few weeks ago, so any recently updated Tumbleweed installations already have it.

[13]

Some of this springs from Intel's [14]AVX-512 feature, especially in the recent [15]"Sapphire Rapids" Xeon Scalable processors , which [16]The Reg discussed in January . Those new instructions were also going to be in the "Alder Lake" desktop processors, but Intel decided to [17]disable them.

[18]The quest to make Linux bulletproof

[19]Debian-based siduction gains snapshots, new recovery tools and more

[20]Fancy climbing into ALP over New Year's? Fresh preview versions of SUSE's distro and NetBSD 10 are here

[21]openSUSE Tumbleweed team changes its mind about x86-64-v2

AVX-512 is part of x86-64-v4, and [22]some vendors seem keen on it , but for now, SUSE is just providing some accelerated libraries that use x86-64-v3 features. At first, only a few programs are getting support, such as Python 3.11, XML and PNG parsing, and a decoder for [23]the new JPEG-XL image format which [24]Google chose to drop in Chrome 110 and later .

Now that the support is available, though, adoption will surely grow. In principle, developers could provide four different sets of performance-optimized libraries, one for each version of x86-64, with increasing levels of exploitation of advanced CPU features. ®

Get our [25]Tech Resources



[1] https://news.opensuse.org/2023/03/02/tw-gains-optional-optimizations/

[2] https://www.theregister.com/2022/07/26/suse_adaptable_linux_platform/

[3] https://www.theregister.com/2022/11/30/opensuse_drops_x86_32/

[4] https://www.theregister.com/2022/12/16/tumbleweed_reverses_x864v2_plan/

[5] https://www.gnu.org/software/libc/manual/html_node/Hardware-Capability-Tunables.html

[6] https://www.gnu.org/software/libc/

[7] https://sourceware.org/pipermail/libc-alpha/2021-February/122207.html

[8] https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build

[9] https://antlarr.io/2021/03/hackweek-20-glibc-hwcaps-in-opensuse/

[10] https://antlarr.io/2021/03/microarchitecture-rpm-macros/

[11] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZAoQss6dACbAZ7ffUfvTIwAAAMY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[12] https://build.opensuse.org/package/show/openSUSE:Factory/patterns-glibc-hwcaps

[13] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZAoQss6dACbAZ7ffUfvTIwAAAMY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[14] https://www.intel.com/content/www/us/en/architecture-and-technology/avx-512-overview.html

[15] https://www.theregister.com/2022/11/01/intel_sapphire_rapids_q1_2023/

[16] https://www.theregister.com/2023/01/16/powering_up_the_servers_of/

[17] https://www.intel.com/content/www/us/en/support/articles/000089918/processors.html

[18] https://www.theregister.com/2023/02/16/bulletproof_linux/

[19] https://www.theregister.com/2023/01/05/siduction_2022_1/

[20] https://www.theregister.com/2022/12/23/new_preview_versions_of_suses/

[21] https://www.theregister.com/2022/12/16/tumbleweed_reverses_x864v2_plan/

[22] https://www.theregister.com/2022/09/30/google_intel_vm_optimization/

[23] https://www.theregister.com/2022/12/02/ml_attention_center_model_freed/

[24] https://www.theregister.com/2022/10/31/jpeg_xl_axed_chrome/

[25] https://whitepapers.theregister.com/



Anonymous Coward

It sure sounds like what Solaris was doing a couple of decades ago, nice to see it adopted in Linux.

Two wrongs are only the beginning.
-- Kohn