apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.73k stars 6.8k forks source link

import mxnet in arm64 error #19234

Open lele012 opened 3 years ago

lele012 commented 3 years ago

Description

This error occurred when I was using MXNET on ARM64。

“/usr/local/lib/python3.7/site-packages/mxnet/libmxnet.so”,but in the path,lib file(libmxnet.so) is existed.

I installed MXNET by "pip install mxnet"。Is there no ARM64 MXNET image on Dockerhub ?

Error Message

root@face-6ff98747f6-rtl5n:/# python Python 3.7.9 (default, Sep 10 2020, 15:29:47) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import mxnet as mx Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.7/site-packages/mxnet/init.py", line 24, in from .context import Context, current_context, cpu, gpu, cpu_pinned File "/usr/local/lib/python3.7/site-packages/mxnet/context.py", line 24, in from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass File "/usr/local/lib/python3.7/site-packages/mxnet/base.py", line 214, in _LIB = _load_lib() File "/usr/local/lib/python3.7/site-packages/mxnet/base.py", line 205, in _load_lib lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL) File "/usr/local/lib/python3.7/ctypes/init.py", line 364, in init self._handle = _dlopen(self._name, mode) OSError: /usr/local/lib/python3.7/site-packages/mxnet/libmxnet.so: cannot open shared object file: No such file or directory

github-actions[bot] commented 3 years ago

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.

szha commented 3 years ago

@lele012 at the moment users need to build from source for arm support. The one available on pip should be for amd64 only. We are planning on adding official arm support in near future. cc @sandeep-krishnamurthy

lele012 commented 3 years ago

@szha Ok,i know ,thanks。Later,i will try to build from source.

sandeep-krishnamurthy commented 3 years ago

@mseth10 @josephevans

nirantarashwin commented 3 years ago

@lele012 at the moment users need to build from source for arm support. The one available on pip should be for amd64 only. We are planning on adding official arm support in near future. cc @sandeep-krishnamurthy

Is there a link to building it from source for arm64?

leezu commented 3 years ago

You can follow the normal build-from-source instructions @nirantarashwin. If you like to do cross-compile, you can set up your environment by following https://github.com/apache/incubator-mxnet/blob/12ec04611c78a603c03707488d66bdbbedf0d536/ci/docker/Dockerfile.build.arm#L109-L128 and pass the -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} argument to cmake when configuring the compilation.

nirantarashwin commented 3 years ago

You can follow the normal build-from-source instructions @nirantarashwin. If you like to do cross-compile, you can set up your environment by following

https://github.com/apache/incubator-mxnet/blob/12ec04611c78a603c03707488d66bdbbedf0d536/ci/docker/Dockerfile.build.arm#L109-L128

and pass the -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} argument to cmake when configuring the compilation.

Got it. Thank you very much :)

leoaaaaaaa commented 2 years ago

@nirantarashwin Have you built it on arm64 successfully? thanks very much.

leoaaaaaaa commented 2 years ago

@szha Have we already released the arm64 build? thanks very much.

xintin commented 2 years ago

@szha @nirantarashwin Is there any update on the official support for mxnet whl for arm CPU? Also, build from source instructions available at https://mxnet.apache.org/versions/1.8.0/get_started/build_from_source are not proper! It says python3 -m pip install --user -e ./python without other make or build instructions.

Can you provide more details on this, please?

Thank you.

szha commented 2 years ago

@mseth10 worked on arm build and may be able to provide update

Tomaubier commented 2 years ago

Any update on this?

mseth10 commented 2 years ago

Hi @Tomaubier , here's the public MXNet 1.9 wheel that supports aarch64 https://repo.mxnet.io/dist/python/cpu/mxnet-1.9.0-py3-none-manylinux2014_aarch64.whl . Currently it takes ArmPL as a dependency, so you need to install ArmPL corresponding to your OS from here https://developer.arm.com/tools-and-software/server-and-hpc/downloads/arm-performance-libraries For example, these worked for me on rhel7

# install Arm Performance Libraries
wget https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/21-1-0/RHEL7/arm-performance-libraries_21.1_RHEL-7_gcc-8.2.tar?revision=d6133508-1bcc-4fca-aeb1-4bba06d3898f
tar -xvf arm-performance-libraries_21.1_RHEL-7_gcc-8.2.tar\?revision\=d6133508-1bcc-4fca-aeb1-4bba06d3898f 
sudo arm-performance-libraries_21.1_RHEL-7_gcc-8.2/arm-performance-libraries_21.1_RHEL-7.sh -a
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl_21.1_gcc-8.2/lib

# Install MXNet that takes Arm PL as a dependency
wget https://repo.mxnet.io/dist/python/cpu/mxnet-1.9.0-py3-none-manylinux2014_aarch64.whl
python3 -c 'import mxnet'
chenx2018 commented 2 years ago

any updates?

TobiasRafael commented 2 years ago

updates?

ashsyal commented 1 year ago

wget https://repo.mxnet.io/dist/python/cpu/mxnet-1.9.0-py3-none-manylinux2014_aarch64.whl python3 -c 'import mxnet'

I ran through all these steps on aarch64 using ubuntu 20.04 but didnt seem to work.

root@qrb5165-rb5:~/mxnet# python3.6 Python 3.6.9 (default, Jun 29 2022, 11:45:57) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import mxnet Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.6/dist-packages/mxnet/init.py", line 23, in from .context import Context, current_context, cpu, gpu, cpu_pinned File "/usr/local/lib/python3.6/dist-packages/mxnet/context.py", line 23, in from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass File "/usr/local/lib/python3.6/dist-packages/mxnet/base.py", line 356, in _LIB = _load_lib() File "/usr/local/lib/python3.6/dist-packages/mxnet/base.py", line 347, in _load_lib lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL) File "/usr/lib/python3.6/ctypes/init.py", line 348, in init self._handle = _dlopen(self._name, mode) OSError: libarmpl_lp64_mp.so: cannot open shared object file: No such file or directory

Any way to resolve this?

ashsyal commented 1 year ago

Here are my steps for reference:

  1. wget https://developer.arm.com/-/media/Files/downloads/hpc/arm-performance-libraries/22-0-2/Ubuntu20.04/arm-performance-libraries_22.0.2_Ubuntu-20.04_gcc-11.2.tar?rev=577d3dbcff7847b9af57399b2978f9a6&revision=577d3dbc-ff78-47b9-af57-399b2978f9a6
  2. tar -xvf arm-performance-libraries_22.0.2_Ubuntu-20.04_gcc-11.2.tar\?rev\=577d3dbcff7847b9af57399b2978f9a6
  3. sudo arm-performance-libraries_22.0.2_Ubuntu-20.04/arm-performance-libraries_22.0.2_Ubuntu-20.04.sh -a
  4. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/arm/armpl-22.0.2-gcc-11.2/lib
  5. wget https://repo.mxnet.io/dist/python/cpu/mxnet-1.9.0-py3-none-manylinux2014_aarch64.whl
  6. pip3 install mxnet-1.9.0-py3-none-manylinux2014_aarch64.whl

I am using a Qualcomm QRB5165 aarch64 chipset

Joetibz commented 1 year ago

please has anyone resolved this i am still getting error when i try to run "import mxnet" on my Xilinx FPGA board