• DepthAI-v2
  • Illegal instruction (core dumped) when running depthai demo on jetson xavier nx

Seems like I at least partially found the solution, at least for the first error.

I realized that the architecture aarch64 is the key.

opencv-python has a download for aarch64 in 3.4.13.47, and then not again until 4.5.1.

I backed down to opencv to 3.4.13 and opencv-python to 3.4.13.47 and the core dump goes away.

I haven't figured why opencv 4.5.1 doesn't work.

However, now I'm getting an error when downloading the model (I get the same error when attempting to run calibrate):

Note: when I edit depthai/resources/nn/openpose/model.yml, I see references to "human_pose," but nothing for "openpose."

ask_type: human_pose_estimation
files:

  • name: FP32/human-pose-estimation-0001.xml

python3 depthai_demo.py
No calibration file. Using Calibration Defaults.
Using depthai module from: /home/user/Documents/workspace/projects/face-mask-detector/face-mask-detector/lib/python3.6/site-packages/depthai.cpython-36m-aarch64-linux-gnu.so
Depthai version installed: 0.4.1.1+dev
Depthai development version found, skipping check.
Compiling model for 14 shaves, 14 cmx_slices and 1 NN_engines
model_compilation_target: cloud
In config "/home/user/Documents/workspace/depthai/resources/nn/openpose/model.yml":
In model "openpose":
No XML file for precision "FP32"
Traceback (most recent call last):
File "depthai_demo.py", line 415, in <module>
dai.startLoop()
File "depthai_demo.py", line 45, in startLoop
configMan = DepthConfigManager(args)
File "/home/user/Documents/workspace/depthai/depthai_helpers/config_manager.py", line 26, in init
self.generateJsonConfig()
File "/home/user/Documents/workspace/depthai/depthai_helpers/config_manager.py", line 192, in generateJsonConfig
blobMan = BlobManager(self.args, self.calc_dist_to_bb, shave_nr, cmx_slices, NCE_nr)
File "/home/user/Documents/workspace/depthai/depthai_helpers/config_manager.py", line 377, in init
self.blob_file = self.compileBlob(self.args['cnn_model'], self.args['model_compilation_target'])
File "/home/user/Documents/workspace/depthai/depthai_helpers/config_manager.py", line 431, in compileBlob
ret = download_and_compile_NN_model(nn_model, model_zoo_folder, shave_nr_opt, cmx_slices_opt, NCE_nr, outblob_file, model_compilation_target)
File "/home/user/Documents/workspace/depthai/model_compiler/model_compiler.py", line 154, in download_and_compile_NN_model
download_location = download_model(model, model_zoo_folder)
File "/home/user/Documents/workspace/depthai/model_compiler/model_compiler.py", line 32, in download_model
raise RuntimeError("Model downloader failed!")
RuntimeError: Model downloader failed!

    rymd80 Sorry about the delay here.

    So as an update, there is a related PR here for the build for Jetson (Nano, at least, but I think Xavier should work as well).

    https://github.com/luxonis/depthai/pull/329

    On the model downloader failing, is the Xavier connected to the internet? And can it access http://luxonis.com:8080/ ?

    I'll ask Szabi if he has any ideas on the model downloader as well (he wrote it).

    Thanks,
    Brandon

    rymd80
    Hello.
    Can you try on a clean repo?
    I think you edited the model.yml. It shouldn't be edited, unless custom model is added.

    Openpose is the same as human-pose-estimation-0001, openpose folder is a symlink for backward compatibility.
    Just run: python3 depthai_demo.py -cnn openpose

      GergelySzabolcs

      I didn't edit, but a git status shows:

      On branch main
      Your branch is up to date with 'origin/main'.

      Changes not staged for commit:
      (use "git add/rm <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)

      modified:   requirements-optional.txt
      modified:   requirements.txt
      deleted:    resources/nn/openpose
      deleted:    resources/nn/openpose2

      Untracked files:
      (use "git add <file>..." to include in what will be committed)

      install_dependencies.sh

      No idea how those deletes happened... I'm not normally into randomly editing or deleting files that aren't mine, but I've done stranger things...

      Then I did

      git reset --hard HEAD
      git fetch
      git checkout pi_zero_wheel
      python3 install_requirements.py
      python3 depthai_demo.py -rgbf 5

      and demo ran successfully.

      (Oh I had to comment out open3d in requirements-optional.txt)

      Thanks for the help.

        rymd80
        Good to know, thanks.
        The failure of open3d installation is not an error, since it's only optional. (Not supported on all platforms)

        a month later

        I know this is a late to the party, but I built OpenCV for my Jetson Xavier AGX, and I too got the error when I tried to use CV2. Here is the information that I found that worked really well to resolve that issue:

        CV2 Illegal Instructions Resolution:
        add export OPENBLAS_CORETYPE=ARMV8 to your .bashrc should fix it.

          CactusJackFX thank you, your solution worked for me too on a Jetson Xavier NX!

          @Brandon is the solution for the build on Jetson valid only for Gen 1 at the moment? Do you know if there is there a way to build DepthAI Gen 2 on a Jetson?

            Letty So @themarpe actually knows on this. I risk being wrong on the Jetson build for Gen2. I've only personally built Gen1 on Jetson.

            And I think @themarpe is actually adding Jetson (aarch64) series to our CI/CD next week so that these will be pre-built along with Ubuntu-AM64/Raspberry Pi OS/macOS/Windows. We had been meaning to do this earlier, but just a bit behind.

            So potentially Martin may reply with build instructions and that it is now prebuilt. :-).

            Best,
            Brandon