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

Wheel support for linux aarch64 #1782

Closed
odidev opened this issue Jul 3, 2020 · 17 comments
Closed

Wheel support for linux aarch64 #1782

odidev opened this issue Jul 3, 2020 · 17 comments

Comments

@odidev
Copy link

odidev commented Jul 3, 2020

Summary
Installing psutil on aarch64 via pip using command "pip3 install psutil" tries to build wheel from source code

Problem description
psutil don't have wheel for aarch64 on PyPI repository. So, while installing psutil via pip on aarch64, pip builds wheel for same resulting in it takes more time to install psutil. Making wheel available for aarch64 will benefit aarch64 users by minimizing psutil installation time.

Expected Output
Pip should be able to download psutil wheel from PyPI repository rather than building it from source code.

@psutil-taem, please let me know if I can help you building wheel/uploading to PyPI repository. I am curious to make psutil wheel available for aarch64. It will be a great opportunity for me to work with you.

@odidev
Copy link
Author

odidev commented Jul 13, 2020

Gentle Reminder!!!

@SoraDevin
Copy link

gentle but firm reminder

@giampaolo
Copy link
Owner

Looking back at this: in general I'm not planning on supporting / distributing wheels for aarch64 at the moment. The current build matrix run tests + generates wheels on the following [platform / arch / python-version] combinations:

windows (total = 10)                                      size    arch   pyver
psutil-5.8.1-cp27-none-win32.whl                        230.9K      32    py27
psutil-5.8.1-cp27-none-win_amd64.whl                    234.2K      64    py27
psutil-5.8.1-cp36-cp36m-win32.whl                       234.7K      32    py36
psutil-5.8.1-cp36-cp36m-win_amd64.whl                   239.1K      64    py36
psutil-5.8.1-cp37-cp37m-win32.whl                       234.7K      32    py37
psutil-5.8.1-cp37-cp37m-win_amd64.whl                   239.1K      64    py37
psutil-5.8.1-cp38-cp38-win32.whl                        235.3K      32    py38
psutil-5.8.1-cp38-cp38-win_amd64.whl                    239.7K      64    py38
psutil-5.8.1-cp39-cp39-win32.whl                        235.8K      32    py39
psutil-5.8.1-cp39-cp39-win_amd64.whl                    240.4K      64    py39

macos (total = 5)                                         size    arch   pyver
psutil-5.8.1-cp27-cp27m-macosx_10_9_x86_64.whl          230.3K      64    py27
psutil-5.8.1-cp36-cp36m-macosx_10_9_x86_64.whl          230.6K      64    py36
psutil-5.8.1-cp37-cp37m-macosx_10_9_x86_64.whl          230.6K      64    py37
psutil-5.8.1-cp38-cp38-macosx_10_9_x86_64.whl           230.9K      64    py38
psutil-5.8.1-cp39-cp39-macosx_10_9_x86_64.whl           230.8K      64    py39

linux (total = 12)                                        size    arch   pyver
psutil-5.8.1-cp27-cp27m-manylinux2010_i686.whl          277.7K      32    py27
psutil-5.8.1-cp27-cp27m-manylinux2010_x86_64.whl        280.9K      64    py27
psutil-5.8.1-cp27-cp27mu-manylinux2010_i686.whl         277.7K      32    py27
psutil-5.8.1-cp27-cp27mu-manylinux2010_x86_64.whl       280.9K      64    py27
psutil-5.8.1-cp36-cp36m-manylinux2010_i686.whl          282.4K      32    py36
psutil-5.8.1-cp36-cp36m-manylinux2010_x86_64.whl        284.9K      64    py36
psutil-5.8.1-cp37-cp37m-manylinux2010_i686.whl          283.4K      32    py37
psutil-5.8.1-cp37-cp37m-manylinux2010_x86_64.whl        289.3K      64    py37
psutil-5.8.1-cp38-cp38-manylinux2010_i686.whl           286.8K      32    py38
psutil-5.8.1-cp38-cp38-manylinux2010_x86_64.whl         289.0K      64    py38
psutil-5.8.1-cp39-cp39-manylinux2010_i686.whl           284.1K      32    py39
psutil-5.8.1-cp39-cp39-manylinux2010_x86_64.whl         286.5K      64    py39

freebsd + py2.7
freebsd + py3.x

total = 29 unit test runs + 27 wheels

The above is triggered on each commit, and it's quite costly both in terms of build time and maintenance, especially when we get close to a release (I already removed the PYPY matrix because of this). Adding yet another platform/arch (also sort of exotic in this case) to the matrix, make sure it works, fix tests, guarantee that the distributed wheels work etc. is extra work I'm unwilling to take to be honest.

@sebasv
Copy link

sebasv commented Mar 28, 2022

I'd like to point out that ARM is here to stay, Apple is releasing more and more devices with ARM processors and I'm struggling to find a workaround

georgemarshall pushed a commit to georgemarshall/psutil that referenced this issue Apr 6, 2022
Change the build.yml to add aarch64/arm64 builds

Closes giampaolo#1782, closes giampaolo#1945, closes giampaolo#1954, closes giampaolo#1966, closes giampaolo#1972,
closes giampaolo#2090

Signed-off-by: George Marshall <[email protected]>
@glenn-jocher
Copy link

glenn-jocher commented May 17, 2022

+1. Affecting YOLOv5 Docker builds

@gilbahat
Copy link

With graviton 1/2/3 and Ampere altra becoming standard on mainstream clouds and with aarch64 being the de-facto android architecture of choice. I vote +1.

Maybe it's time to put i686 to rest in lieu?

danbunnell added a commit to danbunnell/fbpcs that referenced this issue Aug 16, 2022
Summary:
An issue was encountered that prevented build of the `pce_deployment` image against the aarch64/arm64 platform.

Building the Docker image against aarch64 fails due to some missing build dependencies: `gcc`, `python3-dev`. This is because a project dependency, the `psutil` wheel, is not distributed with the aarch64 build and instead it is compiled from source (see [Wheel support for linux aarch64 · Issue facebookresearch#1782 · giampaolo/psutil · GitHub](giampaolo/psutil#1782)).

This change updates the corresponding Dockerfile to install the dependencies required to compile the wheel.

Reviewed By: ajaybhargavb

Differential Revision: D38541052

fbshipit-source-id: 9ce75bd3016de062ba601649849840f85d881a6e
facebook-github-bot pushed a commit to facebookresearch/fbpcs that referenced this issue Aug 16, 2022
…1448)

Summary:
Pull Request resolved: #1448

An issue was encountered that prevented build of the `pce_deployment` image against the aarch64/arm64 platform.

Building the Docker image against aarch64 fails due to some missing build dependencies: `gcc`, `python3-dev`. This is because a project dependency, the `psutil` wheel, is not distributed with the aarch64 build and instead it is compiled from source (see [Wheel support for linux aarch64 · Issue #1782 · giampaolo/psutil · GitHub](giampaolo/psutil#1782)).

This change updates the corresponding Dockerfile to install the dependencies required to compile the wheel.

Reviewed By: ajaybhargavb

Differential Revision: D38541052

fbshipit-source-id: 18b893729f705317b3f3d7ee9ddeff14f1ec5002
@jamel
Copy link

jamel commented Jan 10, 2023

One more vote to add support of aarch64. It becomes more and more popular with Apple's M1/2 and in major cloud providers including AWS, GCP and Azure.

@SoraDevin
Copy link

AWS Panorama is built on it too.

@jasonrichdarmawan
Copy link

jasonrichdarmawan commented Feb 5, 2023

NVIDIA Jetson Nano B01 uses aarch64. We planned to use anomalib. psutil can't be installed on aarch64, affecting anomalib.

@timorkal
Copy link

why is this closed?

@jklap jklap mentioned this issue Feb 21, 2023
@jgehrcke
Copy link

jgehrcke commented Mar 21, 2023

In https://pypi.org/project/psutil/5.9.4/#files I see psutil-5.9.4-cp38-abi3-macosx_11_0_arm64.whl but that is not sufficient when installing in a Linux container on a Mac.

From that build log:

#0 5.866 Collecting numpy
#0 5.887   Downloading numpy-1.24.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
...
#0 8.377 Collecting psutil
#0 8.405   Downloading psutil-5.9.4.tar.gz (485 kB)

In that environment pip was happy with selecting the manylinux (docs here) aarch64 wheel for numpy, but the -macosx_11_0_arm64 wheel for psutil-5.9.4 wasn't a match and it downloaded the source distribution instead.

From the build log excerpt above it's kind of apparent that we want a manylinux aarch64 wheel for psutil :).

@chlndh
Copy link

chlndh commented Jun 12, 2023

And building it manually results in an error: gcc: error: unrecognized debug output level ‘mlt’

@Manouchehri
Copy link

Not sure why this was closed as complete, it's not a thing yet as far as I can tell.

Would be nice to be able to deploy arm64 Lambdas that use psutil.

@SoraDevin
Copy link

@giampaolo reopen this please

@michielswaanen
Copy link

Same issue here, Dockerfile with a specific arm64/v8 arch not build because of psutil.

@giampaolo

Dockerfile build error

109.8 Building wheels for collected packages: psutil
109.8   Building wheel for psutil (pyproject.toml): started
112.2   Building wheel for psutil (pyproject.toml): finished with status 'error'
112.3   error: subprocess-exited-with-error
112.3
112.3   × Building wheel for psutil (pyproject.toml) did not run successfully.
112.3   │ exit code: 1
112.3   ╰─> [43 lines of output]
112.3       running bdist_wheel
112.3       running build
112.3       running build_py
112.3       creating build
112.3       creating build/lib.linux-aarch64-cpython-310
112.3       creating build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_pslinux.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_common.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_pssunos.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_psosx.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_compat.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_pswindows.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_psaix.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/__init__.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_psbsd.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       copying psutil/_psposix.py -> build/lib.linux-aarch64-cpython-310/psutil
112.3       creating build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_system.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/__init__.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/runner.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-310/psutil/tests
112.3       running build_ext
112.3       building 'psutil._psutil_linux' extension
112.3       creating build/temp.linux-aarch64-cpython-310
112.3       creating build/temp.linux-aarch64-cpython-310/psutil
112.3       gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=596 -DPy_LIMITED_API=0x03060000 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -DPSUTIL_LINUX=1 -I/usr/local/include/python3.10 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-310/psutil/_psutil_common.o
112.3       psutil could not be installed from sources because gcc is not installed. Try running:
112.3         sudo apt-get install gcc python3-dev
112.3       error: command 'gcc' failed: No such file or directory
112.3       [end of output]
112.3
112.3   note: This error originates from a subprocess, and is likely not a problem with pip.
112.3   ERROR: Failed building wheel for psutil
112.3 Failed to build psutil
112.3 ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects

@mattriordan1uphealth
Copy link

For those still looking for a solution. This worked for me on a gravaton based EC2 instance:

sudo yum install gcc python3-devel
pip install --no-binary :all: psutil

https://github.com/giampaolo/psutil/blob/master/INSTALL.rst

@giampaolo
Copy link
Owner

aarch64 wheels are now published on PYPI as of psutil 6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet