Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutOfMemoryError on Jetson Orin Nano #220

Open
Diva-Mio opened this issue Sep 20, 2023 · 11 comments
Open

OutOfMemoryError on Jetson Orin Nano #220

Diva-Mio opened this issue Sep 20, 2023 · 11 comments

Comments

@Diva-Mio
Copy link

Diva-Mio commented Sep 20, 2023

When I ran use sample command:

    roslaunch vins vins_rviz.launch
    rosrun vins vins_node ~/catkin_ws/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml 
    rosbag play MH_01_easy.bag

I got the following error message:

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.5.4) /home/ubuntu/build_opencv/opencv/modules/core/src/alloc.cpp:73: error: (-4:Insufficient memory) Failed to allocate 369394115439360 bytes in function 'OutOfMemoryError'
Aborted (core dumped)

How can I to solve this problem?
My Environment :

  1. Hardware:Jetson Orin Nano 8GB develop kit
  2. OS:Jetpack5.1.1
  3. installed opencv library:libopencv-viz4.2, python3-opencv/focal,now 4.2.0+dfsg-5 arm64
@patrickpoirier51
Copy link

I confirm the same error on a Jetson Xavier NX
nvidia-jetpack Version: 5.0.2-b231
ROS Noetic

The error message: OpenCV(4.5.4) /home/ubuntu/build_opencv/opencv/modules/core/src/alloc.cpp:73:
is referencing an inexsistant path on the Jetson , I suspect it is a reference to cv-bridge within ROS

I tried different version of OpenCV and built the https://github.com/ros-perception/vision_opencv/tree/noetic vision_opencv with no succes

@patrickpoirier51
Copy link

Just a quick update, Removing refs to JETPACK in sources made it installing standard Opencv 4.2

/etc/apt/sources.list.d/nvidia-l4t-apt-source.list
commented (#) these lines
deb https://repo.download.nvidia.com/jetson/common r35.4 main
deb https://repo.download.nvidia.com/jetson/t194 r35.4 main

sudo apt update
sudo apt install libopencv-dev
All 4 .2 libs installed clean

VINS-Fusions build and works @ 15 FPS

@otis-XJY
Copy link

I have the same problem in NX. Does it worked out?

@patrickpoirier51
Copy link

I have the same problem in NX. Does it worked out?

Yes

@otis-XJY
Copy link

Thank you for your reply. But I'm a little confused

Just a quick update, Removing refs to JETPACK in sources made it installing standard Opencv 4.2

/etc/apt/sources.list.d/nvidia-l4t-apt-source.list commented (#) these lines deb https://repo.download.nvidia.com/jetson/common r35.4 main deb https://repo.download.nvidia.com/jetson/t194 r35.4 main

sudo apt update sudo apt install libopencv-dev All 4 .2 libs installed clean

VINS-Fusions build and works @ 15 FPS

Thank you for your reply. Please forgive my broken English.
I'm a little confused about your Opencv version. The error in NX is about opencv4.5.4. But you removed opencv 4.2 and resolve the problem.
And how did you remove opencv4.2? just "commented (#) these lines" as you said?
Or you did like this
sudo apt-get purge libopencv*
sudo apt autoremove
sudo apt-get update

@Diva-Mio
Copy link
Author

Diva-Mio commented Nov 29, 2023

https://forums.developer.nvidia.com/t/compiling-opencv-on-jetpack-5/219668

This is a solve about clean opencv4.5.4 and 4.2.
I run this .sh after install ROS.
It can work for me.
BTW it has a few problem between build opencv4.6.0, So you need to search the solution about it.

@patrickpoirier51
Copy link

patrickpoirier51 commented Nov 29, 2023

Yes, you need to purge package. Your apt sequence is good

If you check before purge, with apt list --installed, you will see a mix of 4.2 and 4.5 ; that is the root cause of the problem

After applying the update without JetPack, you can check if all installed packages are 4,2

@otis-XJY
Copy link

otis-XJY commented Dec 5, 2023

https://forums.developer.nvidia.com/t/compiling-opencv-on-jetpack-5/219668

This is a solve about clean opencv4.5.4 and 4.2. I run this .sh after install ROS. It can work for me. BTW it has a few problem between build opencv4.6.0, So you need to search the solution about it.

thank you for your advice. but I have installed the opencv4.5.3 with cuda. If I run this .sh, it will remove all the opencv package,right?

@Diva-Mio
Copy link
Author

Diva-Mio commented Dec 5, 2023

Yes, if you don't want to install opencv 4.6.0 you can modify that file. And install opencv4.5.3 after clean.

@otis-XJY
Copy link

otis-XJY commented Dec 5, 2023

Yes, if you don't want to install opencv 4.6.0 you can modify that file. And install opencv4.5.3 after clean.

OK,I see. But I have other project need opencv, so it's a little risky to remove all opencv. I have tried to remove so .so by find /usr/lib/aarch64-linux-gnu -type f -name "*4.5.4*" -exec rm {} \;(my jetpack opencv is 4.5.4)
it seem work for me

@anandvgeorge
Copy link

I have faced similar issue recently on Jetson Orin. For me the issue was resolved after I built cv_bridge and dependent ROS packages from source, with the same OpenCV version used for compiling VINS-Fusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants