Illegal instruction(core dumped) error on Jetson Nano

We Are Going To Discuss About Illegal instruction(core dumped) error on Jetson Nano. So lets Start this Python Article.

Illegal instruction(core dumped) error on Jetson Nano

  1. How to solve Illegal instruction(core dumped) error on Jetson Nano

    The 'illegal instruction' could be due to an recent change in the getauxval(AT_HWCAP).
    An attempt to read cpuid information from /sys/devices in the event that getauxval did not succeed. (OpenBLAS PRs 2952 and 3004)
    export OPENBLAS_CORETYPE=ARMV8 (or whatever the actual hardware is) before launching python should hopefully get around this. For example:
    OPENBLAS_CORETYPE=ARMV8 python
    If you would like to make this export permanent, you should open your .bashrc file by typing on the terminal:
    nano ~/.bashrc
    Afterwards, just add “export OPENBLAS_CORETYPE=ARMV8” to the bottom of your .bashrc file, save/exit and reboot your system:
    export OPENBLAS_CORETYPE=ARMV8
    for more details look at:
    https://github.com/numpy/numpy/issues/18131
    https://www.reddit.com/r/JetsonNano/comments/ktcyoh/illegal_instructioncore_dumped_error_on_jetson/

  2. Illegal instruction(core dumped) error on Jetson Nano

    The 'illegal instruction' could be due to an recent change in the getauxval(AT_HWCAP).
    An attempt to read cpuid information from /sys/devices in the event that getauxval did not succeed. (OpenBLAS PRs 2952 and 3004)
    export OPENBLAS_CORETYPE=ARMV8 (or whatever the actual hardware is) before launching python should hopefully get around this. For example:
    OPENBLAS_CORETYPE=ARMV8 python
    If you would like to make this export permanent, you should open your .bashrc file by typing on the terminal:
    nano ~/.bashrc
    Afterwards, just add “export OPENBLAS_CORETYPE=ARMV8” to the bottom of your .bashrc file, save/exit and reboot your system:
    export OPENBLAS_CORETYPE=ARMV8
    for more details look at:
    https://github.com/numpy/numpy/issues/18131
    https://www.reddit.com/r/JetsonNano/comments/ktcyoh/illegal_instructioncore_dumped_error_on_jetson/

Solution 1

The ‘illegal instruction’ could be due to an recent change in the getauxval(AT_HWCAP).

An attempt to read cpuid information from /sys/devices in the event that getauxval did not succeed. (OpenBLAS PRs 2952 and 3004)

export OPENBLAS_CORETYPE=ARMV8 (or whatever the actual hardware is) before launching python should hopefully get around this. For example:

OPENBLAS_CORETYPE=ARMV8 python

If you would like to make this export permanent, you should open your .bashrc file by typing on the terminal:

nano ~/.bashrc

Afterwards, just add “export OPENBLAS_CORETYPE=ARMV8” to the bottom of your .bashrc file, save/exit and reboot your system:

export OPENBLAS_CORETYPE=ARMV8

for more details look at:

https://github.com/numpy/numpy/issues/18131
https://www.reddit.com/r/JetsonNano/comments/ktcyoh/illegal_instructioncore_dumped_error_on_jetson/

Original Author Vladimir Simoes da Luz Junior Of This Content

Solution 2

Installing the correct numpy version helped me resolve this issue. Whenever i imported torch, cv2 or torchvision, I got the error saying Illegal instruction(core dumped).
Use the command pip install numpy==1.19.4 and I hope the error goes.

Original Author Aishwarya Patil Of This Content

Solution 3

I had this very same problem following the same guide. BTW, in this scenario, numpy worked just fine in python when NOT in a virtualenv. GDB pointed to a problem in libopenblas.

My solution was to start from scratch with a fresh image of jetson-nano-4gb-jp441-sd-card-image.zip and repeat that guide without using virtualenv. More than likely you are the sole developer on that Nano and can live without virtualenv.

I have followed these guides with success:
https://qengineering.eu/install-opencv-4.5-on-jetson-nano.html

Skip the virtualenv portions
https://www.pyimagesearch.com/2019/05/06/getting-started-with-the-nvidia-jetson-nano/

I found this to also be required at this point: “..install the official Jetson Nano TensorFlow by..”

ln -s /usr/include/locale.h /usr/include/xlocale.h

Once I made that symbolic link I was able to proceed with the rest of the guide (minus virtualenv) and I managed to not break numpy.

This is not ideal, but I hope it helps.

Original Author doommonkey Of This Content

Solution 4

I thinks this a bug with Jetson Nano B01 model.

Yesterday I realized that my Nano is a different model than the one Adrian is showing in his guide(A02).

Thank you doommonkey to lead me to a different guide that looks pretty much to the pyimagesearch tutorial and more recent one (Dec, 2020), I really appreciate that.

I will test it today and if I can build my opencv to functional including Tensorflow. I think this is a half solved problem.

It’s a shame that virtualenv is giving this awful error for python 3.6.9. In th is particular model. I tried with venv module too and it can’t even install numpy so no virtual env for now

Original Author edited Jan 11, 2021 at 13:30 Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment