網頁

顯示具有 xavier 標籤的文章。 顯示所有文章
顯示具有 xavier 標籤的文章。 顯示所有文章

2023年3月7日 星期二

install opencv4.6.0 with CUDA for Jetson

參考 https://forums.developer.nvidia.com/t/best-way-to-install-opencv-with-cuda-on-jetpack-5-xavier-nx-opencv-for-tegra/222777
下載 install_opencv4.6.0_jetson.sh 備份如下
#!/bin/bash
#
# Copyright (c) 2022, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA Corporation and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA Corporation is strictly prohibited.
#

version="4.6.0"
folder="workspace"

for (( ; ; ))
do
    echo "Do you want to remove the default OpenCV (yes/no)?"
    read rm_old

    if [ "$rm_old" = "yes" ]; then
        echo "** Remove other OpenCV first"
        sudo apt -y purge *libopencv*
break
    elif [ "$rm_old" = "no" ]; then
break
    fi
done


echo "------------------------------------"
echo "** Install requirement (1/4)"
echo "------------------------------------"
sudo apt-get update
sudo apt-get install -y build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt-get install -y python3.8-dev python-dev python-numpy python3-numpy
sudo apt-get install -y libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
sudo apt-get install -y libv4l-dev v4l-utils qv4l2 v4l2ucp
sudo apt-get install -y curl


echo "------------------------------------"
echo "** Download opencv "${version}" (2/4)"
echo "------------------------------------"
mkdir $folder
cd ${folder}
curl -L https://github.com/opencv/opencv/archive/${version}.zip -o opencv-${version}.zip
curl -L https://github.com/opencv/opencv_contrib/archive/${version}.zip -o opencv_contrib-${version}.zip
unzip opencv-${version}.zip
unzip opencv_contrib-${version}.zip
rm opencv-${version}.zip opencv_contrib-${version}.zip
cd opencv-${version}/


echo "------------------------------------"
echo "** Build opencv "${version}" (3/4)"
echo "------------------------------------"
mkdir release
cd release/
cmake -D WITH_CUDA=ON -D WITH_CUDNN=ON -D CUDA_ARCH_BIN="7.2,8.7" -D CUDA_ARCH_PTX="" -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${version}/modules -D WITH_GSTREAMER=ON -D WITH_LIBV4L=ON -D BUILD_opencv_python3=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j$(nproc)


echo "------------------------------------"
echo "** Install opencv "${version}" (4/4)"
echo "------------------------------------"
sudo make install
echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc
echo 'export PYTHONPATH=/usr/local/lib/python3.8/site-packages/:$PYTHONPATH' >> ~/.bashrc
source ~/.bashrc


echo "** Install opencv "${version}" successfully"
echo "** Bye :)"

將 cv2 加到 python3 中
$ export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/site-packages
$ python3
>>> import cv2
>>> cnt = cv2.cuda.getCudaEnabledDeviceCount()
>>> cnt
1 表示有 CUDA

2022年11月25日 星期五

Jetpack L4T 35.1.0 風扇

jtop 無法在這個版本控制和查看 風扇

$ vi get_fan.sh
TEMP=`cat /sys/class/hwmon/hwmon0/temp1_input`
TEMP=$(echo "scale=2; ${TEMP}/1000" | bc)
echo Thermal=${TEMP}C

PWM=`cat /sys/class/hwmon/hwmon2/pwm1`
RPM=`cat /sys/class/hwmon/hwmon1/rpm`
echo FAN=$(( PWM * 100 / 255 ))% ${RPM}rpm


2022年10月20日 星期四

tensorflow 在 Xavier 出現 cannot allocate memory in static TLS block 錯誤

其實會出現這個問題是 gym tensorflow 衝突 原因
解決這個問題,就部會出現下列問題

Traceback (most recent call last):
  File "/home/UserName/envs/tf2.10.0/lib/python3.8/site-packages/tensorflow/python/pywrap_tensorflow.py", line 62, in <module>
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: /home/UserName/envs/tf2.10.0/lib/python3.8/site-packages/tensorflow/python/../../tensorflow_cpu_aws.libs/libgomp-d22c30c5.so.1.0.0: cannot allocate memory in static TLS block

$ vi .bashrc
export LD_PRELOAD=/home/UserName/envs/tf2.10.0/lib/python3.8/site-packages/tensorflow/python/../../tensorflow_cpu_aws.libs/libgomp-d22c30c5.so.1.0.0

2022年10月19日 星期三

安裝 Xavier JetPack 5.0.2

Download NVIDIA SDK Manager 1.8.4
https://developer.nvidia.com/nvidia-sdk-manager
選擇 .deb Ubuntu
$ sudo dpkg -i sdkmanager_1.8.4-10431_amd64.deb
[sudo] password for mark: 
Selecting previously unselected package sdkmanager.
(Reading database ... 340238 files and directories currently installed.)
Preparing to unpack sdkmanager_1.8.4-10431_amd64.deb ...
Unpacking sdkmanager (1.8.4-10431) ...
dpkg: dependency problems prevent configuration of sdkmanager:
 sdkmanager depends on libgconf-2-4; however:
  Package libgconf-2-4 is not installed.
 sdkmanager depends on libcanberra-gtk-module; however:
  Package libcanberra-gtk-module is not installed.

dpkg: error processing package sdkmanager (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 sdkmanager
出錯,使用下列命令修正
$ sudo apt --fix-broken install
$ sdkmanager
ADDITIONAL SDKS/DeepStream 要打勾
按 CONTINUE TO STEP 02
勾選 I accept the terms and conditions of the license aggrements
按 CONTINUE TO STEP 03
選擇 Manual Setup = Jetson AGX Xavier

角落起算
1. Power Button
2. Force Recovery Button
3. Reset Button

將 xavier 40-Pin 邊的(電源指示燈旁的) USB 連接至安裝主機
關機後先壓工程模式鍵(Recovery)再同時按壓電源鍵(Power),兩秒後放開進入工程模式

開啟螢幕,等待 Xavier 安裝完成開啟登入畫面
不用登入,按下 Install,繼續等待


$ sudo apt-get install python3-pip
$ sudo -H pip3 install jetson-stats
$ sudo systemctl restart jetson_stats.service
$ sudo jtop
$ sudo vi /etc/nvfancontrol.conf
        FAN_PROFILE full {
                #TEMP   HYST    PWM     RPM
                0       8       255     3640
                140     0       255     3640
        }
FAN_DEFAULT_PROFILE quite
FAN_DEFAULT_PROFILE cool

$ sudo systemctl stop nvfancontrol.service
$ sudo rm /var/lib/nvfancontrol/status
$ sudo vi /etc/nvfancontrol.conf
$ sudo systemctl start nvfancontrol.service
$ sudo cat /var/lib/nvfancontrol/status

$ sudo apt update
$ mkdir -p ~/.config/autostart
$ cp /usr/share/applications/vino-server.desktop ~/.config/autostart/
$ gsettings set org.gnome.Vino prompt-enabled false
$ gsettings set org.gnome.Vino require-encryption false
$ gsettings set org.gnome.Vino prompt-enabled false
$ gsettings set org.gnome.Vino require-encryption false
$ gsettings set org.gnome.Vino authentication-methods "['vnc']"
$ gsettings set org.gnome.Vino vnc-password $(echo -n 'ChangeToYourPasswd'|base64)
$ sudo vi /etc/gdm3/custom.conf
WaylandEnable=false
AutomaticLoginEnable = true
AutomaticLogin = UserLoginName

但發現 vino 比 x11vnc 慢,所以刪除 vino-server.desktop, 回復 custom.conf,改安裝 x11vnc
$ sudo apt-get install x11vnc
$ x11vnc -storepasswd
$ vi x11vnc_0.sh #其中124為gdm的user id, 可在 /etc/passwd 查詢
sudo /usr/bin/x11vnc -display :0 -auth /var/run/user/124/gdm/Xauthority -rfbauth /home/UserName/.vnc/passwd
$ cat x11vnc_1.sh
DISP=`ps -u $(id -u) -o pid= | \
    while read pid; do
        cat /proc/$pid/environ 2>/dev/null | tr '\0' '\n' | grep '^DISPLAY=:'
    done | grep -o ':[0-9]*' | sort -u`
DISPLAY=$DISP x11vnc -rfbport 5900 -rfbauth /home/UserName/.vnc/passwd
$ chmod +x x11vnc_0.sh x11vnc_1.sh
$ ./x11vnc_0.sh
使用 vnc client 登入,並輸入使用者名稱和密碼,然後變成黑畫面
別擔心此時主機已經登入,直接關閉 vnc client
$ ./x11vnc_1.sh
在使用一次 vnc client 登入即可

$ sudo apt-get install xserver-xorg-video-dummy
$ sudo vi /etc/X11/xorg.conf
Section "Module"
    Disable     "dri"
    SubSection  "extmod"
    Option  "omit xfree86-dga"
    EndSubSection
EndSection

Section "Device"
    Identifier  "Tegra0"
    Driver      "nvidia"
    # 必須改成 false, 否則未接螢幕時, vino 會顯示 nvidia 的 long
    Option      "AllowEmptyInitialConfiguration" "false"
EndSection

Section "ServerFlags"
    Option "AutoAddGPU" "false"
EndSection

Section "Screen"
    Identifier  "Nvidia Screen"
    Device      "Tegra0"
EndSection

Section "Device"
    Identifier  "Dummy Video Device"
    Driver      "dummy"
    VideoRam    256000
EndSection

Section "Monitor"
    Identifier  "Dummy Monitor"
    HorizSync   5.0-1000.0
    VertRefresh 5.0-200.0
    Modeline    "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
EndSection

Section "Screen"
    Identifier  "Dummy Screen"
    Monitor     "Dummy Monitor"
    Device      "Dummy Video Device"
    SubSection  "Display"
        Depth   24
        Virtual 1920 1080
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier "Main Layout"
    Screen 0 "Nvidia Screen"
    Screen 1 "Dummy Screen"
EndSection

vi vino.sh
#!/bin/bash

### BEGIN INIT INFO
# Provides:          vino-server
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Should-Start:
# Should-Stop:
# X-Start-Before:
# X-Stop-After:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: vino-server
### END INIT INFO

PIDFILE="/tmp/vino-server.pid"
NAME="vino-server"
GREPFILTER="/usr/lib/vino/vino-server"

service_kill() {

       ### kill -9
       PIDS="`ps aux |grep -v grep |grep -P "${GREPFILTER}" |awk '{print $2}' | tr '\n' ' ' `"
       if [ -n "$PIDS" ]; then
           echo "sleep 5"
           sleep 5
           PIDS="`ps aux |grep -v grep |grep -P "${GREPFILTER}" |awk '{print $2}' | tr '\n' ' ' `"
           if [ -n "$PIDS" ]; then
               echo "kill -9 ${PIDS}"
               kill -9 ${PIDS}
           fi
       fi
       if [ -f ${PIDFILE} ]; then
           echo "rm ${PIDFILE}"
           rm ${PIDFILE}
       fi
}

service_status() {
       PID="`cat ${PIDFILE}`"
       if [ -n "$PID" ]; then
           echo "${PIDFILE} : ${PID}"
       else
           echo "file doesnt' exist : ${PIDFILE}"
       fi
       PIDS="`ps aux |grep -v grep |grep -P "${GREPFILTER}" |awk '{print $2}' | tr '\n' ' ' `"
       if [ -n "$PIDS" ]; then
           echo "PROCESSES:"
           echo "$PIDS"
       fi
}

service_start() {
       PIDS="`ps aux |grep -v grep |grep -P "${GREPFILTER}" |awk '{print $2}' | tr '\n' ' ' `"
       if [ -n "$PIDS" ]; then
            echo "process is present : ${PIDS}"
            echo $PIDS > ${PIDFILE}
            chmod 644 ${PIDFILE}
            exit 0
       else

            gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
            gconftool-2 --type bool --set /desktop/gnome/remote_access/prompt_enabled 0
            export DISPLAY=:0.0
            /usr/lib/vino/vino-server --sm-disable &

            sleep 2

            PIDS="`ps aux |grep -v grep |grep -P "${GREPFILTER}" |awk '{print $2}' | tr '\n' ' ' `"
            if [ -n "$PIDS" ]; then
                 echo "$PIDS"
                 echo $PIDS > ${PIDFILE}
                 chmod 644 ${PIDFILE}
            fi
       fi
}
service_stop() {
       PIDS="`ps aux |grep -v grep |grep -P "${GREPFILTER}" |awk '{print $2}' | tr '\n' ' ' `"
       if [ -n "$PIDS" ]; then
           echo "kill ${PIDS}"
           kill ${PIDS}
       fi
       if [ -f ${PIDFILE} ]; then
           echo "rm ${PIDFILE}"
           rm ${PIDFILE}
       fi
}

case $1 in
   start)
     service_start;;
   stop)
     service_stop;
     service_kill;;
   kill)
     service_kill;;
   restart)
     service_stop;
     service_start;;
   status)
     service_status;;
   *)
     echo "usage: $0 {start|stop|kill|restart|status}" ;
     echo "example: $0 start" ;
esac
exit 0

Mount Disks
按左下角 Show Applications, 輸入 Disks
按下 Disks
選擇左側儲存裝置
按設定按鈕,選擇 Edit Mount Options
User Session Defaults 選擇 OFF
輸入 Mount Point
按下 Mount selected partition

2021年11月25日 星期四

Ubuntu 中文輸入

Xavier
$ sudo apt install ibus-chewing

System Settings/Language Support
按 Install / Remove Langeages...
點選 Chinese (traditional)
按 Apply

$ sudo reboot

System Settings/Text Entry
按 + 選 Chinese (chewing)(IBus)

$ sudo reboot

auto mount nfs after boot

$ sudo vi /etc/fstab
ip:/folder /media/folder        auto    noauto,x-systemd.automount 0 0

Install JetPack 4.6

參考 https://yingrenn.blogspot.com/2020/05/install-jetpack-44.html

$ sudo apt update
$ sudo dpkg -i sdkmanager_1.6.1-8175_amd64.deb
(Reading database ... 346387 files and directories currently installed.)
Preparing to unpack sdkmanager_1.6.1-8175_amd64.deb ...
Unpacking sdkmanager (1.6.1-8175) over (1.6.1-8175) ...
dpkg: dependency problems prevent configuration of sdkmanager:
 sdkmanager depends on libgconf-2-4; however:
  Package libgconf-2-4 is not installed.
 sdkmanager depends on libcanberra-gtk-module; however:
  Package libcanberra-gtk-module is not installed.

dpkg: error processing package sdkmanager (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 sdkmanager

出錯,使用下列命令
$ sudo apt --fix-broken install

$ sdkmanager

2020年5月21日 星期四

Install JetPack 4.4

https://developer.nvidia.com/embedded/jetpack

$ sudo apt update
$ sudo apt-get install python

選擇 Download the NVIDIA SDK Manager
$ sudo dpkg -i sdkmanager_1.1.0-6343_amd64.deb
$ sdkmanager
此時會檢查記憶體空間和螢幕解析度
硬碟要求也越來越大

輸入 NVIDIA DEVELOPER 帳號密碼
在 Step 01, 選 Target Hardware: Jetson AGX Xavier
CONTINUE TO STEP 02
勾選 I accept the terms and conditions of the license agreements
CONTINUE TO STEP 03
輸入 root 密碼
連接 Xavier 40-Pin 邊的 usb, 到安裝主機的 usb
會使用此連線(192.168.55.1)到被安裝主機
選擇 Automatic setup 或 Manual setup
Automatic 是要在已經安裝過,可以 login 的機器
輸入 IP, Username, Password
Finish
Manual 可以用在未安裝的機器
Force Recover button
Power button
同時放開

輸入 IP, Username, Password
切換到被安裝主機繼續設定
選擇鍵盤,時區,主機名稱,使用者名稱,密碼

jetson_clocks.sh 已經改成 jetson_clocks

sudo apt-get install python3-pip
sudo pip3 install jetson-stats
sudo vi /etc/rc.local
#!/bin/bash
sleep 10
sudo sh -c 'echo 100 > /sys/devices/pwm-fan/target_pwm'
sudo chmod u+x /etc/rc.local

安裝中文
System Settings/Language Support
sudo apt-get install ibus-chewing
reboot
System Settings/Text Entry
+ Chinese (Chewing)(IBus)
Switch to next source using: Ctrl+Space

sudo apt-get install x11vnc
sudo x11vnc -storepasswd
sudo chmod 644 ~/.vnc/passwd

設定預設聲音輸出
sudo vi /etc/pulse/default.pa
最底部
#set-default-sink output
set-default-sink 0
#set-default-sink input

設定 menu & title bar 大小
/usr/bin/gsettings set com.ubuntu.user-interface scale-factor "{'HDMI-0': 16}"

設定 滑鼠游標 大小
gsettings set org.gnome.desktop.interface cursor-size 48

自動執行
收尋/Startup Applications

2019年9月8日 星期日

Ubuntu 設定預設聲音輸出


vidia@nvidia-desktop:~$ pactl list short
sources 0 alsa_output.platform-3510000.hda.hdmi-stereo-extra2.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED 
1 alsa_output.platform-sound.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED 
2 alsa_input.platform-sound.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

nvidia@nvidia-desktop:~$ sudo vi /etc/pulse/default.pa  
### Make some devices default 
#set-default-sink output 
set-default-sink 0 
#set-default-source input

nvidia@nvidia-desktop:~$ pacmd list-sinks
2 sink(s) available.
  * index: 0
name: <alsa_output.platform-3510000.hda.hdmi-stereo-extra2>
driver: <module-alsa-card.c>
    index: 1
name: <alsa_output.platform-sound.analog-stereo>
driver: <module-alsa-card.c>

nvidia@nvidia-desktop:~$ pacmd set-default-sink 1
nvidia@nvidia-desktop:~$ pacmd set-default-sink 0


2019年8月24日 星期六

Build OpenCV 3.4 with CUDA

Build OpenCV 3.4 on NVIDIA Jetson AGX Xavier Developer Kit

原先內建的 OpenCV 放在 /usr
心建立的會放在 /usr/local

$ git clone https://github.com/jetsonhacks/buildOpenCVXavier.git
$ cd buildOpenCVXavier
$ git checkout v1.0
$ ./buildOpenCV.sh

sudo ln -s /usr/local/lib/python3.6/dist-packages/cv2.cpython-36m-aarch64-linux-gnu.so envs/OpenAiGym/lib/python3.6/site-packages/



2019年8月14日 星期三

使用 TensorRT, 載入 frozen_model.pb 太慢

使用 TensorRT 就是要加快 inference 的速度
沒想到載入模型時,速度超慢

上網查到 extremely long model loading time problem
發現主要原因為 protobuf 使用 python
改用 cpp 才能改善速度

文章上使用 protobuf 3.6.1
但是我的 protobuf 使用 3.8.0
所以把相關參數改成 3.8.0
並把 protobuf 安裝在 python 的 virtualenv 上

sudo /usr/local/cuda-10.0/bin/nvprof --log-file=profile_freeze.log /mnt/XavierSSD/envs/OpenAiGym/bin/python inference.py


2019年7月12日 星期五

玩 OpenAI Gym Atari 遊戲

參考 Playing the OpenAI Gym Atari Games

sudo apt-get build-dep python-pygame
pip install pygame
pip install matplotlib
sudo apt-get install python3-tk

mkdir -p gym/utils
下載 play.py 到 gym/utils

執行
import gym
from gym.utils.play import play
env = gym.make("MontezumaRevengeNoFrameskip-v4")
play(env, zoom=4)

2019年7月11日 星期四

Nvidia Jetson AGX Xavier 之 Qt 安裝

參考 How to install PyQt4 on Tx2
sudo apt-get install libqt4-dev qt4-dev-tools python-qt4-dev pyqt4-dev-tools
sudo apt-get install python-qt4
sudo apt-get install python3-pyqt4


參考 Install Qt Creator on NVIDIA Jetson TK1
sudo apt-get install build-essential qt5-default qtcreator -y
開啟 Qt Creator
選擇 Tools/Options/Build & Run/Compilers
Add/GCC
Compiler path: /usr/bin/gcc
選擇 Tools/Options/Build & Run/Kits
Manual/Desktop (default)
Compiler: GCC

sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
cp -r /usr/lib/python3/dist-packages/PyQt5 ~/XavierSSD/envs/OpenAiGym/lib/python3.6/site-packages/

wget "https://www.riverbankcomputing.com/static/Downloads/sip/sip-4.19.14.tar.gz"
wget 網址已經不存在
改從 https://distfiles.macports.org/py-sip/ 下載
tar -zxf sip-4.19.14.tar.gz
cd sip-4.19.14/
python configure.py
make
make install

2019年6月30日 星期日

Xavier OpenAI Gym

使用PyTorch,OpenAI Gym和Gazebo機器人模擬器爲NVIDIA Jetson深度強化學習GPU庫
PyTorch Install problem (Solved)
Robot Operating System (ROS) on NVIDIA Jetson AGX Xavier Developer Kit
TX2 - Jetson Reinforcement - cmake -- configuring incomplete
Install Gazebo using Ubuntu packages
NVIDIA Xavier - Deep Learning - Deep Learning Tutorials - Jetson Reinforcement
Ubuntu gazebo package
nvidia@jetson-0423418048807:~$ apt-cache madison gazebo9
   gazebo9 | 9.8.0-1~bionic | http://packages.osrfoundation.org/gazebo/ubuntu-stable bionic/main arm64 Packages
   gazebo9 | 9.0.0+dfsg5-3ubuntu1 | http://ports.ubuntu.com/ubuntu-ports bionic/universe arm64 Packages
    gazebo | 9.0.0+dfsg5-3ubuntu1 | http://ports.ubuntu.com/ubuntu-ports bionic/universe Sources
nvidia@jetson-0423418048807:~$
nvidia@jetson-0423418048807:~$ apt-cache madison libgazebo9-dev
libgazebo9-dev | 9.8.0-1~bionic | http://packages.osrfoundation.org/gazebo/ubuntu-stable bionic/main arm64 Packages
libgazebo9-dev | 9.0.0+dfsg5-3ubuntu1 | http://ports.ubuntu.com/ubuntu-ports bionic/universe arm64 Packages
    gazebo | 9.0.0+dfsg5-3ubuntu1 | http://ports.ubuntu.com/ubuntu-ports bionic/universe Sources
nvidia@jetson-0423418048807:~$
nvidia@jetson-0423418048807:~$ sudo apt-get install gazebo9=9.0.0+dfsg5-3ubuntu1
nvidia@jetson-0423418048807:~$ sudo apt-get install libgazebo9-dev=9.0.0+dfsg5-3ubuntu1
Getting Started with Gym
Errors during install sklearn.
How to install opencv-python for python3.6
Installing everything
GitHub atari_py
python3 setup.py build
python3 setup.py install
pip3 install cffi
sudo apt install libffi-dev

2019年6月25日 星期二

Nvidia Jetson AGX Xavier Build tensorflow 1.13

參考 Building Tensorflow 1.13 on Jetson Xavier

安裝 bazel
nvidia@jetson-0423418048807:~/XavierSSD/Downloads$ wget https://github.com/bazelbuild/bazel/releases/download/0.19.2/bazel-0.19.2-dist.zip
nvidia@jetson-0423418048807:~/XavierSSD/Downloads$ mkdir bazel
nvidia@jetson-0423418048807:~/XavierSSD/Downloads$ cd bazel
nvidia@jetson-0423418048807:~/XavierSSD/Downloads/bazel$ unzip bazel-0.19.2-dist.zip
nvidia@jetson-0423418048807:~/XavierSSD/Downloads/bazel$ env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
nvidia@jetson-0423418048807:~/XavierSSD/Downloads/bazel$ cd ..
nvidia@jetson-0423418048807:~/XavierSSD/Downloads$ mv bazel ~/XavierSSD
nvidia@jetson-0423418048807:~/XavierSSD/Downloads$ cd ../bazel/
nvidia@jetson-0423418048807:~/XavierSSD/bazel$ vi ~/.bashrc
加入下一行到檔案底部,並且也執行一遍
export PATH=~/XavierSSD/bazel/output${PATH:+:${PATH}}

下載 tensorflow
nvidia@jetson-0423418048807:~/XavierSSD/bazel$ cd ..
nvidia@jetson-0423418048807:~/XavierSSD$ git clone https://github.com/tensorflow/tensorflow.git
nvidia@jetson-0423418048807:~/XavierSSD$ cd tensorflow/

設定 git 環境,取得 r1.13 版
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git config --global user.email "name@yahoo.com.tw"
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git config --global user.name "name"
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git checkout r1.13

為 Nvidia Jetson AGX Xavier 修改
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ vi tensorflow/lite/kernels/internal/BUILD
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git add tensorflow/lite/kernels/internal/BUILD
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git commit -m "Update 1"
[r1.13 982e077b2a] Update 1
 1 file changed, 3 deletions(-)
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git log
commit 982e077b2a4e2123f7a299dbaf95d97383303d17 (HEAD -> r1.13)
Author: name <name@yahoo.com.tw>
Date:   Mon Jun 24 14:49:30 2019 +0800

    Update 1

commit 93dd14dce2e8751bcaab0a0eb363d55eb0cc5813 (origin/r1.13)
Author: Mihai Maruseac <mihaimaruseac@google.com>
Date:   Tue May 21 10:08:18 2019 -0700

    Update png_archive version to 1.6.37

    PiperOrigin-RevId: 249272809

nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git diff 93dd1 982e0
diff --git a/tensorflow/lite/kernels/internal/BUILD b/tensorflow/lite/kernels/internal/BUILD
index 4be3226938..7226f96fdf 100644
--- a/tensorflow/lite/kernels/internal/BUILD
+++ b/tensorflow/lite/kernels/internal/BUILD
@@ -22,15 +22,12 @@ HARD_FP_FLAGS_IF_APPLICABLE = select({
 NEON_FLAGS_IF_APPLICABLE = select({
     ":arm": [
         "-O3",
-        "-mfpu=neon",
     ],
     ":armeabi-v7a": [
         "-O3",
-        "-mfpu=neon",
     ],
     ":armv7a": [
         "-O3",
-        "-mfpu=neon",
     ],
     "//conditions:default": [
         "-O3",
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ vi third_party/aws/BUILD.bazel
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git add third_party/aws/BUILD.bazel
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git commit -m "Update 2"
[r1.13 a3d6ea2fce] Update 2
 1 file changed, 1 insertion(+), 1 deletion(-)
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git log
commit a3d6ea2fce8fff7bcf74ee52cd77074416d24bf2 (HEAD -> r1.13)
Author: mark <ingrenn@yahoo.com.tw>
Date:   Mon Jun 24 14:56:09 2019 +0800

    Update 2

commit 982e077b2a4e2123f7a299dbaf95d97383303d17
Author: mark <ingrenn@yahoo.com.tw>
Date:   Mon Jun 24 14:49:30 2019 +0800

    Update 1

nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git diff 982e0 a3d6ea
diff --git a/third_party/aws/BUILD.bazel b/third_party/aws/BUILD.bazel
index 5426f79e46..e08f8fc108 100644
--- a/third_party/aws/BUILD.bazel
+++ b/third_party/aws/BUILD.bazel
@@ -24,7 +24,7 @@ cc_library(
         "@org_tensorflow//tensorflow:raspberry_pi_armeabi": glob([
             "aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
         ]),
-        "//conditions:default": [],
+        "//conditions:default": glob(["aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",]),
     }) + glob([
         "aws-cpp-sdk-core/include/**/*.h",
         "aws-cpp-sdk-core/source/*.cpp",
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ vi third_party/gpus/crosstool/BUILD.tpl
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git add third_party/gpus/cro
sstool/BUILD.tpl
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git commit -m "Update 3"
[r1.13 65ad3b64e5] Update 3
 1 file changed, 1 insertion(+)
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git log
commit 65ad3b64e5f16b3496628bee800fabf825a7c1ce (HEAD -> r1.13)
Author: mark <ingrenn@yahoo.com.tw>
Date:   Mon Jun 24 15:04:22 2019 +0800

    Update 3

commit a3d6ea2fce8fff7bcf74ee52cd77074416d24bf2
Author: mark <ingrenn@yahoo.com.tw>
Date:   Mon Jun 24 14:56:09 2019 +0800

    Update 2

commit 982e077b2a4e2123f7a299dbaf95d97383303d17
Author: mark <ingrenn@yahoo.com.tw>
Date:   Mon Jun 24 14:49:30 2019 +0800

    Update 1

commit 93dd14dce2e8751bcaab0a0eb363d55eb0cc5813 (origin/r1.13)
Author: Mihai Maruseac <mihaimaruseac@google.com>
Date:   Tue May 21 10:08:18 2019 -0700

    Update png_archive version to 1.6.37
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ git diff a3d6ea 65ad3
diff --git a/third_party/gpus/crosstool/BUILD.tpl b/third_party/gpus/crosstool/BUILD.tpl
index db76306ffb..184cd35b87 100644
--- a/third_party/gpus/crosstool/BUILD.tpl
+++ b/third_party/gpus/crosstool/BUILD.tpl
@@ -24,6 +24,7 @@ cc_toolchain_suite(
         "x64_windows|msvc-cl": ":cc-compiler-windows",
         "x64_windows": ":cc-compiler-windows",
         "arm": ":cc-compiler-local",
+        "aarch64": ":cc-compiler-local",
         "k8": ":cc-compiler-local",
         "piii": ":cc-compiler-local",
         "ppc": ":cc-compiler-local",
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
修改完成

安裝所需版本的 g++ 和 gcc
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ sudo apt-get install g++-5
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ sudo apt-get install gcc-5

設定編譯環境
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ ./configure
Extracting Bazel installation...
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.19.2- (@non-git) installed.
Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3


Found possible Python library paths:
  /usr/lib/python3.6/dist-packages
  /usr/lib/python3/dist-packages
  /usr/local/lib/python3.6/dist-packages
Please input the desired Python library path to use.  Default is [/usr/lib/python3.6/dist-packages]

Do you wish to build TensorFlow with XLA JIT support? [Y/n]: n
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n
No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with ROCm support? [y/N]: n
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: y
CUDA support will be enabled for TensorFlow.

Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 10.0]:


Please specify the location where CUDA 10.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]: /usr/local/cuda-10.0


Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7]: 7.3


Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda-10.0]: /usr/lib/aarch64-linux-gnu


Do you wish to build TensorFlow with TensorRT support? [y/N]: y
TensorRT support will be enabled for TensorFlow.

Please specify the location where TensorRT is installed. [Default is /usr/lib/aarch64-linux-gnu]:


Please specify the locally installed NCCL version you want to use. [Default is to use https://github.com/nvidia/nccl]:


Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 3.5,7.0]: 7.2


Do you want to use clang as CUDA compiler? [y/N]: n
nvcc will be used as CUDA compiler.

Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]: /usr/bin/gcc-5


Do you wish to build TensorFlow with MPI support? [y/N]: n
No MPI support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native -Wno-sign-compare]:


Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl            # Build with MKL support.
        --config=monolithic     # Config for mostly static monolithic build.
        --config=gdr            # Build with GDR support.
        --config=verbs          # Build with libverbs support.
        --config=ngraph         # Build with Intel nGraph support.
        --config=dynamic_kernels        # (Experimental) Build kernels into separate shared objects.
Preconfigured Bazel build configs to DISABLE default on features:
        --config=noaws          # Disable AWS S3 filesystem support.
        --config=nogcp          # Disable GCP support.
        --config=nohdfs         # Disable HDFS support.
        --config=noignite       # Disable Apacha Ignite support.
        --config=nokafka        # Disable Apache Kafka support.
        --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$

建立 tensorflow 安裝資料
此處會執行很久,甚至會報錯,如找不到 numpy 等
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ bazel build --config=opt --config=nonccl //tensorflow/tools/pip_package:build_pip_package --incompatible_remove_native_http_archive=false --verbose_failures --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
產生 tensorflow-1.13.1-cp36-cp36m-linux_aarch64.whl
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ sudo bazel-bin/tensorflow/tools/pip_package/build_pip_package ../


移除舊的 tensorflow,並安裝新的
nvidia@jetson-0423418048807:~$ source XavierSSD/envs/tensorflow/bin/activate
(tensorflow) nvidia@jetson-0423418048807:~$ cd XavierSSD/tensorflow/
((tensorflow) nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ pip3 uninstall tensorflow-gpu
(tensorflow) nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ pip3 install ../tensorflow-1.13.1-cp36-cp36m-linux_aarch64.whl
(tensorflow) nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ deactivate
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$

建立 tensorflow c++ 的 shared library libtensorflow_cc.so
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ bazel build --config=opt --config=nonccl //tensorflow:libtensorflow_cc.so --incompatible_remove_native_http_archive=false --verbose_failures --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ ls -al bazel-bin/tensorflow/
libtensorflow_cc.so
-r-xr-xr-x 1 nvidia nvidia 303026864 Jun 25 12:22 bazel-bin/tensorflow/libtensorflow_cc.so
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$

nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ mkdir tensorflow/cc/example
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ vi tensorflow/cc/example/example.cc

// tensorflow/cc/example/example.cc

#include "tensorflow/cc/client/client_session.h"
#include "tensorflow/cc/ops/standard_ops.h"
#include "tensorflow/core/framework/tensor.h"

int main() {
  using namespace tensorflow;
  using namespace tensorflow::ops;
  Scope root = Scope::NewRootScope();
  // Matrix A = [3 2; -1 0]
  auto A = Const(root, { {3.f, 2.f}, {-1.f, 0.f} });
  // Vector b = [3 5]
  auto b = Const(root, { {3.f, 5.f} });
  // v = Ab^T
  auto v = MatMul(root.WithOpName("v"), A, b, MatMul::TransposeB(true));
  std::vector<Tensor> outputs;
  ClientSession session(root);
  // Run and fetch v
  TF_CHECK_OK(session.Run({v}, &outputs));
  // Expect outputs[0] == [19; -3]
  LOG(INFO) << outputs[0].matrix<float>();
  return 0;
}
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ vi tensorflow/cc/example/BUILD

load("//tensorflow:tensorflow.bzl", "tf_cc_binary")

tf_cc_binary(
    name = "example",
    srcs = ["example.cc"],
    deps = [
        "//tensorflow/cc:cc_ops",
        "//tensorflow/cc:client_session",
        "//tensorflow/core:tensorflow",
    ],
)
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$

編譯範例 example.cc
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ bazel build -c opt //tensorflow/cc/example:example
跑了好久,測試執行
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$ bazel-bin/tensorflow/cc/exam
ple/example
2019-06-25 16:10:03.922559: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:965] ARM64 does not support NUMA - returning NUMA node zero
2019-06-25 16:10:03.922959: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: Xavier major: 7 minor: 2 memoryClockRate(GHz): 1.5
pciBusID: 0000:00:00.0
totalMemory: 15.45GiB freeMemory: 8.57GiB
2019-06-25 16:10:03.923054: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-06-25 16:10:03.924346: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-06-25 16:10:03.924409: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990]      0
2019-06-25 16:10:03.924452: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0:   N
2019-06-25 16:10:03.925152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 8340 MB memory) -> physical GPU (device: 0, name: Xavier, pci bus id: 0000:00:00.0, compute capability: 7.2)
2019-06-25 16:10:07.582973: I tensorflow/cc/example/example.cc:22] 19
-3
nvidia@jetson-0423418048807:~/XavierSSD/tensorflow$


nvidia@jetson-0423418048807:~/XavierSSD$ git clone https://github.com/bitbionic/
keras-to-tensorflow.git
Cloning into 'keras-to-tensorflow'...
remote: Enumerating objects: 3719, done.
remote: Total 3719 (delta 0), reused 0 (delta 0), pack-reused 3719
Receiving objects: 100% (3719/3719), 227.81 MiB | 786.00 KiB/s, done.
Resolving deltas: 100% (7/7), done.
Checking out files: 100% (3688/3688), done.
nvidia@jetson-0423418048807:~/XavierSSD$
nvidia@jetson-0423418048807:~/XavierSSD$ cd keras-to-tensorflow
nvidia@jetson-0423418048807:~/XavierSSD/keras-to-tensorflow$ vi main.c
因為編譯時會有兩種錯誤
data.ToString(); 改成 std::string(data);
tensorflow::StringPiece(file_name).ends_with(".png")
改成
tensorflow::str_util::EndsWith(file_name, ".png")

nvidia@jetson-0423418048807:~/XavierSSD/keras-to-tensorflow$
nvidia@jetson-0423418048807:~/XavierSSD/keras-to-tensorflow$ g++-5 -std=gnu++11 -c ./main.cpp -D_GLIBCXX_USE_CXX11_ABI=0     -I../tensorflow     -I../tensorflow/bazel-tensorflow/external/eigen_archive     -I../tensorflow/bazel-tensorflow/external/protobuf_archive/src     -I../tensorflow/bazel-tensorflow/external/com_google_absl     -I../tensorflow/bazel-genfiles




2019年6月22日 星期六

Nvidia Jetson AGX Xavier 之 darknet 安裝

nvidia@jetson-0423418048807:~/XavierSSD$ export PATH=${PATH}:/usr/local/cuda/bin
nvidia@jetson-0423418048807:~/XavierSSD$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64
nvidia@jetson-0423418048807:~/XavierSSD$ git clone https://github.com/pjreddie/darknet
nvidia@jetson-0423418048807:~/XavierSSD$ cd darknet/
nvidia@jetson-0423418048807:~/XavierSSD/darknet$ vi Makefile 修改下列三行
GPU=1
CUDNN=1
OPENCV=1

nvidia@jetson-0423418048807:~/XavierSSD$ make


Nvidia Jetson AGX Xavier 測試

測試 CUDA
nvidia@jetson-0423418048807:~$ cd NVIDIA_CUDA-10.0_Samples/
nvidia@jetson-0423418048807:~/NVIDIA_CUDA-10.0_Samples$ cd bin/aarch64/linux/release/

nvidia@jetson-0423418048807:~/NVIDIA_CUDA-10.0_Samples/bin/aarch64/linux/release$ ./oceanFFT

nvidia@jetson-0423418048807:~/NVIDIA_CUDA-10.0_Samples/bin/aarch64/linux/release$ ./nbody -fullscreen -numbodies=16384


測試 tegra
nvidia@jetson-0423418048807:~$ cd tegra_multimedia_api/samples/backend/
nvidia@jetson-0423418048807:~/tegra_multimedia_api/samples/backend$
nvidia@jetson-0423418048807:~/tegra_multimedia_api/samples/backend$ ./backend 1 ../../data/Video/sample_outdoor_car_1080p_10fps.h264 H264 --trt-deployfile ../../data/Model/GoogleNet_one_class/GoogleNet_modified_oneClass_halfHD.prototxt --trt-modelfile ../../data/Model/GoogleNet_one_class/GoogleNet_modified_oneClass_halfHD.caffemodel --trt-mode 1 --trt-proc-interval 1 -fps 10
這裡會等很久

安裝 VisionWorks-1.6-Samples
nvidia@jetson-0423418048807:~$ /usr/share/visionworks/sources/install-samples.sh ~/
Creating the /home/nvidia//VisionWorks-1.6-Samples directory...
Copying VisionWorks samples to /home/nvidia//VisionWorks-1.6-Samples...
Finished copying VisionWorks samples
nvidia@jetson-0423418048807:~$ cd VisionWorks-1.6-Samples/
nvidia@jetson-0423418048807:~/VisionWorks-1.6-Samples$ make -j8

測試 VisionWorks-1.6-Samples
nvidia@jetson-0423418048807:~/VisionWorks-1.6-Samples/bin/aarch64/linux/release$ ls
nvx_demo_feature_tracker        nvx_sample_nvgstcamera_capture
nvx_demo_feature_tracker_nvxcu  nvx_sample_object_tracker_nvxcu
nvx_demo_hough_transform        nvx_sample_opencv_npp_interop
nvx_demo_motion_estimation      nvx_sample_opengl_interop
nvx_demo_stereo_matching        nvx_sample_player
nvx_demo_video_stabilizer


2019年6月21日 星期五

Nvidia Jetson AGX Xavier 運作模式,溫度,風扇

參考 NVPModel – NVIDIA Jetson AGX Xavier Developer Kit

sudo nvpmodel -q
查詢目前模式

sudo nvpmodel -m 0
設定成全力運行模式

0: 全力運行
1: 10W
2: 15W
3: 30W

sudo ./jetson_clocks.sh -show
顯示目前運作狀態

sudo ./jetson_clocks.sh
全力運作


0: 全力運作
1: 10W
2: 15W 預設值
3: 30W

sudo apt-get install lm-sensors
sudo sensors-detect 千萬不能執行,會當機
sensors 察看目前溫度

圖形介面的 sensor
sudo apt-get install psensor
psensor

專門為 NVIDIA jetson 準備的工具
Basic scripts and function to improve the performance in your NVIDIA Jetson
sudo apt-get install python3-pip
sudo -H pip3 install jetson-stats
jtop 即是 top for jetson
執行時使用 sudo jtop
其中第一個頁籤 1 ALL,中的 Sensor PMIC 一直是 100.00C,不知為何?
第三頁籤 3 CTRL,用 "+"、"-" 控制 NVP model

jetson-release 查詢 NVIDIA jetson 資訊

開機啟動風扇
sudo vi /etc/rc.local
#!/bin/bash
sleep 10
sudo sh -c 'echo 100 > /sys/devices/pwm-fan/target_pwm'

sudo chmod u+x /etc/rc.local



Nvidia Jetson AGX Xavier 之 WOL

poweroff 無法喚醒
sudo systemctl suspend
才可以喚醒,據說功耗 1.5-2W


sudo apt-get install ethtool

vi wol.sh
sudo ethtool -s wth0 wol g
sudo systemctl suspend


sudo ethtool eth0 (顯示 eth0 的設定)
Supports Wake-on: g (支援 wol)
Wake-on: d (wol 未啟動)
Wake-on: g (wol 啟動)

Nvidia Jetson AGX Xavier 安裝中文輸入法

參考 Ubuntu 類似微軟注音的輸入法 - hime 詞音輸入法

Ctrl+Space 啟動中文輸入
Shift 中英文切換
Ctrl+Alt+4 符號表

nvidia@jetson-0423418048807:~$ sudo apt-get install ibus-chewing

重新開機

System Settings/Language Support
Install / Remove Languages...
Add Chinese (traditional)
Keyboard input method system: ibus

在 Ubuntu 18.04 中新增新酷音輸入法

How can I use chewing(zhuyin) input method?
ubuntu 英文版中安裝新酷音輸入法
讓 Linux 下的中文輸入法更接近微軟新注音使用體驗
Ubuntu: fcitx + chewing 新酷音輸入法