發表文章

目前顯示的是 8月, 2019的文章

Nvidia Jetson 燒機測試

sudo apt-get install stress sudo apt-get install python-pip sudo -H pip install jetson-stats # 60 x 70 = 4200 stress -c 4 -m 4 -t 4200M sudo jtop

NFS server and client setup on Ubuntu

Server: NFS server (ex: 192.168.0.1) Client: NFS client (ex: 192.168.0.2) Server [ 編輯  |  編輯原始碼 ] Install nfs server sudo apt-get install nfs-kernel-server nfs-common create share folder sudo mkdir -p /var/ota sudo chown nobody:nogroup /var/ota sudo vi /etc/exports, add following line to /etc/exports  NOTE: use 'tab' as seperator, do not use 'space' /var/ota 192 .168.0.2 ( rw,sync,no_subtree_check ) start nfs server sudo service nfs-kernel-server start Client [ 編輯  |  編輯原始碼 ] mount the shared folder sudo mkdir -p /mnt/nfs/ota sudo mount -t nfs 192 .168.0.1:/var/ota /mnt/nfs/ota/

GStreamer memo

Introduction Please use the default build-in gtreamer 1.0 on Jetson Nano. Nvidia upstream the Nvidia plugins (ex:  nv arguscamerasrc,  nv vidconv,  nv videosink etc) to gstreamer for easy maintain. GStreamer WIKI Tutorial If you are not familiar with the concept of "pipeline", please read the following URL. (Use the "translation", and you also can find some Chinese documents on web) GStreamer concepts, HelloWorld,  link Dynamic Pipeline,  link Make sure you understand the meaning of the followings: How to create elements with  gst_element_factory_make() How to create an empty pipeline with  gst_pipeline_new() How to add elements to the pipeline with  gst_bin_add_many() How to link the elements with each other with  gst_element_link() Useful Tips List all installed plugins $ gst-inspect-1.0 You can inspect any pipeline elements with  gst-inspect-1.0  to get more details $ gst-inspect-1.0 v4l2src The version of installed gStremer

OpenCV memo

[2019.07.31] Jetson Nano build-in OpenCV is 3.3.1, and it came from ubuntu without CUDA enabling. How to install pre-built OpenCV ? prebuild opencv package will enable CUDA, gstreamer and V4L support. Remove Nano build-in OpenCV 3.3.1 sudo apt-get purge *libopencv* Download the pre-build deb package and install For using git on Nano, you will need to generate SSH key on Nano, and add key to gitLAB git clone git@172.18.18.18:Jetson_Nano/opencv-build.git cd opencv-build sudo apt install ./OpenCV-3.4.0-aarch64-dev.deb sudo apt install ./OpenCV-3.4.0-aarch64-libs.deb sudo apt install ./OpenCV-3.4.0-aarch64-python.deb After deb installation, OpenCV files can be found in the following folders and ready to be used, but if you need to re-build OpenCV by any reason, please refer to the following section. Include files: /usr/include/opencv /usr/include/opencv2 Libraries: /usr/lib TODO make install/strip to get smaller size How to compile/run OpenCV sample

Use GDB to debug

What is GDB? GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed. https://sourceware.org/gdb/onlinedocs/gdb/index.html Off-line Debug When you got  segmentation fault , you can use  gdb  to load the  core dump  file to debug what happened. But Linux default did not enable core dump file, you will need to enable it by the following command. Beware, ulimit command will set the core dump file size to unlimited, and it will be only enabled in the current shell. ulimit -c unlimited sudo sysctl -w kernel.core_pattern = /tmp/core-%e.%p.%h.%t Compile your program with debug symbols, add "-g" to compile options. g++ -g -std = c++11 -o myprogram myprogram.cpp ` pkg-config opencv --cflags --libs ` Now, run your program again, then you will find the core dump file under /tmp Ex: /tmp/core-myprogram.17521.evan-desktop.1565936379 Use gdb to loa