frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

how to install the ncsdk on an ARMv8 Linux kernel + Ubuntu rootfs? (aarch64 but not rpi)

@neal_at_intel

neal_at_intel:

I'm trying to install any of the SDK ncsdk v1.09.x and even the latest v1.10.00.03 on my NXP ARMv8 (A72 which is aarch64, 64bit ARM like the rpi) and I am far along; however, I am seeing errors:

****** error in make install on my ARMv8 Ubuntu platfrom **********
... snip...
Requirement already satisfied: Enum34>=1.1.6 in /usr/local/lib/python2.7/dist-packages
bvlc-caffe present and we're currently pointing to it
Caffe already installed, skipping...
cp: cannot stat '/opt/movidius/NCSDK/ncsdk-aarch64/tk': No such file or directory
Installation failed. Error on line 533
user@Ubuntu_LS2084A_BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03$


Question: I want to use the NCS on this ARMv8 platform. How do you suggest I proceed with my use-case?
I am open to options like:
1) figuring away around this error above or
2) just take what I need from an x86-Uuntu 16.04 install and to run a "run_cpp" (like in the Caffe examples) from Linux user-space on the ARMv8 with the older method when you supposedly had some "pi_jessie" directory for installing on the rpi ARMv8 platform only what is needed.
3) any other option you may suggest?

Thanks,
Mark

Comments

  • 16 Comments sorted by Votes Date Added
  • @mdouglas_95136 what platform are you running this on? I've not tried the following myself but if i know what system it is, i can take a look.

    cp -r /opt/movidius/NCSDK/ncsdk-armv7l /opt/movidius/NCSDK/ncsdk-aarch64
    sudo apt-get install libusb-1.0.0
    cd <your NCSDK clone area>
    cd api/src
    make
    sudo make install    
    cp /usr/local/lib/libmvnc.so.0 /opt/movidius/NCSDK/ncsdk-aarch64/api/c
    

    Please let me know if that helps.

  • @ramana.rachakondaa

    Thanks Ramana. I think this is the direction I'd like to go
    however... I have no api/src directory(s) in any of the /opt/movidius/NCSDK
    directories...

    so I copied from the git the src directoy and include... (hack...)
    and your steps worked (very nice. Thank You!)

    however,

    if I go up into examples/caffe/GoogleLeNet to test the install
    and I try "make all" I get errors like ->

    making check
    mvNCCheck -w bvlc_googlenet.caffemodel -i ../../data/images/nps_electric_guitar.png -s 12 -id 546 deploy.prototxt -S 255 -M 110
    make: mvNCCheck: Command not found
    Makefile:85: recipe for target 'check' failed
    make: *** [check] Error 127
    s/caffe/GoogLeNet$ _BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examples

    and

    s/caffe/GoogLeNet$ make cpp

    making cpp
    g++ cpp/run.cpp cpp/fp16.c -o cpp/run_cpp -lmvnc
    s/caffe/GoogLeNet$ _BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examples

    making compile
    mvNCCompile -w bvlc_googlenet.caffemodel -s 12 deploy.prototxt
    make: mvNCCompile: Command not found
    Makefile:80: recipe for target 'compile' failed
    make: *** [compile] Error 127
    s/caffe/GoogLeNet$ _BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examp

    looks like my mvNCCompile, mvNCCheck and mvNCProfile are not available...

    Ideas?

    Thanks so much BTW! good progress

    Mark D.

  • sorry @ramana.rachakonda
    I added an extra "a" there... for some unknown reason.
    MD

  • *** one area of progress @ramana.rachakonda and good news ***
    is with the NCS plugged into a USB Hub connected into our ARMv8 (8 cores of A72), I am able to use the mvncGetDeviceName() API method to at least see the device ->

    include <stdio.h>

    extern "C"
    {

    include <mvnc.h>

    }
    // somewhat arbitrary buffer size for the device name

    define NAME_SIZE 100

    int main(int argc, char** argv)
    {
    mvncStatus retCode;
    int deviceCount = 0;
    char devName[NAME_SIZE];
    while ((retCode = mvncGetDeviceName(deviceCount, devName, NAME_SIZE)) != MVNN
    C_DEVICE_NOT_FOUND)
    {
    printf("Found NCS device named: \"%s\"\n", devName);
    deviceCount++;
    }
    printf("Total number of NCS devices found: %d\n", deviceCount);
    }

    Using the mvncGetDeviceName() method with nothing plugged in ->

    /mark_test$ ./test.out 10.00.03/ncsdk-1.10.00.03/examples
    Total number of NCS devices found: 0

    Then plug in the USB hub with BOTH the NCSs

    /mark_test$ ./test.out 10.00.03/ncsdk-1.10.00.03/examples
    Found NCS device named: "1.3"
    Found NCS device named: "1.1"
    Total number of NCS devices found: 2

    If I take one out ->

    /mark_test$ ./test.out 10.00.03/ncsdk-1.10.00.03/examples
    Found NCS device named: "1.1"
    Total number of NCS devices found: 1

    So mvnc APIs for the NCS calling from a Linux user-space example all on the ARMv8-A72
    No issues seeing the NCS and using the APIs to it!
    So thanks for that!

    However...

    *** I still have issues with mvNCCompile, mvNCCheck and mvNCProfile are not available and also the deploy.prototxt file layers… but, this is decent progress for today.

  • @ramana.rachakonda
    more updates... and only one thing in examples/caffe/GoogLeNet not working.

    I had to symbolically link (ln -s) the mvNC*.py files into /usr/local/bin and such...
    really a hack and we need to get this smoother from a base install.

    *** I'd like to volunteer to be your Beta tester for ARMv8-base install***
    so we can make this smooth on the NXP LS2 ARMv8 target!!!

    GOOD NEWS: most of the "make all" from ~/ncsdk-1.10.00.03/examples/caffe/GoogLeNet directory is building (great!); HOWEVER, for "make run"

    ******* error under "make run"
    making run
    ./run.py
    Traceback (most recent call last):
    File "./run.py", line 22, in
    import cv2
    ImportError: No module named 'cv2'
    Makefile:91: recipe for target 'run' failed
    make: *** [run] Error 1

    did I miss coping the cv2 module or something?

    *********** full ARMv8 on the NXP LS2084A device *****************
    examples/caffe/GoogLeNet$ uname -a
    Linux Ubuntu_LS2084A_BB_Mini 4.1.35-rt41+g1ae843c #1 SMP Thu Oct 12 08:16:17 PDT 2017 aarch64 aarch64 aarch64 GNU/Linux

    GoogLeNet$ make run_py

    making prereqs
    (cd ../../data/ilsvrc12; make)
    make[1]: Entering directory '/home/user/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examples/data/ilsvrc12'
    make[1]: Leaving directory '/home/user/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examples/data/ilsvrc12'

    making prototxt
    Prototxt file already exists

    making caffemodel
    caffemodel file already exists

    making compile
    mvNCCompile -w bvlc_googlenet.caffemodel -s 12 deploy.prototxt
    mvNCCompile v02.00, Copyright @ Movidius Ltd 2016

    Layer inception_3b/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_3b/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_4a/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_4a/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_4b/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_4b/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_4c/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_4c/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_4d/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_4d/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_4e/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_4e/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_5a/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_5a/pool_proj forced to im2col_v2, because its output is used in concat
    Layer inception_5b/1x1 forced to im2col_v2, because its output is used in concat
    Layer inception_5b/pool_proj forced to im2col_v2, because its output is used in concat
    /usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance
    "Consider reducing your data sizes for best performance\033[0m")

    making run_py
    ./run.py
    Traceback (most recent call last):
    File "./run.py", line 22, in
    import cv2
    ImportError: No module named 'cv2'
    Makefile:96: recipe for target 'run_py' failed
    make: *** [run_py] Error 1
    ***************************** end of "make run_py" ********************

  • cv2 refers to OpenCV. Please try to pip install OpenCV. Look at or run the shell script called install_opencv.sh in the ncsdk repo

  • ok thanks @ramana.rachakonda

    I'm tryng to run ./install-opencv.sh and it's complaining about the pip version.
    the message says (see below) that I have version 8.1.1 installed and I should have 9.0.1; however, I do have pip v9.0.1 installed.

    but the script looks like it uses "pip3" not "pip"

    $ pip -V
    pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7).00.03
    $ pip2 -V
    pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
    $ pip3 -V
    pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)

    however... here is what the ./install-opencv outputs ->

    $ ./install-opencv.sh
    Installing opencv python for non-Raspbian
    Collecting opencv-python
    Could not find a version that satisfies the requirement opencv-python (from versions: )
    No matching distribution found for opencv-python
    You are using pip version 8.1.1, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Collecting opencv-contrib-python
    Could not find a version that satisfies the requirement opencv-contrib-python (from versions: )
    No matching distribution found for opencv-contrib-python
    You are using pip version 8.1.1, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    ip install --upgrade pip3ni:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03$ sudo p
    Collecting pip3
    Could not find a version that satisfies the requirement pip3 (from versions: )
    No matching distribution found for pip3
    ip install --upgrade pip
    Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
    user@Ubuntu_LS2084A_BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03$

    and if i try and "upgrade" pip with "sudo pip install --upgrade pip" i get ->
    Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages

    so I'm a bit stumped :-(

    Thanks,
    Mark

  • Two things.

    1. You can upgrade pip for python3 using

    sudo pip3 —upgrade pip

    1. Looks like there are no OpenCV binary distribution available for your platform. The install OpenCV script has two sections under “if”.

    If Raspberry Pi install from source
    Else install from binary using pip

    You can edit that file to install OpenCV from source by removing the if and everything after else to force a source installation.

    Please let me know what platform you are using

  • @ramana.rachakonda

    Darn so close to having the next ARMv8 (8 core A72) running a full Movidius SDK install!
    --- still stuck here with OpenCV install :-(


    user@Ubuntu_LS2084A_BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03$ ./insta
    Installing opencv python for non-Raspbian
    Collecting opencv-python
    Could not find a version that satisfies the requirement opencv-python (from versions: )
    No matching distribution found for opencv-python
    You are using pip version 8.1.1, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    Collecting opencv-contrib-python
    Could not find a version that satisfies the requirement opencv-contrib-python (from versions: )
    No matching distribution found for opencv-contrib-python
    You are using pip version 8.1.1, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    user@Ubuntu_LS2084A_BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03$


    so what "version" is needed?
    I have opencv-python-aarch64 that's version 3.3.0.1
    opencv-python that's version 3.3.0.10

    I believe I've so close here

    Thanks,
    Mark

  • @ramana.rachakonda
    I am wondering if these errors are bogus as my Ubuntu16.04 LTS on x84-64 shows
    the same version of 3.3.0.10 for both the openvc-python and opencv-contrib-python?

  • @ramana.rachakonda
    sorry Ramana. I missed you post to this thread earlier today.
    --- Installing OpenCV-Python via source now.
    I'll let you know how this turns-out.

    in the meantime: Yes, this NCS SDK 1.10.00.03 is now mostly running on the NXP LS2084A device. It's an 8x ARMv8 A72 core device. the NCS is plugged into the external USB connector. Right now I can run most of the non-opencv based GoogLeNet examples on the device natively on this NXP LS2084A device. Once I have opencv-python built then I'll test all the examples.

    then I want to circly back with you to get the install scripts modified to for the next release of the NCS SDK such that this target is supported out-of-box.

    Thanks,
    Mark D.

  • @ramana.rachakonda
    ok my current status is "near perfect'!
    thanks for pointing me to building the opencv-python source pakages.
    things in the examples caffe look better... however, I'm getting a error ->

    "Error in `python3': double free or corruption"

    See below ->

    ./run.py
    Device 0 Address: 1.3 - VID/PID 03e7:2150
    Starting wait for connect with 2000ms timeout
    Found Address: 1.3 - VID/PID 03e7:2150
    Found EP 0x81 : max packet size is 512 bytes
    Found EP 0x01 : max packet size is 512 bytes
    Found and opened device
    Performing bulk write of 905640 bytes...
    Successfully sent 905640 bytes of data in 60.872008 ms (14.188551 MB/s)
    Boot successful, device address 1.3
    Found Address: 1.3 - VID/PID 040e:f63b
    done
    Booted 1.3 -> VSC

    ------- predictions --------
    prediction 0 (probability 0.99609) is b'n03272010 electric guitar' label index is: 546
    prediction 1 (probability 0.0035095) is b'n02676566 acoustic guitar' label index is: 402
    prediction 2 (probability 0.0) is b'n02396427 wild boar, boar, Sus scrofa' label index is: 342
    prediction 3 (probability 0.0) is b'n02391049 zebra' label index is: 340
    prediction 4 (probability 0.0) is b'n02389026 sorrel' label index is: 339
    *** Error in `python3': double free or corruption (out): 0x0000000016b4f210 ***
    Makefile:96: recipe for target 'run_py' failed
    make: *** [run_py] Aborted (core dumped)
    s/caffe/GoogLeNet$ _BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examples

  • @mdouglas_95136 looks like it mostly ran and printed out everything, except there seems to be some kind of memory issue while printing it out.
    Can you please try this in run.py file

    change:

    for i in range(0,5):
    

    to:

    for i in range(0,3):
    

    and see if we are getting this because we only got back 5 predictions and we are trying to print 6.

  • @ramana.rachakonda Thanks Ramana; however, same error ->

    making run_py
    ./run.py
    Device 0 Address: 1.3 - VID/PID 03e7:2150
    Starting wait for connect with 2000ms timeout
    Found Address: 1.3 - VID/PID 03e7:2150
    Found EP 0x81 : max packet size is 512 bytes
    Found EP 0x01 : max packet size is 512 bytes
    Found and opened device
    Performing bulk write of 905640 bytes...
    Successfully sent 905640 bytes of data in 60.095908 ms (14.371787 MB/s)
    Boot successful, device address 1.3
    Found Address: 1.3 - VID/PID 040e:f63b
    done
    Booted 1.3 -> VSC

    ------- predictions --------
    prediction 0 (probability 0.99609) is b'n03272010 electric guitar' label index is: 546
    prediction 1 (probability 0.0035095) is b'n02676566 acoustic guitar' label index is: 402
    prediction 2 (probability 0.0) is b'n02396427 wild boar, boar, Sus scrofa' label index is: 342
    *** Error in `python3': double free or corruption (out): 0x0000000027841b70 ***
    Makefile:96: recipe for target 'run_py' failed
    make: *** [run_py] Aborted
    s/caffe/GoogLeNet$ _BB_Mini:~/Movidius/ncsdk-1.10.00.03/ncsdk-1.10.00.03/examples

  • There are two lines at the end of the file.

    graph.DeallocateGraph()
    device.CloseDevice()
    

    Can you please try to see if
    1. What happens if you comment out the graph.DeallocateGraph()
    2. What happens If you comment out the device.CloseDevice()

    As we don’t have your exact setup, I want to see where the error is coming from.

  • Hi @mdouglas_95136

    I've seen a similar issue when building opencv from source where python programs crash when terminating. I was working on a different platform but what worked for me was to uninstall the opencv that pip installed and then build with build opencv with the following defined during CMAKE:
    -D WITH_V4L=ON \
    -D BUILD_opencv_cnn_3dobj=OFF \
    -D BUILD_opencv_dnn_modern=OFF \

    I'll paste the entire script that worked for me in here so you can cut and paste it if you want to try it out. I basically installed the ncsdk normally, then ran this script to replace the python opencv build that ncsdk had installed via pip.

    #! /bin/bash
    
    echo ""
    echo "************************ Please confirm *******************************"
    echo " Installing OpenCV from source may take a long time. "
    echo " Select n to skip OpenCV installation or y to install it." 
    echo " Note that if you installed opencv via pip3 it will be uninstalled"
    read -p " Continue installing OpenCV (y/n) ? " CONTINUE
    if [[ "$CONTINUE" == "y" || "$CONTINUE" == "Y" ]]; then
        echo ""; 
        echo "Uninstalling pip installation";
        sudo pip3 uninstall opencv-contrib-python
        sudo pip3 uninstall opencv-python  
        echo "";
        echo "Installing OpenCV"; 
        echo "";
        sudo apt-get update -y && sudo apt-get upgrade -y
        sudo apt-get install -y build-essential cmake pkg-config
        sudo apt-get install -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
        sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
        sudo apt-get install -y libxvidcore-dev libx264-dev
        sudo apt-get install -y libgtk2.0-dev libgtk-3-dev
        sudo apt-get install -y libatlas-base-dev gfortran
        sudo apt-get install -y python2.7-dev python3-dev
    
        cd ~
        wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.0.zip
        unzip opencv.zip
        wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.0.zip
        unzip opencv_contrib.zip
        cd ~/opencv-3.3.0/
        mkdir build
        cd build
        cmake -D CMAKE_BUILD_TYPE=RELEASE \
              -D CMAKE_INSTALL_PREFIX=/usr/local \
              -D INSTALL_PYTHON_EXAMPLES=OFF \
              -D WITH_V4L=ON \
              -D BUILD_opencv_cnn_3dobj=OFF \
              -D BUILD_opencv_dnn_modern=OFF \
              -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \
              -D BUILD_EXAMPLES=OFF ..
        make -j4
        sudo make install
        sudo ldconfig
    else
        echo "";
        echo "Skipping OpenCV installation";
        echo "";
    fi
    
Sign In or Register to comment.