官網的簡介
https://devblogs.nvidia.com/jetson-nano-ai-computing/
1.依據官網上的步驟把系統映像檔寫到MMC card (32GB up)
https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit
Reference
https://www.pyimagesearch.com/2016/07/11/compiling-opencv-with-cuda-support/
2.短路J48使用5V / 4A的power adapter供電
3.上電開機後經過一連串設定及 user name / password 進入Ubuntu Desktop
4.系統上有4GB DDR memory在之後compile OpenCV會不夠用,先開個4GB swap
$ sudo fallocate -l 4.0G /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ sudo vi /etc/fstab
/swapfile none swap defaults 0 0
5.安裝必要開發套件$ sudo apt-get update
$ sudo apt-get install cmake git
$ sudo apt-get install python-pip
$ sudo apt-get install python3-pip python3-pil
$ sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav
$ sudo apt-get install libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev \
libgstrtspserver-1.0-dev
$ sudo apt-get install libgtk2.0-dev
$ sudo apt-get install libgtk2.0-dev
$ sudo apt-get install cmake
6.分別下載 opencv 及 opencv_contrib
https://github.com/opencv/opencv/archive/4.4.0.zip
https://github.com/opencv/opencv_contrib/archive/4.4.0.zip
解壓縮後放在同一個目錄下
cd opencv-4.4.0
mkdir build
cd build
cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.4.0/modules -DWITH_CUDA=ON -DCUDA_FAST_MATH=1 -DBUILD_EXAMPLES=OFF -DWITH_GSTREAMER=ON -DWITH_V4L=ON -DWITH_LIBV4L=OFF -D BUILD_opencv_python2=ON -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR2=/usr/include/python3.6m -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_EXAMPLES=OFF -D CMAKE_INSTALL_PREFIX=/usr/local -DENABLE_CXX11=ON -D CMAKE_C_COMPILER=/usr/bin/gcc-7 ..
等待約三個小時...
$ sudo make install
7.安裝Jetson Stats, 這樣就能即時monitor CPU / GPU / Memory 狀態
$ sudo -H pip3 install jetson-stats
$jtop
沒有留言:
張貼留言