luxonis / depthai

DepthAI Python API utilities, examples, and tutorials.
https://docs.luxonis.com
MIT License
924 stars 230 forks source link

[BUG] Jetson Nano 4GB - depthai_demo.py error - qt.qpa.plugin: Could not load the Qt platform plugin "xcb" #1089

Closed kirahman2 closed 1 year ago

kirahman2 commented 1 year ago

Describe the bug Hey all, I'm hitting a wall! I've been troubleshooting this issue for 20-25 hours or so. When I install depthai using the instructions linked here for my Nvidia Jetson Nano 4GB and run the following code

python3 depthai_demo.py

I get the error / output below

khalid@khalidjetson:~/Luxonis/depthai$ python3 depthai_demo.py
Using depthai module from:  /home/khalid/.local/lib/python3.10/site-packages/depthai.cpython-310-aarch64-linux-gnu.so
Depthai version installed:  2.21.2.0
Setting up demo...
Available devices:
[0] 18443010F1AA721200 [X_LINK_UNBOOTED]
USB Connection speed: UsbSpeed.SUPER
Downloading /home/khalid/.cache/blobconverter/mobilenet-ssd_openvino_2021.4_6shave.blob...
[==================================================]
Done
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/khalid/.local/lib/python3.10/site-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

Aborted (core dumped)

I've also tried installing depthai manually using the doc linked here and I still get the same above error.

Minimal Reproducible Example

Append the MRE to the bug report, [instructions here] (https://docs.luxonis.com/en/latest/pages/support/#creating-minimal-reproducible-example) I'm SSHing from my macos system to my Jetson Nano 4GB kit. Then I'm following the Jetson Nano Luxinos guide linked here. I have JetPack 4.6.1 installed on my Jetson Nano. This means it comes with Python 3.6.1. I've updated to python 3.10.11 successfully, so that is not an issue.

khalid@khalidjetson:~/Luxonis/depthai$ python3 --version
Python 3.10.11

Expected behavior I'm expecting the depthai_demo.py script to run successfully without any errors.

Pipeline Graph

Please also provide a screenshot of your pipeline using the DepthAI Pipeline Graph.

I attempted to use pipeline_graph . When I ran this, I received the error mentioned in the guide.

khalid@khalidjetson:~/Luxonis/depthai$ pipeline_graph "python3 depthai_demo.py"
Traceback (most recent call last):
  File "/home/khalid/.local/bin/pipeline_graph", line 5, in <module>
    from depthai_pipeline_graph.pipeline_graph import main
  File "/home/khalid/.local/lib/python3.10/site-packages/depthai_pipeline_graph/pipeline_graph.py", line 7, in <module>
    from Qt import QtWidgets, QtCore
  File "/home/khalid/.local/lib/python3.10/site-packages/Qt.py", line 1938, in <module>
    _install()
  File "/home/khalid/.local/lib/python3.10/site-packages/Qt.py", line 1886, in _install
    raise ImportError("No Qt binding were found.")
ImportError: No Qt binding were found.

Then I attempted to run pip install PySide2 per the guides recommendation, but I received the following error

khalid@khalidjetson:~/Luxonis/depthai$ pip install PySide2
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement PySide2 (from versions: none)
ERROR: No matching distribution found for PySide2

Attach system log

Additional context I've tried many many different installation attempts, but each one seems to have the same exact error / outcome that I mentioned at the top of this ticket. Hoping someone can help!

Erol444 commented 1 year ago

Hi @kirahman2 , Looks like there's a problem with QT. I'd suggest using Depthai-Viewer instead, which will soon replace depthai_demo anyways: https://github.com/luxonis/depthai-viewer

Erol444 commented 1 year ago

Looks like we haven't yet built wheels for arms.. cc @zrezke

kirahman2 commented 1 year ago

@Erol444 I deleted my earlier comment, apologies. Here's the output again.

khalid@khalidjetson:~/depthai-viewer$ python3 -m pip install depthai-viewer
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement depthai-viewer (from versions: none)
ERROR: No matching distribution found for depthai-viewer

Edit:

I attempted to run some some examples from this python example page. I wanted to share the results in case it helps out with the investigation. Here are the errors.

khalid@khalidjetson:~/depthai-viewer$ python3 -m pip install depthai-viewer
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement depthai-viewer (from versions: none)
ERROR: No matching distribution found for depthai-viewer
khalid@khalidjetson:~/depthai-viewer$ pip install -r examples/python/car/requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /home/khalid/.local/lib/python3.10/site-packages (from -r examples/python/car/requirements.txt (line 1)) (1.25.1)
Collecting opencv-python<4.6 (from -r examples/python/car/requirements.txt (line 2))
  Using cached opencv_python-4.5.5.64-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (39.2 MB)
ERROR: Could not find a version that satisfies the requirement depthai-viewer (from versions: none)
ERROR: No matching distribution found for depthai-viewer
zrezke commented 1 year ago

Looks like we haven't yet built wheels for arms.. cc @zrezke

Yea, not available yet. I'll investigate later

zrezke commented 1 year ago

Hi @kirahman2 , I think the best way for you to get up and running using depthai-viewer on Jetson is by building from source. This is because of Linux4Tegra OS which is based on ubuntu 18.04 which isn't supported by depthai-viewer (or rerun), and we also currently don't provide any ARM wheels. Here is a relevant issue depthai viewer on ubuntu 18.04.

Building from source

python3.10 -m pip install rerun_py/
kirahman2 commented 1 year ago

@zrezke Hey thanks for providing those steps! I've attempted the installation using Python 3.10 and 3.9. I've gone through relevant issue that you shared to see if I can gather additional insight around the issue. I'm seeing a new error.

Failed to build depthai-viewer ERROR: Could not build wheels for depthai-viewer, which is required to install pyproject.toml-based projects

Here's the full output

khalid@khalidjetson:~/depthai-viewer$ ./scripts/setup_dev.sh
+ ./scripts/setup.sh
++ command -v apt-get
+ '[' -x /usr/bin/apt-get ']'
+ sudo apt-get -y install libatk-bridge2.0 libfontconfig1-dev libfreetype6-dev libglib2.0-dev libgtk-3-dev libssl-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev patchelf
[sudo] password for khalid: 
Sorry, try again.
[sudo] password for khalid: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libatk-bridge2.0-0' for regex 'libatk-bridge2.0'
Note, selecting 'libatk-bridge2.0-dev' for regex 'libatk-bridge2.0'
libatk-bridge2.0-0 is already the newest version (2.26.2-1).
libatk-bridge2.0-dev is already the newest version (2.26.2-1).
libfontconfig1-dev is already the newest version (2.12.6-0ubuntu2).
patchelf is already the newest version (0.9-1).
libfreetype6-dev is already the newest version (2.8.1-2ubuntu2.2).
libglib2.0-dev is already the newest version (2.56.4-0ubuntu0.18.04.9).
libgtk-3-dev is already the newest version (3.22.30-1ubuntu4).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.23).
libxcb-render0-dev is already the newest version (1.13-2~ubuntu18.04).
libxcb-shape0-dev is already the newest version (1.13-2~ubuntu18.04).
libxcb-xfixes0-dev is already the newest version (1.13-2~ubuntu18.04).
libxkbcommon-dev is already the newest version (0.8.2-1~ubuntu18.04.1).
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin
  dpkg-repack efibootmgr gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common
  kde-window-manager kinit kio kpackagetool5 kwayland-data kwin-common
  kwin-data kwin-x11 libdebian-installer4 libkdecorations2-5v5
  libkdecorations2private5v5 libkf5activities5 libkf5attica5
  libkf5completion-data libkf5completion5 libkf5declarative-data
  libkf5declarative5 libkf5doctools5 libkf5globalaccel-data libkf5globalaccel5
  libkf5globalaccelprivate5 libkf5idletime5 libkf5jobwidgets-data
  libkf5jobwidgets5 libkf5kcmutils-data libkf5kcmutils5 libkf5kiocore5
  libkf5kiontlm5 libkf5kiowidgets5 libkf5newstuff-data libkf5newstuff5
  libkf5newstuffcore5 libkf5package-data libkf5package5 libkf5plasma5
  libkf5quickaddons5 libkf5solid5 libkf5solid5-data libkf5sonnet5-data
  libkf5sonnetcore5 libkf5sonnetui5 libkf5textwidgets-data libkf5textwidgets5
  libkf5waylandclient5 libkf5waylandserver5 libkf5xmlgui-bin libkf5xmlgui-data
  libkf5xmlgui5 libkscreenlocker5 libkwin4-effect-builtins1 libkwineffects11
  libkwinglutils11 libkwinxrenderutils11 libqgsttools-p1 libqt5multimedia5
  libqt5multimedia5-plugins libqt5multimediaquick-p5 libqt5multimediawidgets5
  libxcb-composite0 libxcb-cursor0 libxcb-damage0 os-prober
  python3-dbus.mainloop.pyqt5 python3-icu python3-pam python3-pyqt5.qtwebkit
  qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia rdate
  tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
+ rustup install 1.70
info: syncing channel updates for '1.70-aarch64-unknown-linux-gnu'

  1.70-aarch64-unknown-linux-gnu unchanged - rustc 1.70.0 (90c541806 2023-05-31)

info: checking for self-update
+ ./scripts/setup_web.sh
+ rustup target add wasm32-unknown-unknown
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
+ cargo install wasm-bindgen-cli --git https://github.com/rerun-io/wasm-bindgen.git --rev 13283975ddf48c2d90758095e235b28d381c5762
    Updating git repository `https://github.com/rerun-io/wasm-bindgen.git`
     Ignored package `wasm-bindgen-cli v0.2.84 (https://github.com/rerun-io/wasm-bindgen.git?rev=13283975ddf48c2d90758095e235b28d381c5762#13283975)` is already installed, use --force to override
+ packagesNeeded=binaryen
++ command -v brew
+ '[' -x '' ']'
++ command -v apt-get
+ '[' -x /usr/bin/apt-get ']'
+ sudo apt-get -y install binaryen
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package binaryen

khalid@khalidjetson:~/depthai-viewer$ cargo --version
cargo 1.70.0 (ec8a8a0ca 2023-04-25)

khalid@khalidjetson:~/depthai-viewer$ python3.9 -m pip install rerun_py/
Defaulting to user installation because normal site-packages is not writeable
Processing ./rerun_py
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting deprecated (from depthai-viewer==0.1.4)
  Obtaining dependency information for deprecated from https://files.pythonhosted.org/packages/20/8d/778b7d51b981a96554f29136cd59ca7880bf58094338085bcf2a979a0e6a/Deprecated-1.2.14-py2.py3-none-any.whl.metadata
  Using cached Deprecated-1.2.14-py2.py3-none-any.whl.metadata (5.4 kB)
Collecting numpy>=1.23 (from depthai-viewer==0.1.4)
  Obtaining dependency information for numpy>=1.23 from https://files.pythonhosted.org/packages/0a/54/370ec143539de0dc09c3024b4fea99e76e3051bd6ad199ccf1e5b6bc05b7/numpy-1.25.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata
  Using cached numpy-1.25.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.metadata (5.6 kB)
Collecting pyarrow==10.0.1 (from depthai-viewer==0.1.4)
  Using cached pyarrow-10.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (33.6 MB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packages (from depthai-viewer==0.1.4) (58.1.0)
Collecting wrapt<2,>=1.10 (from deprecated->depthai-viewer==0.1.4)
  Using cached wrapt-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (78 kB)
Using cached numpy-1.25.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.2 MB)
Using cached Deprecated-1.2.14-py2.py3-none-any.whl (9.6 kB)
Building wheels for collected packages: depthai-viewer
  Building wheel for depthai-viewer (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for depthai-viewer (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [87 lines of output]
      Running `maturin pep517 build-wheel -i /usr/local/bin/python3.9 --compatibility off`
      ⚠️ Warning: specify [package.metadata.maturin] name in Cargo.toml is deprecated, use module-name in [tool.maturin] section in pyproject.toml instead
      🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8
      🐍 Not using a specific python interpreter
      📡 Using build options locked from pyproject.toml
      warning: /home/khalid/depthai-viewer/crates/re_log_types/Cargo.toml: `default-features` is ignored for time, since `default-features` was not specified for `workspace.dependencies.time`, this could become a hard error in the future
      warning: /home/khalid/depthai-viewer/crates/re_viewer/Cargo.toml: `default-features` is ignored for time, since `default-features` was not specified for `workspace.dependencies.time`, this could become a hard error in the future
      warning: /home/khalid/depthai-viewer/crates/re_viewer/Cargo.toml: `default-features` is ignored for tokio, since `default-features` was not specified for `workspace.dependencies.tokio`, this could become a hard error in the future
      warning: /home/khalid/depthai-viewer/rerun_py/Cargo.toml: `default-features` is ignored for depthai-viewer, since `default-features` was not specified for `workspace.dependencies.depthai-viewer`, this could become a hard error in the future
      warning: /home/khalid/depthai-viewer/crates/re_web_viewer_server/Cargo.toml: `default-features` is ignored for tokio, since `default-features` was not specified for `workspace.dependencies.tokio`, this could become a hard error in the future
      warning: /home/khalid/depthai-viewer/crates/re_ws_comms/Cargo.toml: `default-features` is ignored for tokio, since `default-features` was not specified for `workspace.dependencies.tokio`, this could become a hard error in the future
         Compiling pyo3-build-config v0.18.3
         Compiling tokio-native-tls v0.3.1
         Compiling async-global-executor v2.3.1
         Compiling rmp v0.8.12
         Compiling xdg-home v1.0.0
         Compiling smithay-clipboard v0.6.6
         Compiling sha1 v0.10.5
         Compiling async-broadcast v0.5.1
         Compiling sentry-contexts v0.31.5
         Compiling pyo3-ffi v0.18.3
         Compiling pyo3 v0.18.3
      error: failed to run custom build command for `pyo3 v0.18.3`

      Caused by:
        process didn't exit successfully: `/home/khalid/depthai-viewer/target/release/build/pyo3-800268954e512ba9/build-script-build` (exit status: 1)
        --- stdout
        cargo:rustc-cfg=Py_3_6
        cargo:rustc-cfg=Py_3_7
        cargo:rustc-cfg=Py_3_8
        cargo:rustc-cfg=Py_LIMITED_API

        --- stderr
        error: The `auto-initialize` feature is enabled, but your python installation only supports embedding the Python interpreter statically. If you are attempting to run tests, or a binary which is okay to link dynamically, install a Python distribution which ships with the Python shared library.

        Embedding the Python interpreter statically does not yet have first-class support in PyO3. If you are sure you intend to do this, disable the `auto-initialize` feature.

        For more information, see https://pyo3.rs/v0.18.3/building_and_distribution.html#embedding-python-in-rust
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `"cargo" "rustc" "--release" "--manifest-path" "/home/khalid/depthai-viewer/rerun_py/Cargo.toml" "--message-format" "json" "--locked" "--lib"`
      warning: unused imports: `GpuTexture2D`, `GpuTexture`, `TextureDesc`
        --> crates/re_renderer/src/renderer/depth_cloud.rs:21:25
         |
      21 |     resource_managers::{GpuTexture2D, ResourceManagerError},
         |                         ^^^^^^^^^^^^
      ...
      31 |         GpuTexture,
         |         ^^^^^^^^^^
      ...
      34 |         TextureDesc,
         |         ^^^^^^^^^^^
         |
         = note: `#[warn(unused_imports)]` on by default

      warning: unused import: `itertools::Itertools`
        --> crates/re_renderer/src/renderer/depth_cloud.rs:14:5
         |
      14 | use itertools::Itertools;
         |     ^^^^^^^^^^^^^^^^^^^^

      warning: 2 warnings emitted

      warning: unused import: `arrow2::array::Int128Array`
       --> crates/re_log_types/src/component_types/xlink_stats.rs:2:5
        |
      2 | use arrow2::array::Int128Array;
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(unused_imports)]` on by default

      warning: unused import: `field::I128`
       --> crates/re_log_types/src/component_types/xlink_stats.rs:3:22
        |
      3 | use arrow2_convert::{field::I128, ArrowDeserialize, ArrowField, ArrowSerialize};
        |                      ^^^^^^^^^^^

      warning: 2 warnings emitted

      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/local/bin/python3.9', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for depthai-viewer
Failed to build depthai-viewer
ERROR: Could not build wheels for depthai-viewer, which is required to install pyproject.toml-based projects

I'm hoping for some potential guidance for working around this issue if possible.

Thank you!

zrezke commented 1 year ago

Hey @kirahman2 , Not sure on this, maybe you can try with the workaround mentioned here

kirahman2 commented 1 year ago

@zrezke Thanks for posting the work around. In your earlier comment you mentioned the Oak D Lite is not supported by Ubuntu 18.04. I kept running into issues using 18.04 so I upgraded to 20.04. I was able to run the commands mentioned in your earlier comment. I did run into issues running the basic examples, so I'll open a separate ticket for that.

In case anyone is working through this problem, here are my steps for installing Ubuntu 20.04. Fortunately, someone else created a Jetson Nano 4GB Ubuntu 20.04 image.

  1. Requirements
    1. One micro SD card ≥ 64GB
    2. One micro SD card ≥ 32 GB
    3. USB to Micro SD Card adapter. I ordered this one, title Micro USB OTG to USB 2.0 SD Card Adapter, COCOCKA Micro SD Card Reader,Trail Camera Memory Card Adapter Connector for Android Phone/Computer,Supports SD/SDHC/SCXC/MMC/MMC Micro
  2. Jetson Nano 4GB - Upgrade or install Ubuntu 20.04 image - link
  3. Flash the 20.04 image to a ≥ 64GB micro SD card
  4. Install the micro sd card to the Jetson Nano
  5. Boot the Jetson Nano - username: jetson, password: jetson

Run the following commands

sudo apt install curl

Install Rust using the command below

Install Depthai Viewer

This installation ran successfully. However, I was unable to get the "minimal" example working mentioned here in the documentation. I will open a separate bug ticket for that.

zrezke commented 1 year ago

@kirahman2 Nice, great report. I'm happy you got it installed. The examples are not guaranteed to work. They are the examples from rerun, we just have them in there because depthai-viewer was forked from rerun. Could you try running the depthai-viewer like this:

depthai-viewer
# If this fails use:
python3 -m depthai_viewer

, and then try to connect to your oak device via the UI on the right side.

kirahman2 commented 1 year ago

@zrezke Hey I tried running the first command depthai-viewer and received the error below related to WGPU error: Failed to create wgpu adapter, no suitable adapter found

jetson@nano:~$ cd work
jetson@nano:~/work$ ls
depthai-viewer
jetson@nano:~/work$ depthai-viewer
[2023-08-02T18:02:30Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2023-08-02T18:02:31Z WARN  wgpu_hal::vulkan::instance] create_instance: ERROR_INCOMPATIBLE_DRIVER
[2023-08-02T18:02:31Z ERROR eframe::native::run] Exiting because of error: Wgpu(NoSuitableAdapterFound) on event Resumed
Traceback (most recent call last):
  File "/home/jetson/.local/bin/depthai-viewer", line 8, in <module>
    sys.exit(main())
  File "/home/jetson/.local/lib/python3.8/site-packages/depthai_viewer/__main__.py", line 27, in main
    sys.exit(bindings.main(sys.argv, python_exe, site_packages_directory))
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter fo>

Then I tried running the next command python3 -m depthai_viewer and received the same error as above.

jetson@nano:~/work$ python3 --version
Python 3.8.10
jetson@nano:~/work$ python3 -m depthai_viewer
[2023-08-02T18:03:07Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2023-08-02T18:03:07Z WARN  wgpu_hal::vulkan::instance] create_instance: ERROR_INCOMPATIBLE_DRIVER
[2023-08-02T18:03:07Z ERROR eframe::native::run] Exiting because of error: Wgpu(NoSuitableAdapterFound) on event Resumed
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/jetson/.local/lib/python3.8/site-packages/depthai_viewer/__main__.py", line 31, in <module>
    main()
  File "/home/jetson/.local/lib/python3.8/site-packages/depthai_viewer/__main__.py", line 27, in main
    sys.exit(bindings.main(sys.argv, python_exe, site_packages_directory))
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter fo>

I suspect that this is some kind of configuration that I need to set?

zrezke commented 1 year ago

Hey @kirahman2 ,

Some suggestions

Try installing these:

sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev

If this doesn't resolve the issue, you could try using the opengl WGPU backend instead of vulkan, like this:

WGPU_BACKEND=gl depthai-viewer

Otherwise please post the output of this command (needs to be installed first via apt):

inxi -Gxx | grep compositor

Since you switched to Ubuntu 20.04 you may have to build nvidia's vulkan loader on device: https://developer.nvidia.com/embedded/vulkan

kirahman2 commented 1 year ago

@zrezke Thanks for those steps.

Since I switched to Ubuntu 20.04, I've updated from Vulkan 1.2.141 to 1.3.260 per your recommendation. Here's the new version output

jetson@nano:~/Vulkan-Loader$ vulkaninfo
WARNING: [Loader Message] Code 0 : loader_scan_for_direct_drivers: The VK_LUNARG_direct_driver_loading extension was enabled but the pNext chain of VkInstanceCreateInfo did not contain the VkDirectDriverLoadingListLUNARG structure.
'DISPLAY' environment variable not set... skipping surface info
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.260

I've ran the following updates successfully.

sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev

I ran the following command and received the same error from my earlier post

WGPU_BACKEND=gl depthai-viewer

I ran this command.

inxi -Gxx | grep compositor

Here's the output

jetson@nano:~/Vulkan-Loader$ inxi -Gxx | grep compositor
  compositor: gnome-shell tty: 80x24
kirahman2 commented 1 year ago

I suspect that my Jetson Nano 4GB needs some kind of driver update after updating Vulkan to 1.3.260. At the bottom of this page is a link to drivers that support all Jetson modules except the Jetson Nano. Maybe that's why we are seeing this error?

zrezke commented 1 year ago

Hey @kirahman2 - Hmm, I assume you are still ssh-ing into your jetson nano - It's quite possible that the issue is caused by using a terminal only session

jetson@nano:~/Vulkan-Loader$ inxi -Gxx | grep compositor
  compositor: gnome-shell tty: 80x24

I wonder what the output of inxi -Gxx | grep compositor command is when you hook up a KB and display port / hdmi to it and run the command in the ubuntu gui session. It's quite possible that the viewer will work then. (This is all assuming you are currently using ssh). I also noticed in your previous comment, that the DISPLAY environment variable is not set. If you are using X11 this should be set, on wayland the coresponding variable is WAYLAND_DISPLAY.

  jetson@nano:~/Vulkan-Loader$ vulkaninfo
...
'DISPLAY' environment variable not set... skipping surface info
==========
VULKANINFO
...

But yea - I would first try to get an ubuntu gui running and then try to run depthai-viewer again.

zrezke commented 1 year ago

If it turns out to work in the ubuntu graphical session, you can probably run depthai-viewer via ssh using X11 forwarding, or a similar thing for wayland

kirahman2 commented 1 year ago

@zrezke Hey! I originally performed my testing from both SSH and by hooking up a monitor directly to the Jetson Nano. Though, the results I shared were inconsistent, sorry about that.

When I run inxi -Gxx | grep compositor , from the Ubuntu GUI session, here's the output I receive

jetson@nano:~/work$ inxi -Gxx | grep compositor
  compositor: gnome-shell resolution: 1280x800~60Hz

Here are the other outputs for when I attempt to run depthai-viewer from the Ubuntu GUI session depthai-viewer

jetson@nano:~/work$ depthai-viewer
[2023-08-05T05:15:45Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2023-08-05T05:15:45Z WARN  wgpu_hal::vulkan::instance] create_instance: ERROR_INCOMPATIBLE_DRIVER
[2023-08-05T05:15:45Z ERROR eframe::native::run] Exiting because of error: Wgpu(NoSuitableAdapterFound) on event Resumed
Traceback (most recent call last):
  File "/home/jetson/.local/bin/depthai-viewer", line 8, in <module>
    sys.exit(main())
  File "/home/jetson/.local/lib/python3.8/site-packages/depthai_viewer/__main__.py", line 27, in main
    sys.exit(bindings.main(sys.argv, python_exe, site_packages_directory))
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter found.

WGPU_BACKEND=gl depthai-viewer

jetson@nano:~/work$ WGPU_BACKEND=gl depthai-viewer
[2023-08-05T05:18:30Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2023-08-05T05:18:30Z WARN  wgpu_hal::gles::egl] No config found!
[2023-08-05T05:18:30Z WARN  wgpu_hal::gles::egl] EGL says it can present to the window but not natively
[2023-08-05T05:18:30Z ERROR eframe::native::run] Exiting because of error: Wgpu(NoSuitableAdapterFound) on event Resumed
Traceback (most recent call last):
  File "/home/jetson/.local/bin/depthai-viewer", line 8, in <module>
    sys.exit(main())
  File "/home/jetson/.local/lib/python3.8/site-packages/depthai_viewer/__main__.py", line 27, in main
    sys.exit(bindings.main(sys.argv, python_exe, site_packages_directory))
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter found.

I updated the DISPLAY variable to :0 so I'm no longer seeing the error 'DISPLAY' environment variable not set... skipping surface info. One odd part each time I upgrade vulkan to 1.3, it reverts back to 1.2. I dug into this a bit and this might be related to the Jetson Nano nvidia driver needing some kind of update (according to chatgpt).

vulkaninfo

jetson@nano:~/work$ vulkaninfo
nvdc: start nvdcEventThread
==========
VULKANINFO
==========

Vulkan Instance Version: 1.2.141

I'm wondering if it's worth be digging into the Vulkan version issue or if it's possible to chase a solution down by using WGPU_BACKEND=gl depthai-viewer

kirahman2 commented 1 year ago

@zrezke Hey so I decided to order the Jetson Orin Nano 8GB, which recently received the Ubuntu 20.04 update along with JetPack 5.1.2 and Vulkan 1.3. I ran through all the installations steps. Then from the Ubuntu GUI session, I ran the following command and received the same error that I received on the Jetson Nano 4GB.

(depthAI-viewer) jetson@jetson:~$ depthai-viewer
[2023-08-06T07:06:09Z INFO  winit::platform_impl::platform::x11::window] Guessed window scale factor: 1
[2023-08-06T07:06:09Z WARN  wgpu_hal::vulkan::instance] create_instance: ERROR_INCOMPATIBLE_DRIVER
[2023-08-06T07:06:09Z ERROR eframe::native::run] Exiting because of error: Wgpu(NoSuitableAdapterFound) on event Resumed
Traceback (most recent call last):
  File "/home/jetson/.virtualenvs/depthAI-viewer/bin/depthai-viewer", line 8, in <module>
    sys.exit(main())
  File "/home/jetson/.virtualenvs/depthAI-viewer/lib/python3.8/site-packages/depthai_viewer/__main__.py", line 27, in main
    sys.exit(bindings.main(sys.argv, python_exe, site_packages_directory))
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter found.

So at least we know that there WGPU error is somewhat consistent across the Jetson developer kits

kirahman2 commented 1 year ago

@zrezke Would you have any potential paths forward around the WGPU error?

zrezke commented 1 year ago

Hey @kirahman2 - I am not to sure on this. One thing you could try to do that may help with investigating this issue is running depthai-viewer with RUST_LOG=debug and RUST_BACKTRACE=1 set. We may find something interesting in those logs... Try using those env variables and do two runs - one with WGPU_BACKEND=gl and one with WGPU_BACKEND=vulcan. Since this is a wgpu issue you may also try to run some wgpu examples and see if those work. If they don't, they are most likely better documented so it will be easier to debug them. Just pasting this here aswell - seems similar https://github.com/gfx-rs/wgpu/issues/1787

kirahman2 commented 1 year ago

@zrezke Hey! I switched back to the Jetson Nano 4GB with the 20.04 Ubuntu image. I ran the following command from the documentation

sudo wget -qO- https://docs.luxonis.com/install_depthai.sh | bash

I was able to launch depthai successfully. When I tried launching depthai-viewer I received an error. I'm happy with this result. I know that depthai-viewer is in beta at the moment so that's probably expected behavior for now.

Do you think this ticket is good to close out?

zrezke commented 1 year ago

Yea, should be closed here, I'll open an issue on depthai-viewer and link this one https://github.com/luxonis/depthai-viewer/issues/33.

AnshumanFauzdar commented 1 year ago

Hi @kirahman2 , I think the best way for you to get up and running using depthai-viewer on Jetson is by building from source. This is because of Linux4Tegra OS which is based on ubuntu 18.04 which isn't supported by depthai-viewer (or rerun), and we also currently don't provide any ARM wheels. Here is a relevant issue depthai viewer on ubuntu 18.04.

Building from source

  • Install the Rust toolchain: https://rustup.rs/
  • git clone git@github.com:luxonis/depthai-viewer.git && cd depthai-viewer
  • Run ./scripts/setup_dev.sh.
  • Make sure cargo --version prints 1.70 once you are done
python3.10 -m pip install rerun_py/

@zrezke Is there any way to compile whl and share here for future reference?

zrezke commented 1 year ago

Hi @AnshumanFauzdar! At the moment the viewer doesn't work with the Jetson nano, so providing wheels wouldn't be of much use (look at the above reported errors with WebGPU). It has to be debugged, but it's low priority right now...

roboticsmick commented 7 months ago

Can this be added to the guide to stop users investing time if they have a Jetson Nano?

zrezke commented 7 months ago

Hi @roboticsmick , yea thats a good idea. @jakaskerl could you add a mention that it doesnt work on jetson nano in the guide

mahmad096 commented 2 months ago

I was able to launch depthai successfully. When I tried launching depthai-viewer I received an error. I'm happy with this result. I know that depthai-viewer is in beta at the moment so that's probably expected behavior for now.

By DepthAI you mean depthai_demo.py file, with the GUI?

ammar3010 commented 2 months ago

After running ./scripts/setup_dev.sh I am getting this error:

dpkg: unrecoverable fatal error, aborting:
 loading files list file for package 'libksba8:arm64': cannot open /var/lib/dpkg/info/libksba8:arm64.list (Structure needs cleaning)
E: Sub-process /usr/bin/dpkg returned an error code (2)

I have followed all the steps as mentioned by @kirahman2 to install the image but I am getting this error and cannot find any solution to it.