Issue regarding installation of pyn2-dpu package on ZCU104 (v2.7) --> 16GB SD card

I am facing issue while installing pynq-dpu==2.5.1 on ZCU104 board. Followed the following steps with the issues below:
Board information:

ZCU104
Pynq Image (v2.7)

  1. pip3 install -U --trusted-host files.pythonhosted.org pynq-dpu
  2. The files get downloaded but the following dependency issues comes up:
Collecting pynq-dpu
  Using cached pynq_dpu-1.4.0.tar.gz (1.3 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  Γ— pip subprocess to install build dependencies did not run successfully.
  β”‚ exit code: 1
  ╰─> [2857 lines of output]
      Collecting setuptools
        Obtaining dependency information for setuptools from https://files.pythonhosted.org/packages/4f/ab/0bcfebdfc3bfa8554b2b2c97a555569c4c1ebc74ea288741ea8326c51906/setuptools-68.1.2-py3-none-any.whl.metadata
        Using cached setuptools-68.1.2-py3-none-any.whl.metadata (6.2 kB)
      Collecting wheel
        Obtaining dependency information for wheel from https://files.pythonhosted.org/packages/b8/8b/31273bf66016be6ad22bb7345c37ff350276cfd46e389a0c2ac5da9d9073/wheel-0.41.2-py3-none-any.whl.metadata
        Using cached wheel-0.41.2-py3-none-any.whl.metadata (2.2 kB)
      Collecting pynq
        Using cached pynq-3.0.1.tar.gz (63.0 MB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting pynqutils>=0.0.1 (from pynq)
        Using cached pynqutils-0.1.1-py3-none-any.whl (30 kB)
      Collecting pynqmetadata>=0.0.1 (from pynq)
        Using cached pynqmetadata-0.1.5-py3-none-any.whl
      Collecting cffi (from pynq)
        Using cached cffi-1.15.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (449 kB)
      Collecting numpy (from pynq)
        Obtaining dependency information for numpy from https://files.pythonhosted.org/packages/25/6f/2586a50ad72e8dbb1d8381f837008a0321a3516dfd7cb57fc8cf7e4bb06b/numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
        Using cached numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (5.6 kB)
      Collecting nest-asyncio (from pynq)
        Obtaining dependency information for nest-asyncio from https://files.pythonhosted.org/packages/7e/dd/69a7a6e89bb1fe09f99bde22027154c487b1e8b6769e642d7f56f35696d3/nest_asyncio-1.5.7-py3-none-any.whl.metadata
        Using cached nest_asyncio-1.5.7-py3-none-any.whl.metadata (2.7 kB)
      Collecting jsonschema>=3.2.0 (from pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for jsonschema>=3.2.0 from https://files.pythonhosted.org/packages/2b/ff/af59fd34bc4d7ac3e6e0cd1f3c10317d329b6c1aee179e8b24ad9a79fbac/jsonschema-4.19.0-py3-none-any.whl.metadata
        Using cached jsonschema-4.19.0-py3-none-any.whl.metadata (8.2 kB)
      Collecting pydantic (from pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for pydantic from https://files.pythonhosted.org/packages/82/06/fafdc75e48b248eff364b4249af4bcc6952225e8f20e8205820afc66e88e/pydantic-2.3.0-py3-none-any.whl.metadata
        Using cached pydantic-2.3.0-py3-none-any.whl.metadata (148 kB)
      Collecting python-magic>=0.4.25 (from pynqutils>=0.0.1->pynq)
        Using cached python_magic-0.4.27-py2.py3-none-any.whl (13 kB)
      Collecting tqdm (from pynqutils>=0.0.1->pynq)
        Obtaining dependency information for tqdm from https://files.pythonhosted.org/packages/00/e5/f12a80907d0884e6dff9c16d0c0114d81b8cd07dc3ae54c5e962cc83037e/tqdm-4.66.1-py3-none-any.whl.metadata
        Using cached tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)
      Collecting pycparser (from cffi->pynq)
        Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
      Collecting attrs>=22.2.0 (from jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
      Collecting importlib-resources>=1.4.0 (from jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for importlib-resources>=1.4.0 from https://files.pythonhosted.org/packages/25/d4/592f53ce2f8dde8be5720851bd0ab71cc2e76c55978e4163ef1ab7e389bb/importlib_resources-6.0.1-py3-none-any.whl.metadata
        Using cached importlib_resources-6.0.1-py3-none-any.whl.metadata (4.0 kB)
      Collecting jsonschema-specifications>=2023.03.6 (from jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for jsonschema-specifications>=2023.03.6 from https://files.pythonhosted.org/packages/1c/24/83349ac2189cc2435e84da3f69ba3c97314d3c0622628e55171c6798ed80/jsonschema_specifications-2023.7.1-py3-none-any.whl.metadata
        Using cached jsonschema_specifications-2023.7.1-py3-none-any.whl.metadata (2.8 kB)
      Collecting pkgutil-resolve-name>=1.3.10 (from jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB)
      Collecting referencing>=0.28.4 (from jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for referencing>=0.28.4 from https://files.pythonhosted.org/packages/be/8e/56d6f1e2d591f4d6cbcba446cac4a1b0dc4f584537e2071d9bcee8eeab6b/referencing-0.30.2-py3-none-any.whl.metadata
        Using cached referencing-0.30.2-py3-none-any.whl.metadata (2.6 kB)
      Collecting rpds-py>=0.7.1 (from jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for rpds-py>=0.7.1 from https://files.pythonhosted.org/packages/99/27/be020e50f980bda2ecc13351dee4f2ec427c3d773d966004d0821bb4a6a7/rpds_py-0.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
        Using cached rpds_py-0.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (3.7 kB)
      Collecting annotated-types>=0.4.0 (from pydantic->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for annotated-types>=0.4.0 from https://files.pythonhosted.org/packages/d8/f0/a2ee543a96cc624c35a9086f39b1ed2aa403c6d355dfe47a11ee5c64a164/annotated_types-0.5.0-py3-none-any.whl.metadata
        Using cached annotated_types-0.5.0-py3-none-any.whl.metadata (11 kB)
      Collecting pydantic-core==2.6.3 (from pydantic->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for pydantic-core==2.6.3 from https://files.pythonhosted.org/packages/b8/2b/541a0206fa615b37a9fca2426303c2e1c45bb2f00d8fb7c42d6abef4ca96/pydantic_core-2.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
        Using cached pydantic_core-2.6.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (6.5 kB)
      Collecting typing-extensions>=4.6.1 (from pydantic->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for typing-extensions>=4.6.1 from https://files.pythonhosted.org/packages/ec/6b/63cc3df74987c36fe26157ee12e09e8f9db4de771e0f3404263117e75b95/typing_extensions-4.7.1-py3-none-any.whl.metadata
        Using cached typing_extensions-4.7.1-py3-none-any.whl.metadata (3.1 kB)
      Collecting zipp>=3.1.0 (from importlib-resources>=1.4.0->jsonschema>=3.2.0->pynqmetadata>=0.0.1->pynq)
        Obtaining dependency information for zipp>=3.1.0 from https://files.pythonhosted.org/packages/8c/08/d3006317aefe25ea79d3b76c9650afabaf6d63d1c8443b236e7405447503/zipp-3.16.2-py3-none-any.whl.metadata
        Using cached zipp-3.16.2-py3-none-any.whl.metadata (3.7 kB)
      Using cached setuptools-68.1.2-py3-none-any.whl (805 kB)
      Using cached wheel-0.41.2-py3-none-any.whl (64 kB)
      Using cached nest_asyncio-1.5.7-py3-none-any.whl (5.3 kB)
      Using cached numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
      Using cached jsonschema-4.19.0-py3-none-any.whl (83 kB)
      Using cached pydantic-2.3.0-py3-none-any.whl (374 kB)

[...]


  Using cached zipp-3.16.2-py3-none-any.whl (7.2 kB)
      Building wheels for collected packages: pynq
        Building wheel for pynq (pyproject.toml): started
        Building wheel for pynq (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error
      
        Γ— Building wheel for pynq (pyproject.toml) did not run successfully.
        β”‚ exit code: 1
        ╰─> [2761 lines of output]
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.linux-aarch64-cpython-38
            creating build/lib.linux-aarch64-cpython-38/tests
            copying tests/test_interrupt.py -> build/lib.linux-aarch64-cpython-38/tests
            copying tests/test_gpio.py -> build/lib.linux-aarch64-cpython-38/tests
            copying tests/test_registers.py -> build/lib.linux-aarch64-cpython-38/tests
            copying tests/test_devicetree.py -> build/lib.linux-aarch64-cpython-38/tests
            copying tests/mock_devices.py -> build/lib.linux-aarch64-cpython-38/tests
[...]

                self.run_setup()
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 507, in run_setup
                super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
                exec(code, locals())
              File "<string>", line 431, in <module>
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
                return distutils.core.setup(**attrs)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
                return run_commands(dist)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
                dist.run_commands()
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
                self.run_command(cmd)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1233, in run_command
                super().run_command(command)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 364, in run
                self.run_command("build")
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
                self.distribution.run_command(command)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1233, in run_command
                super().run_command(command)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
                self.run_command(cmd_name)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
                self.distribution.run_command(command)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1233, in run_command
                super().run_command(command)
              File "/tmp/pip-build-env-2wwq9os9/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "<string>", line 367, in run
              File "<string>", line 326, in copy_notebooks
              File "<string>", line 202, in copy_overlay_notebooks
            ModuleNotFoundError: No module named 'pynqutils'
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for pynq
      Failed to build pynq
      ERROR: Could not build wheels for pynq, which is required to install pyproject.toml-based projects
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— pip subprocess to install build dependencies did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Please do help regarding the installation.

1 Like

Hi @wilfred,

Did you follow the 1.b [Optional] Install from ssh/serial as described in the repository?

It does not seem that you are using the --no-build-isolation switch.

Mario

Thank you @marioruiz for the suggestion. I tried the following installation procedure given in the github repo.

. /etc/profile.d/xrt_setup.sh
. /etc/profile.d/pynq_venv.sh
pip3 install pynq-dpu --no-build-isolation

Also, I was logged in a root. This gave me the following error as below:

Collecting pynq-dpu
  Using cached pynq_dpu-1.4.0.tar.gz (1.3 MB)
    Preparing wheel metadata ... done
Requirement already satisfied: CppHeaderParser in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq-dpu) (2.7.4)
Collecting mnist
  Downloading mnist-0.2.2-py2.py3-none-any.whl (3.5 kB)
Requirement already satisfied: pynq>=2.7.0 in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq-dpu) (2.7.0)
Requirement already satisfied: pybind11 in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq-dpu) (2.8.0)
Requirement already satisfied: pandas in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq>=2.7.0->pynq-dpu) (1.3.3)
Requirement already satisfied: setuptools>=24.2.0 in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq>=2.7.0->pynq-dpu) (44.0.0)
Requirement already satisfied: numpy in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq>=2.7.0->pynq-dpu) (1.20.3)
Requirement already satisfied: cffi in /usr/local/share/pynq-venv/lib/python3.8/site-packages (from pynq>=2.7.0->pynq-dpu) (1.14.5)
Requirement already satisfied: pycparser in /usr/lib/python3/dist-packages (from cffi->pynq>=2.7.0->pynq-dpu) (2.19)
Requirement already satisfied: ply in /usr/lib/python3/dist-packages (from CppHeaderParser->pynq-dpu) (3.11)
Requirement already satisfied: pytz>=2017.3 in /usr/lib/python3/dist-packages (from pandas->pynq>=2.7.0->pynq-dpu) (2019.3)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/lib/python3/dist-packages (from pandas->pynq>=2.7.0->pynq-dpu) (2.7.3)
Building wheels for collected packages: pynq-dpu
  Building wheel for pynq-dpu (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/share/pynq-venv/bin/python3 /usr/local/share/pynq-venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpu4lpy47b
       cwd: /tmp/pip-install-viec41rb/pynq-dpu_13019e5951aa483da985e00581975f8b
  Complete output (29 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/pynq_dpu
  copying pynq_dpu/__init__.py -> build/lib/pynq_dpu
  copying pynq_dpu/dpu.py -> build/lib/pynq_dpu
  creating build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_resnet50.xmodel.link -> build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_mnist_classifier.xmodel.link -> build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_tf_inceptionv1.xmodel.link -> build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_resnet50.ipynb -> build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_resnet50_pybind11.ipynb -> build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_mnist_classifier.ipynb -> build/lib/pynq_dpu/notebooks
  copying pynq_dpu/notebooks/dpu_tf_inceptionv1.ipynb -> build/lib/pynq_dpu/notebooks
  creating build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/notebooks/img/voc_classes.txt -> build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/notebooks/img/irishterrier-696543.JPEG -> build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/notebooks/img/jinrikisha-911722.JPEG -> build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/notebooks/img/greyfox-672194.JPEG -> build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/notebooks/img/words.txt -> build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/notebooks/img/bellpeppe-994958.JPEG -> build/lib/pynq_dpu/notebooks/img
  copying pynq_dpu/dpu.xclbin.link -> build/lib/pynq_dpu
  copying pynq_dpu/dpu.hwh.link -> build/lib/pynq_dpu
  copying pynq_dpu/dpu.bit.link -> build/lib/pynq_dpu
  running download_overlays
  creating build/lib/pynq_dpu/dpu.xclbin.d
  error: [Errno 2] No such file or directory: 'build/lib/pynq_dpu/dpu.xclbin.d'
  ----------------------------------------
  ERROR: Failed building wheel for pynq-dpu
Failed to build pynq-dpu
ERROR: Could not build wheels for pynq-dpu which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 21.2.1; however, version 23.2.1 is available.
You should consider upgrading via the '/usr/local/share/pynq-venv/bin/python3 -m pip install --upgrade pip' command.

I don’t know what I am doing wrong. I need to run model inferences using the pynq-dpu library for the models that have been compiled using the Vitis AI library. Also, I am not sure if there is a version issue. Furthermore, is there a specific version of Vtiis AI that is supposed to be used to compile the models (3.5 or 3.0 or 2.5 or 1.4) for these pynq dpu images?

Thank you.

Hi @wilfred,

You can find Vitis AI version compatibilities in the releases of the DPU-PYNQ repo. We try to match pynq_dpu version with the Vitis AI version of compiler tools it supports, e.g. pynq-dpu 1.4 supports Vitis AI 1.4 release, pynq-dpu 2.5 => Vitis AI 2.5.

I wonder if something got borked in your image when you tried to install pynq-dpu==2.5 on a v2.7 image (I see the logs trying to install pynq 3.0 there). Have you tried doing an install on a fresh SD card image? I would try a pynq-dpu 1.4 install on a 2.7 pynq image using the steps Mario suggested.

Thanks
Shawn

1 Like

Thank you @skalade and @marioruiz.

To give a clear picture of what I have done, I am listing the things that I have done till now.

  1. I took a 16GB card and then first flashed pynq image v3.0, after facing similar issues while installing pynq-dpu I went ahead and reflashed a new pynq image v2.7. This is the current version that I am working with.
  2. The other issue that I had been facing was the issue of accessing the internet since the network that I am working on has a login page to connect to the internet (no direct internet access).
  3. To solve this issue I had to use a proxy server for sharing internet access to the ZCU104 board (link). I am not sure if the problem begins at this point or not but I am able to download selected packages using this method. Also had to use apt configuration using this link.
  4. Now after this configuration I started the installation of pyn-dpu. Without using the command line arguments such as --trusted-host what happens is I get a SSL Certificate issue. Using these two arguments --trusted-host and --no-build-isolation I was able to get the packages downloaded but it throws an error while building, as I have shared above.
  5. Also, I have been using a 16GB card and used etcher to flash the pynq images.

Thank again.

1 Like