openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
7.06k stars 2.22k forks source link

[Bug] Build OpenVINO framework on Ubuntu 18.04 on ARM64 with Python3.6 #17524

Closed marcjasner closed 1 year ago

marcjasner commented 1 year ago
System information (version)
Detailed description

I am attempting to build the OpenVINO framework for an ARM64 SBC running Ubuntu 18.04 with Python 3.6. I followed the instructions for building the OpenVINO runtime for Raspberry Pi, making changes where necessary. It seems to have built without any errors, but while I thought I enabled generation of the python runtime wheel it doesn't seem to have created/installed that. Also, when I source setupvars.sh I get a warning (error?) that I should be using Python 3.7 or higher. I am not clear on if this is a hard requirement or just a warning, but this is the environment I need it to run in, so thats what I'm trying to build OpenVINO for. So my two issues are:

1) Building for Python 3.6 2) Buildling/installing the python runtime wheel. It DID build _pyngraph.cpython-36m-aarch64-linux-gnu.so but it doesn't seem to be installed for general use.

Steps to reproduce
  1. sudo apt-get update
  2. sudo apt-get install -y git cmake scons build-essential
  3. git clone --recurse-submodules --single-branch --branch=master https://github.com/openvinotoolkit/openvino.git
  4. git clone --recurse-submodules --single-branch --branch=master https://github.com/openvinotoolkit/openvino_contrib.git
  5. cd openvino/
  6. mkdir build && cd build/
  7. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/marc/openvino_dist -DENABLE_INTEL_MYRIAD=ON -DENABLE_INTEL_CPU=OFF -DENABLE_INTEL_GPU=OFF -DENABLE_CLDNN=OFF -DENABLE_AUTO=OFF -DENABLE_MULTI=OFF -DENABLE_HETERO=OFF -DENABLE_TEMPLATE=OFF -DENABLE_TESTS=OFF -DENABLE_OV_ONNX_FRONTEND=OFF -DENABLE_OV_PADDLE_FRONTEND=OFF -DENABLE_OV_TF_FRONTEND=OFF -DENABLE_NCC_STYLE=OFF -DENABLE_SSE42=OFF -DTHREADING=SEQ -DENABLE_OPENCV=OFF -DENABLE_INTEL_GNA=OFF -ENABLE_WHEEL=ON -DENABLE_SAMPLES=ON -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python3.6 -DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.6 -DOPENVINO_EXTRA_MODULES=/home/marc/src/OpenVino/src/openvino_contrib/modules/arm_plugin ..
  8. make -j3 (NOTE: I use 3 instead of 4 to prevent it from making the system unresponsive when I try and check build status. Build time isn't a huge concern)
  9. sudo make install
ilyachur commented 1 year ago

Hi @marcjasner,

OpenVINO doesn't support Python 3.6 version. You should use Python 3.7 or higher.

CC @mlukasze @jiwaszki

mlukasze commented 1 year ago

hey @marcjasner as Ilya said we don't support py3.6 anymore. Is there any chance you could try it with any higher version of python, please?

marcjasner commented 1 year ago

Thanks for the replies. Sorry for the slow reply, but I haven't had a chance to be back at my computer in the last 24 Hours. I will attempt to give it a try. Thanks again!

jiwaszki commented 1 year ago

@marcjasner is the issue resolved? Do you need any additional help?

marcjasner commented 1 year ago

No, i'm running into issues with CMAKE where i get the following errors:

CMake Warning at cmake/developer_package/python_requirements.cmake:112 (message): Python requirement file /home/marc/src/OpenVino/ovbuildenv/openvino/src/bindings/python/wheel/requirements-dev.txt is not installed, Call Stack (most recent call first): src/bindings/python/CMakeLists.txt:137 (ov_check_pip_packages) even though I successfully ran python3.8 -m pip install -r /home/marc/src/OpenVino/ovbuildenv/openvino/src/bindings/python/wheel/requirements-dev.txt

Also, at the end of CMAKE I get:

-- Found PythonInterp: /usr/bin/python3.8 (found suitable version "3.8", minimum required is "3")
-- Found Cython version 0.29.32
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'wheel.vendored'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'wheel.vendored'

Even though wheel is up to date at the latest version (0.40.0).

When I build I get:

[100%] Linking CXX shared module /home/marc/src/OpenVino/ovbuildenv/openvino/bin/aarch64/Release/python_api/python3.8/openvino/frontend/pytorch/py_pytorch_frontend.cpython-38-aarch64-linux-gnu.so
[100%] Built target py_pytorch_frontend
[100%] Built target py_ov_frontends
[100%] Building Python wheel openvino-2023.1.0-11077--cp38-manylinux_2_27_aarch64.whl
Traceback (most recent call last):
  File "/home/marc/src/OpenVino/ovbuildenv/openvino/src/bindings/python/wheel/setup.py", line 16, in <module>
    from setuptools import setup, find_namespace_packages, Extension
ImportError: cannot import name 'find_namespace_packages' from 'setuptools' (/usr/lib/python3/dist-packages/setuptools/__init__.py)
src/bindings/python/wheel/CMakeFiles/ie_wheel.dir/build.make:187: recipe for target 'wheels/openvino-2023.1.0-11077--cp38-manylinux_2_27_aarch64.whl' failed
make[2]: *** [wheels/openvino-2023.1.0-11077--cp38-manylinux_2_27_aarch64.whl] Error 1
CMakeFiles/Makefile2:3718: recipe for target 'src/bindings/python/wheel/CMakeFiles/ie_wheel.dir/all' failed
make[1]: *** [src/bindings/python/wheel/CMakeFiles/ie_wheel.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

Setuptools is the latest version according to PyPi:

$ python3.8 -m pip install -U setuptools
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Requirement already satisfied: setuptools in /home/marc/src/OpenVino/ovbuildenv/ovbuild-virtualenv/lib/python3.8/site-packages (67.8.0)

If I then disable building the wheel it completes ok but after I do make install and source setupvars.sh I still get the warning about invalid python version, even though I've built it against 3.8

marcjasner commented 1 year ago

Small correction to my last post... if I disable building the wheel it seems to build ok. sourcing setupvars.sh does work. I needed to log out and log back. Perhaps some new environment settings needed to take effect. Not sure, but that's ok now. Going to do some testing with it now.

marcjasner commented 1 year ago

The hello_query_device sample runs, but can't see the NCS2. 'dmesg' shows that it was detected, but lsusb shows a blank line. I remembered I have to install the udev rules, but the install_NCS_udev_rules.sh script does not exist in my install directory, nor anywhere in the source directories either.

The only thing under install_dependancies is install_openvino_dependencies.sh

Can you please give me an idea of where this comes from?

marcjasner commented 1 year ago

I tried rebuilding everything clean with a clean checkout from the releases/2022/3 branch and that seems to have worked and built everything as expected. I am now able to run the hello_query_devices python sample in a virtual environment.

I'm going to close this as resolved, since it seems I can now run openvino code on this platform. If I run into any other issues I will open new issues as needed.

Thanks again for all of the help.