0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Jetson NanoでOpenCV 4.5.xをmakeするとSegmentation faultになる件について

Last updated at Posted at 2022-02-19
  • Jetson Nano 4GB
  • JetPack 4.6

参考:https://www.koikikukan.com/archives/2017/05/26-000300.php

はじめに

Prob:OpenCV 4.5.xのmake中に「c++: internal compiler error: Segmentation fault (program cc1plus)」が生じてしまいます。
Solve:スタックサイズを無制限に設定することで回避できました。

パッケージの更新とスワップ領域の設定など

sudo apt update
sudo apt upgrade
(Automatically restart Docker daemon? -> No)

sudo apt install nano

sudo apt install dphys-swapfile

sudo nano /sbin/dphys-swapfile

/sbin/dphys-swapfile
CONF_MAXSWAP=4096

sudo nano /etc/dphys-swapfile

/etc/dphys-swafile
CONF_SWAPSIZE=4096

sudo sh -c 'echo 128 > /sys/devices/pwm-fan/target_pwm'

reboot

スタックサイズの確認と設定

ulimit -a

stack size (kbytes, -s) 1024

sudo nano /etc/security/limits.conf

「ubuntu」ユーザーのスタックサイズを無制限に設定します。

/etc/security/limits.conf
# End of file
nvidia hard stack 1024
nvidia soft stack 1024
ubuntu hard stack unlimited
ubuntu soft stack unlimited
root hard stack 1024
root soft stack 1024

OpenCVのインストール

wget https://github.com/Qengineering/Install-OpenCV-Jetson-Nano/raw/main/OpenCV-4-5-5.sh
sudo chmod 755 ./OpenCV-4-5-5.sh
./OpenCV-4-5-5.sh

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?