I was unable to compile and install Mxnet1.5 with tensorrt on the jetson nano,Is there someone have compile it, please help me. Thank you.

I was unable to compile and install MXNET1.5 with tensorrt on the jetson nano,Is there someone have compile it, please help me. Thank you.

Hi,

We don’t have prebuilt package for MXNET 1.5 but you can follow this comment to compile it from the source:
https://devtalk.nvidia.com/default/topic/1049293/jetson-nano/i-was-unable-to-compile-and-install-mxnet-on-the-jetson-nano-is-there-an-official-installation-tutorial-/post/5326119/#5326119

Thanks.

Hi,

Here is a latest MXNET package(v1.6) for JetPack4.3.

1. Python 2.7: download

$ sudo pip3 install mxnet-1.6.0-py2-none-any.whl
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
$ python
>> import mxnet

1. Python 3.6: download

sudo pip3 install mxnet-1.6.0-py3-none-any.whl
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
$ python3
>> import mxnet

Thanks.

1 Like

Thank you very much!

When I try either this or the previous thread this was linked to, I get this message:

The directory '/home/jason/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/jason/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement 'mxnet-1.6.0-py2-none-any.whl' looks like a filename, but the file does not exist

It’s a basic install flashing the latest SD card image for the Jetson Nano, with absolutely nothing else done besides the typical “create an account, pick your locale” for a typical Ubunutu first-start.

Any help, please?

Did you dowmload pip file mxnet-1.6.0-py3-none-any.whl or mxnet-1.6.0-py2-none-any.whl

Hi, AastaLLL

I’am use jetson xavier, jetpack 4.3 and python3.6.9.

I try to install using the command: pip3 install mxnet-1.6.0-py3-none-any.whl but found error:

[b]ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/atos/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ro4tnnn9/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i Simple index – setuptools wheel ‘Cython>=0.29.14’
cwd: None
Complete output (39 lines):
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/atos/.local/lib/python3.6/site-packages/pip/main.py”, line 16, in
from pip._internal.cli.main import main as _main # isort:skip # noqa
File “/home/atos/.local/lib/python3.6/site-packages/pip/_internal/cli/main.py”, line 5, in
import locale
File “/usr/lib/python3.6/locale.py”, line 16, in
import re
File “/usr/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 53, in apport_excepthook
if not enabled():
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 24, in enabled
import re
File “/usr/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

Original exception was:
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/atos/.local/lib/python3.6/site-packages/pip/main.py”, line 16, in
from pip._internal.cli.main import main as _main # isort:skip # noqa
File “/home/atos/.local/lib/python3.6/site-packages/pip/_internal/cli/main.py”, line 5, in
import locale
File “/usr/lib/python3.6/locale.py”, line 16, in
import re
File “/usr/lib/python3.6/re.py”, line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module ‘enum’ has no attribute ‘IntFlag’

ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/atos/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ro4tnnn9/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i Simple index – setuptools wheel ‘Cython>=0.29.14’ Check the logs for full command output.[/b]

complete terminal log for command pip3 install mxnet-1.6.0-py3-none-any.whl:

Defaulting to user installation because normal site-packages is not writeable
Processing ./mxnet-1.6.0-py3-none-any.whl
Requirement already satisfied: graphviz<0.9.0,>=0.8.1 in /home/atos/.local/lib/python3.6/site-packages (from mxnet==1.6.0) (0.8.4)
Collecting numpy<2.0.0,>1.16.0
  Using cached numpy-1.18.1.zip (5.4 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /home/atos/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ga85p1i5/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.14'
       cwd: None
  Complete output (39 lines):
  Traceback (most recent call last):
    File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/home/atos/.local/lib/python3.6/site-packages/pip/__main__.py", line 16, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/home/atos/.local/lib/python3.6/site-packages/pip/_internal/cli/main.py", line 5, in <module>
      import locale
    File "/usr/lib/python3.6/locale.py", line 16, in <module>
      import re
    File "/usr/lib/python3.6/re.py", line 142, in <module>
      class RegexFlag(enum.IntFlag):
  AttributeError: module 'enum' has no attribute 'IntFlag'
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 53, in apport_excepthook
      if not enabled():
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
      import re
    File "/usr/lib/python3.6/re.py", line 142, in <module>
      class RegexFlag(enum.IntFlag):
  AttributeError: module 'enum' has no attribute 'IntFlag'
  
  Original exception was:
  Traceback (most recent call last):
    File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/home/atos/.local/lib/python3.6/site-packages/pip/__main__.py", line 16, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "/home/atos/.local/lib/python3.6/site-packages/pip/_internal/cli/main.py", line 5, in <module>
      import locale
    File "/usr/lib/python3.6/locale.py", line 16, in <module>
      import re
    File "/usr/lib/python3.6/re.py", line 142, in <module>
      class RegexFlag(enum.IntFlag):
  AttributeError: module 'enum' has no attribute 'IntFlag'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/atos/.local/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-ga85p1i5/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.14' Check the logs for full command output.

how can i fix this error?

I install pip3 install numpy==1.16.1 then install mxnet with command: sudo pip3 install mxnet-1.6.0-py3-none-any.whl and it works.

Tried it on Jetson Nano, but get following:

Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mxnet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/mxnet/__init__.py", line 24, in <module>
    from .context import Context, current_context, cpu, gpu, cpu_pinned
  File "/usr/local/lib/python3.6/dist-packages/mxnet/context.py", line 24, in <module>
    from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass
  File "/usr/local/lib/python3.6/dist-packages/mxnet/base.py", line 214, in <module>
    _LIB = _load_lib()
  File "/usr/local/lib/python3.6/dist-packages/mxnet/base.py", line 204, in _load_lib
    lib_path = libinfo.find_lib_path()
  File "/usr/local/lib/python3.6/dist-packages/mxnet/libinfo.py", line 74, in find_lib_path
    'List of candidates:\n' + str('\n'.join(dll_path)))
RuntimeError: Cannot find the MXNet library.
List of candidates:
/usr/local/cuda/lib64/libmxnet.so
libmxnet.so
/usr/local/lib/python3.6/dist-packages/mxnet/libmxnet.so
/usr/local/lib/python3.6/dist-packages/mxnet/../../lib/libmxnet.so
/usr/local/lib/python3.6/dist-packages/mxnet/../../build/libmxnet.so
../../../libmxnet.so

Hi,dkreutz

I had the same mistake. I solved add:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mxnet

this solved the error.

Hey Lucas,

Thanks, that solved the problem for me as well.

I ran the mxnet_numpy_performance_test on my Jetson Nano and got some interesting results:

NumPy : Dotted two 512x512 matrices in 0.05 s.
mxnet.numpy : Dotted two 512x512 matrices in 0.08 s.
mxnet.numpy on GPU : Dotted two 512x512 matrices in 0.01 s.

NumPy : Dotted two 1024x1024 matrices in 0.38 s.
mxnet.numpy : Dotted two 1024x1024 matrices in 0.65 s.
mxnet.numpy on GPU : Dotted two 1024x1024 matrices in 0.03 s.

NumPy : Dotted two 2048x2048 matrices in 2.96 s.
mxnet.numpy : Dotted two 2048x2048 matrices in 5.22 s.
mxnet.numpy on GPU : Dotted two 2048x2048 matrices in 0.10 s.

NumPy : Dotted two 4096x4096 matrices in 23.62 s.
mxnet.numpy : Dotted two 4096x4096 matrices in 41.78 s.
mxnet.numpy on GPU : Dotted two 4096x4096 matrices in 0.65 s.

Looking at jtop’s cpu utilization meters it looks like that mxnet.numpy uses only one CPU core while NumPy uses all four. Am I missing here something or is there some room for optimizing compile/build parameters?

Hi @AastaLLL , thanks for providing customers with an MXNet package for Jetson. I am an MXNet community member and was looking forward to fixing the instructions on MXNet page for Jetson support Jetson Setup | Apache MXNet
Can you please help me with steps you used to build your MXNet package for Jetson? Thanks!

Hi, my first post

When i try to build mxnet with flag USE_TENSORRT = 1 , I can not build it from source, may u try to build it with TENSORRT and tell us how, or another build . It will help a lot

Will we see an mxnet wheel for JetPack 4.4 – that is compiled to use CUDA 10.2?

1 Like

Hi,

We are going to build a MXNet package with TensorRT support for JetPack4.4.
Will share with you once it’s done.

Thanks.

1 Like

I’m trying to build the MXNet package for JetPack 4.4, but lack for a deb file:

I’m just shocked at how hard (impossible) it is to install mxnet for python3 on the nvidia jetson nano.
I’ve spent all week trying to do this and am super frustrated. Is it really this hard?
I’ve stopped trying to compile now and am installing from the wheel using: sudo pip3 install mxnet-1.6.0-py3-none-any.whl
However import cv fails with:
OSError: libcudart.so.10.0: cannot open shared object file: No such file or directory.
nvcc --version shows I have cuda release 10.2

So it seems I either:

  1. Find a wheel for mxnet for cuda10.2 - but I can’t find one
  2. Compile myself - but I’ve failed so many times. Where is a decent walk through for python3?
  3. Downgrade to cuda10.0 - how do I do that?

Is it really this hard? I don’t want to speak badly of the Jetson Nano but i’ve heard of others switching to Intel boards to get over issues exactly like this. I really don’t want to have to switch.

Any ideas are greatly appreciated. I can’t handle the constant failures much longer

Hi,i met the same problem about OSError: libcudart.so.10.0 and i use this method to solve that:
Copy libmxnet.so from /usr/local/mxnet/ to /usr/local/lib/python3.6/dist-packages/mxnet/.
You can try this method.

Hi @Easit_Mickly,
Thanks for the tip. Unfortunately the error hasn’t changed.
Did you need to do anything else?
When you run nvcc --version do you see release 10.2?

Emm, it’s long time ago, i forget the detail. Or you can try to make a link to libmxnet.so in /usr/local/mxnet/.@ djenny