Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avx2_shift_lib logic is wrong #17

Open
joebonrichie opened this issue Mar 9, 2021 · 4 comments
Open

avx2_shift_lib logic is wrong #17

joebonrichie opened this issue Mar 9, 2021 · 4 comments
Projects

Comments

@joebonrichie
Copy link
Contributor

(Making this so Bryan sees it for libypkg rewrite).

Currently the avx2_shift_lib command in rc.yml dumps everything into /usr/lib64/haswell/*, this is wrong for packages which install themselves to /usr/lib64/packagename. avx2_shift_lib will install such packages to /usr/lib64/haswell/packagename, however, glibc actually tries to load haswell libs from /usr/lib64/packagename/haswell

Strace output from glibc 2.33 (which also searches the new glibc-hwcaps directories)

openat(AT_FDCWD, "/usr/lib64/gvfs/glibc-hwcaps/x86-64-v3/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/glibc-hwcaps/x86-64-v3", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/glibc-hwcaps/x86-64-v2/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/glibc-hwcaps/x86-64-v2", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/tls/haswell/x86_64/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/tls/haswell/x86_64", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/tls/haswell/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/tls/haswell", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/tls/x86_64/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/tls/x86_64", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/tls/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/tls", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/haswell/x86_64/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/haswell/x86_64", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/haswell/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/haswell", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/x86_64/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib64/gvfs/x86_64", 0x7fff9cfe9cb0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/gvfs/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = 4

Setting %libdir% back to /usr/lib64/haswell (which special care taken for the glibc package) or manually mangling the libs after the install step to /usr/lib64/packagename/haswell would fix this.

Potentially, .so.avx2files could be skipped so patching packages which dlopen their modules would be easier.

@DataDrake
Copy link
Contributor

DataDrake commented Mar 9, 2021

This is a non-issue at the moment, since avx2 is really only used with a few key libraries where performance has been thoroughly tested and the libs are in the libdir anyways. gvfs isn't something I'd generally consider a candidate for haswell optimizations.

@DataDrake
Copy link
Contributor

I do agree that libdir is being incorrectly set for avx2 builds.

@joebonrichie
Copy link
Contributor Author

gvfs was only used an an example as the strace was handy, but yeah it would unlock enabling avx2 in a few more packages, i believe I ran into this originally when looking into avx2 for octave.

@DataDrake
Copy link
Contributor

I don't really think it's worth it in octave. I looked at this in the past and it gets most benefit from its dependencies getting AVX2 (fftw, openblas). The rest of the internal stuff is either a light wrapper for those functions or awful interpreter code that's beyond saving.

@DataDrake DataDrake added this to Backlog in Packaging Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Packaging
Backlog
Development

No branches or pull requests

2 participants