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

PowerPC page size issue with released binaries #6528

Closed
rjzak opened this issue Aug 23, 2024 · 11 comments · Fixed by #7298
Closed

PowerPC page size issue with released binaries #6528

rjzak opened this issue Aug 23, 2024 · 11 comments · Fixed by #7298
Labels
bug Something isn't working help wanted Contribution especially encouraged releases Related to building and distributing release artifacts of uv

Comments

@rjzak
Copy link

rjzak commented Aug 23, 2024

The released binaries for powerpc64le don't run on 64k page size systems, but uv runs on those systems when compiled from source.

~/Downloads
❯ ./uv-powerpc64le-unknown-linux-gnu/uv -V
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 56 bytes failed
Aborted

~/Downloads
❯ ./uv-powerpc64le-unknown-linux-musl/uv -V
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 56 bytes failed
Aborted

~/Downloads
❯ ./uv-0.3.2/target/release/uv -V
uv 0.3.2

~/Downloads
❯ uname -a
Linux behemoth 6.1.0-23-powerpc64le #1 SMP Debian 6.1.99-1 (2024-07-15) ppc64le GNU/Linux

~/Downloads
❯ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm

~/Downloads
❯ getconf PAGESIZE
65536

This may be an issue since I think most ppc64 systems use 64k as that seems to be the default. As far as I know, the discontinued Void Linux PPC and Chimera Linux are the only ppc64 systems which used 4k pages.

@zanieb
Copy link
Member

zanieb commented Aug 23, 2024

Is this a duplicate of #4647 but for our distributions?

@rjzak
Copy link
Author

rjzak commented Aug 23, 2024

Yes, sorry I missed that. It's also not clear that issue is with the released binaries from the GitHub releases page or something else, but I think aarch64 has the same issue with some distributions but I'm not sure.

This is an issue with the ppc64le binaries on the releases page.

@charliermarsh charliermarsh added the bug Something isn't working label Aug 25, 2024
@charliermarsh
Copy link
Member

Any idea how to approach fixing this? Do we need to set a different page size during build?

@rjzak
Copy link
Author

rjzak commented Aug 25, 2024

I'd say just have a note in the readme, release notes, or the binary file name to indicate the binary expects 4k pages on ppc64 (and probably arm) where 4k isn't the default. As for how to have your build environment run with a 64k page size when you likely aren't running on bare metal, I don't know. Can Docker allow running with different page sizes?

@zanieb zanieb added the releases Related to building and distributing release artifacts of uv label Aug 26, 2024
@zanieb
Copy link
Member

zanieb commented Aug 26, 2024

We do this

maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16

per

@rjzak
Copy link
Author

rjzak commented Aug 26, 2024

That looks good for ARM devices.

@tom-miller1
Copy link
Contributor

Same results on an IBM Power9 server, both the downloaded artifact from the release page and the pip-installed binary fail in jemalloc. Have not yet tried to build from the source, but this is a blocker for using uv as a CI build and test target for our internal Python apps on ppc64le.

$ .venv/bin/uv
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 56 bytes failed
Abort(coredump)

$ tail -4 /proc/cpuinfo
platform        : pSeries
model           : IBM,9009-22A
machine         : CHRP IBM,9009-22A
MMU             : Hash

$ uname -srvmio        
Linux 4.18.0-477.43.1.el8_8.ppc64le #1 SMP Thu Jan 4 09:45:15 EST 2024 ppc64le ppc64le GNU/Linux

$ /bin/getconf PAGESIZE
65536

@rjzak
Copy link
Author

rjzak commented Sep 10, 2024

Maybe build from source and cache the binary for your CI? The build is pretty simple and straightforward.

@tom-miller1
Copy link
Contributor

Looks like this was fixed for ppc64le in Ruff using the same build flags that are being passed to maturin for aarch64. Could the same fix be applied to uv?

astral-sh/ruff#10073

@zanieb
Copy link
Member

zanieb commented Sep 11, 2024

I'm happy to review a PR and see if it fixes it.

@charliermarsh
Copy link
Member

Yeah we should apply those changes. I actually thought we already had them in the build script, but it turns out they're only applied to some other architectures and not PowerPC.

@charliermarsh charliermarsh added the help wanted Contribution especially encouraged label Sep 11, 2024
tom-miller1 added a commit to tom-miller1/uv that referenced this issue Sep 11, 2024
## Summary

Add maturin build flag to set 64kb page size on PPC64 and PPC64LE
architectures. Not aware of modern systems that use 4kb pages.

Resolves astral-sh#6528

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Author:    Tom <[email protected]>
# Date:      Wed Sep 11 11:10:13 2024 -0400
#
# On branch main
# Your branch and 'origin/main' have diverged,
# and have 1 and 2 different commits each, respectively.
#   (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
#	modified:   build-binaries.yml
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contribution especially encouraged releases Related to building and distributing release artifacts of uv
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants