Page MenuHomeSolus

Enable support for python to dlopen .so.avx2 libs
ClosedPublic

Authored by joebonrichie on Jul 24 2021, 7:28 AM.
Tags
None
Referenced Files
F11072947: D11518.id28135.diff
Sat, Aug 12, 3:10 AM
F11072946: D11518.id28593.diff
Sat, Aug 12, 3:10 AM
F11054142: D11518.diff
Fri, Aug 11, 12:26 AM
F11001330: D11518.id28594.diff
Sun, Jul 30, 2:46 AM
F10895043: D11518.id28134.diff
Jul 1 2023, 2:18 PM
F10844646: D11518.id28134.diff
Jun 10 2023, 9:34 PM
F10841771: D11518.id28595.diff
Jun 10 2023, 8:48 AM
F10841430: D11518.id27873.diff
Jun 10 2023, 7:09 AM
Subscribers

Details

Summary

With this patch python can first try and dlopen .so.avx2 libs if
they exist on the system and the cpu is supported.

This is neccessary as python dlopens solib files and as such standard
glibc hwcaps mechasism can't be used.

Test Plan

Confirm .so.avx2 libs are loaded on a supported system
Confirm normal .so libs are loaded if .so.avx2 libs don't exist
TODO: ensure .so.avx2 files are ignored on a non-supported system.

Diff Detail

Repository
R2527 python3
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 1159
Build 1159: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jul 24 2021, 12:04 PM

Just realized that since we compile for haswell and __builtin_cpu_supports only checks for avx2 here it could lead to segfaults on amd excavator. Will expand the cpu checks to be more like glibc haswell platform see here.

Will also need to backport this patch from gcc if cpu capabilities are expanded. Linking here for future reference. https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=a0b4e09ab0102d9c0a5e6d603a080cb78600c40d

Closing this as the ypkg PR has been merged and our ypkg has been updated to have this macro.

JoshStrobl edited reviewers, added: joebonrichie; removed: JoshStrobl.

Oh ffs I closed the wrong diff.

joebonrichie edited reviewers, added: JoshStrobl; removed: joebonrichie.
This revision is now accepted and ready to land.Jul 30 2021, 3:14 PM

Rebase against python3, no longer RFC. Also check for popcnt to exclude bdver4.

joebonrichie retitled this revision from [RFC] Enable support for python to dlopen .so.avx2 libs to Enable support for python to dlopen .so.avx2 libs.
joebonrichie edited the summary of this revision. (Show Details)

No longer RFC

Fix typo count -> check in patch