I was unable to compile and install MXNET on the jetson nano,Is there an official installation tutorial?

Okay, thanks.

Let’s track the following status on the new topic.

This command can successfully install mxnet, but since the version is less than 1.3.0, can’t use gluoncv, can you provide a newer version?

@AastaLLL

Did you build the MXNet with USE_TENSORRT=1? The speed of MXNet with GPU is much slower than that with multi CPU workers right now. Thanks.

Hi, 923702544

You can find the prebuilt package in comment #11.
Thanks.

Hi, bobzeng
I just enabled the cuDNN option as shown in the comment #8.
You can following the building steps in #8 with the TensorRT enabled to generate a better package.

Thanks.

I used

sed -i 's/USE_TENSORRT = 0/USE_TENSORRT = 1/' config.mk

as well

Jetson nano gets frozen after make -j3

checked through System Monitor

All the four cores come under 20% usage, then 3.8GB out of 3.9GB RAM starts getting used up and the entire OS gets frozen
Any solution for this?

I’m using 64GB Samsung microSD card if it helps

To:santhosh.dc

[ Jetson Nano gets frozen after make -j3 ]

^ That’s means not enough memory during compiling, so just make , no -j3.

Turn off your graphic interface may also help free your RAM.

Jetson nano gets frozen after make -j3

Could it be that you are lacking power in your supply ?
in https://devtalk.nvidia.com/default/topic/1048640/power-supply-considerations-for-jetson-nano-developer-kit/ you might see that stressful workload require more than the recommended 2.5 Ampere power supply.

Beware of rubbish phone chargers too.

I tired this
https://www.jetsonhacks.com/2019/04/14/jetson-nano-use-more-memory/

Found it might cause issue later on to the actual SD Card being due to swap memory

I used a USB PenDrive instead, used it as swap memory

https://10pm.ca/using-a-usb-flash-drive-as-ram-in-linux-mintubuntu/

make -j tries to run jobs in parallel

I reduced the it from 3 to 2

make -j2

I took some time but got built

Hello, I installed it, and it will occur Segmentation fault (core dumped) when i import mxnet

root@de13510f5ca7:/# pip3 install mxnet-1.4.0-cp36-cp36m-linux_aarch64.whl 
Processing /mxnet-1.4.0-cp36-cp36m-linux_aarch64.whl
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from mxnet==1.4.0)
Installing collected packages: mxnet
Successfully installed mxnet-1.4.0
root@de13510f5ca7:/# python3
Python 3.6.8 (default, Oct  7 2019, 12:59:55) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mxnet
Segmentation fault (core dumped)

Hello, I didn’t find cudnn, how to install it?

root@2409b48c8d37:/incubator-mxnet# make 
Makefile:178: "USE_LAPACK disabled because libraries were not found"
INFO: nvcc was not found on your path
INFO: Using /usr/local/cuda/bin/nvcc as nvcc path
Running CUDA_ARCH: -gencode arch=compute_53,code=sm_53
g++ -std=c++11 -c -DMSHADOW_FORCE_STREAM -Wall -Wsign-compare -O3 -DNDEBUG=1 -I/incubator-mxnet/3rdparty/mshadow/ -I/incubator-mxnet/3rdparty/dmlc-core/include -fPIC -I/incubator-mxnet/3rdparty/tvm/nnvm/include -I/incubator-mxnet/3rdparty/dlpack/include -I/incubator-mxnet/3rdparty/tvm/include -Iinclude -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-local-typedefs -DMSHADOW_USE_SSE=0 -DMSHADOW_USE_F16C=0 -I/usr/local/cuda/include -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMSHADOW_USE_PASCAL=0 -DMXNET_USE_OPENCV=1 -I/usr/include/opencv -fopenmp -DMXNET_USE_OPERATOR_TUNING=1 -DMSHADOW_USE_CUDNN=1  -I/incubator-mxnet/3rdparty/cub -DMXNET_ENABLE_CUDA_RTC=1 -DMXNET_USE_NCCL=0 -DMXNET_USE_LIBJPEG_TURBO=0 -MMD -c src/operator/nn/mkldnn/mkldnn_act.cc -o build/src/operator/nn/mkldnn/mkldnn_act.o
In file included from /incubator-mxnet/3rdparty/mshadow/mshadow/tensor.h:16:0,
                 from include/mxnet/./base.h:32,
                 from include/mxnet/operator.h:38,
                 from src/operator/nn/mkldnn/mkldnn_act.cc:28:
/incubator-mxnet/3rdparty/mshadow/mshadow/./base.h:179:12: fatal error: cudnn.h: No such file or directory
   #include <cudnn.h>
            ^~~~~~~~~
compilation terminated.
Makefile:461: recipe for target 'build/src/operator/nn/mkldnn/mkldnn_act.o' failed
make: *** [build/src/operator/nn/mkldnn/mkldnn_act.o] Error 1

I solve it, cudnn.h installed in /usr/include/cudnn.h, and it can copy to /usr/local/cuda/include/cudnn.h

for /usr/bin/ld: cannot find -lcudnn

sudo ln -s /usr/lib/aarch64-linux-gnu/libcudnn.so.7 /usr/local/cuda/lib/libcudnn.so

When I install the Python 3 wheel, On importing mxnet, I get a Segmentation Fault(Core Dumped) error and my Python crashes.

Need help.

I get a segfault on import as well after installing the wheel in python3.6. It is a fairly fresh install. I’ve followed the documentaiton on http://elinux.org/Jetson_Zoo to install pytorch, but thats all other that making sure the system was up to date using the package manager. If I import mxnet while using pdb I get the following trace::

/home/lycaass/mximport.py(1)()
-> import mxnet
(Pdb) continue
Traceback (most recent call last):
File “/usr/lib/python3.6/pdb.py”, line 1667, in main
pdb._runscript(mainpyfile)
File “/usr/lib/python3.6/pdb.py”, line 1548, in _runscript
self.run(statement)
File “/usr/lib/python3.6/bdb.py”, line 434, in run
exec(cmd, globals, locals)
File “”, line 1, in
File “/home/lycaass/mximport.py”, line 1, in
import mxnet
File “/usr/local/lib/python3.6/dist-packages/mxnet/init.py”, line 24, in
from .context import Context, current_context, cpu, gpu, cpu_pinned
File “/usr/local/lib/python3.6/dist-packages/mxnet/context.py”, line 24, in
from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass
File “/usr/local/lib/python3.6/dist-packages/mxnet/base.py”, line 213, in
_LIB = _load_lib()
File “/usr/local/lib/python3.6/dist-packages/mxnet/base.py”, line 204, 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: libopencv_imgcodecs.so.3.3: cannot open shared object file: No such file or directory
Uncaught exception. Entering post mortem debugging
Running ‘cont’ or ‘step’ will restart the program
/usr/lib/python3.6/ctypes/init.py(348)init()
-> self._handle = _dlopen(self._name, mode)

Update: I am running Jetpack 4.3, which includes OpenCV 4.1.1 – it appears the wheel requires OpenCV 3.3

Update: Using the instructions from post #8, instead of v1.4.x, I built v1.5.x and everything seems to work.

Hi, all

An latest MXNET package for JetPack4.3 can be found in this comment:
https://devtalk.nvidia.com/default/topic/1070767/jetson-nano/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-/post/5426042/#5426042

Thanks.

May you help me try to build mxnet with TENSORRT with flag USE_TENSORRT = 1 . I tried a lot of ways but it seems useless

Hi,

For build MXNet from source with TensorRT support, please check this comment:

Thanks.

1 Like

Thank you for the pre-made script, it’s very helpful! I’ve gotten this to work with some tweaks on a fresh Jetpack 4.4 install on the TX2. I can’t quite get it to work on the Nano (fresh sd card image) however… I’ve tried adding up to 12gb swap, set swappiness to 90% but it always runs out of memory on the very last step ‘Building TensorRT Engine’ OOMKiller always kills this before it can complete.

  1. install sudo apt-get install python3-pip libprotoc-dev protobuf-compiler
  2. export export CUDACXX="/usr/local/cuda/bin/nvcc" or set in /etc/environment and reboot
  3. install apt-get install python-setuptools

FWIW, I used this script but had to add export LD_LIBRARY_PATH=/usr/local/lib/python3.6/dist-packages/mxnet:$LD_LIBRARY_PATH to the end of ~/.profile to be able to import mxnet. I have a TX2 with a fresh install of Jetpack 4.4. I hope this info helps someone.

1 Like