YH Hsu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    14
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Jetson 邊緣裝置查詢系統性能指令jtop ###### tags: `Edge AI` `Deployment` `Nvidia` `Jetson` ![](https://i.imgur.com/S5QFcnE.png =800x) ## NVIDIA Jetson 平台部署相關筆記 ### 基本環境設定 - [Jetson AGX Xavier 系統環境設定1_在windows10環境連接與安裝](https://hackmd.io/@YungHuiHsu/HJ2lcU4Rj) - [Jetson AGX Xavier 系統環境設定2_Docker安裝或從源程式碼編譯](https://hackmd.io/k-lnDTxVQDWo_V13WEnfOg) - [NVIDIA Container Toolkit 安裝筆記](https://hackmd.io/wADvyemZRDOeEduJXA9X7g) - [Jetson 邊緣裝置查詢系統性能指令jtop](https://hackmd.io/VXXV3T5GRIKi6ap8SkR-tg) - [Jetson Network Setup 網路設定](https://hackmd.io/WiqAB7pLSpm2863N2ISGXQ) - [OpenCV turns on cuda acceleration in Nvidia Jetson platform<br>OpenCV在Nvidia Jetson平台開啟cuda加速](https://hackmd.io/6IloyiWMQ_qbIpIE_c_1GA) ### 模型部署與加速 - [[Object Detection_YOLO] YOLOv7 論文筆記](https://hackmd.io/xhLeIsoSToW0jL61QRWDcQ) - [Deploy YOLOv7 on Nvidia Jetson](https://hackmd.io/kZftj6AgQmWJsbXsswIwEQ) - [Convert PyTorch model to TensorRT for 3-8x speedup<br>將PyTorch模型轉換為TensorRT,實現3-8倍加速](https://hackmd.io/_oaJhYNqTvyL_h01X1Fdmw?both) - [Accelerate multi-streaming cameras with DeepStream and deploy custom (YOLO) models<br>使用DeepStream加速多串流攝影機並部署客製(YOLO)模型](https://hackmd.io/@YungHuiHsu/rJKx-tv4h) - [Model Quantization Note 模型量化筆記](https://hackmd.io/riYLcrp1RuKHpVI22oEAXA) --- 一般在有獨立顯卡的機器上可以用以下指令gpu、記憶體等工作狀態 ``` watch -n 1 nvidia-smi ``` 由於Nvidia Jetson等邊緣裝置是arm架構,gpu是整合在板子上,無自帶 arm_nvidia-smi,`nvidia-smi`是給有獨立gpu的server或pc等檢查gpu使用狀況,在Jetson可以用`jtop`指令替代,以下是安裝過程 ## jtop指令安裝 [jetson-stats ](https://pypi.org/project/jetson-stats/) ![](https://i.imgur.com/MLsGdcD.gif) > jetson-stats is a package for monitoring and control your NVIDIA Jetson [Orin, Xavier, Nano, TX] series. > > jetson-stats is a powerful tool to analyze your board, you can use with a stand alone application with jtop or import in your python script, the main features are: > > Decode hardware, architecture, L4T and NVIDIA Jetpack > Monitoring, CPU, GPU, Memory, Engines, fan > Control NVP model, fan speed, jetson_clocks > Importable in a python script > Dockerizable in a container > Do not need super user > Tested on many different hardware configurations > Works with all NVIDIA Jetpack 先安裝 pip3: ``` sudo apt-get install python3-pip ``` * 檢查是否安裝成功 ``` pip3 -V ``` - 使用 pip3 安装 jetson-stats : ``` pip3 install jetson-stats ``` 或採用 ``` sudo -H pip3 install -U jetson-stats ``` > - sudo是基於Unix的操作系統中的一個命令,用於以高權限運行一個命令,通常要求用戶輸入密碼。 > - -H 是一個選項,與sudo一起使用,將HOME環境變量設置為目標用戶(本例中為root用戶)的主目錄。 > - pip3是Python 3的一個軟件包安裝程序 > - install 是與 pip3 一起使用的一個子命令,用於安裝軟件包。 > - -U 是 pip3 install 的一個選項,用於將現有軟件包升級到最新版本。 > > jetson-stats是被pip3安裝或升級的軟件包名稱。 > >把它們放在一起,命令 sudo -H pip3 install -U jetson-stats 是用來以高權限安裝或升級 Python 3 的 jetson-stats 包。它將HOME環境變量設置為根用戶的主目錄,並將該軟件包的任何現有版本升級到最新的可用版本。該命令通常用於NVIDIA Jetson設備,用於監控和管理系統資源。 ## jtop 使用 ``` sudo jtop ``` ![](https://i.imgur.com/TgdpG1q.png) ## 在Docker使用 * Install jetson-stats on your host * Install jetson-stats on your container as well * Pass to your container /run/jtop.sock:/run/jtop.sock ``` docker run --rm -it -v /run/jtop.sock:/run/jtop.sock rbonghi/jetson_stats:latest ``` (https://rnext.it/jetson_stats/docker.html) jtop.sock 是 jtop 工具使用的 Unix 套接字(Unix socket),它提供了一個本機通信的機制,使得 jtop 可以與系統的其他進程進行通信,以獲取系統資源的使用情況,並進行監控和診斷。 具體來說,jtop 可以通過 jtop.sock 與 NVIDIA Jetson 系統上運行的各種進程進行通信,獲取系統資源的使用情況,包括 CPU、GPU、記憶體、網路等等。jtop 還可以監測系統溫度、功率和時脈等參數,以及顯示正在運行的進程和它們的資源使用情況。 因此,將主機端的 jtop.sock 檔案掛載到 Docker 容器的 /run/jtop.sock 可以讓 Docker 容器中的程式與 jtop 工具進行通信,從而獲取 Jetson 系統的各種資訊,並進行監控和診斷。 ![](https://i.imgur.com/8H8bu79.png) https://rnext.it/jetson_stats/jtop/how_is_it_works.html ## 在Python環境直接使用與設定 [jetson_stats/examples/](https://github.com/rbonghi/jetson_stats/tree/master/examples) ```python= from jtop import jtop with jtop() as jetson: # jetson.ok() will provide the proper update frequency while jetson.ok(): # 讀取統計資訊 print(jetson.stats) # 禁用 DVFS 調節器並將時脈鎖定在當前 jetson.jetson_clocks = True # 將功率設置大最大 jetson.nvpmodel = 0 ``` ## 在terminal端設定 - nvpmodel(NVIDIA Power Model) Jetson 設備的 `nvpmodel`(NVIDIA Power Model)模式用於控制設備的性能和能耗。不同的 nvpmodel 模式會設置不同的時鐘頻率和電源限制,以在性能和能耗之間取得平衡。 例如,如果想要在設備上運行計算密集型的應用程序,可以選擇一個高性能的 nvpmodel 模式,該模式會提供更高的時鐘頻率和更高的電源限制,以便獲得更好的性能。相反,如果您想要節省能源,可以選擇一個低功耗的 nvpmodel 模式,該模式會降低時鐘頻率和電源限制,以便降低能耗。 使用 `nvpmodel` 命令行工具來查看和設置當前的 nvpmodel 模式。 ```bash= # 開啟最大功率設定 sudo nvpmodel -m 0 # 檢視設定結果 sudo nvpmodel -q ``` - jetson_clocks `jetson_clocks` 是一個命令行工具,用於設置 Jetson 設備的時鐘頻率。該命令會禁用 DVFS 調節器並將時鐘鎖定在當前 nvpmodel 模式下的最大值。這樣可以確保設備始終以最高性能運行,但也會增加能耗。 例如,如果設備當前處於 10W 模式,則運行 `jetson_clocks` 命令後,設備的時鐘頻率將被鎖定在 10W 模式下的最大值。 ```bash= sudo jetson_clocks ``` 以`jtop`命令使用互動式介面檢視 ![](https://i.imgur.com/RkRBySr.png =800x) ## 開機設定 在 jtop 的控制界面中,可以啟用 jetson_clocks on boot 選項,以便在設備啟動時自動運行 jetson_clocks 命令。要啟用此選項,您可以按下 5 進入 CTRL 界面,然後按下 s 和 e 兩個按鍵,將 jetson_clocks 和 boot 切換至 Running 和 Enable 1。 啟用此選項後,設備在啟動時會自動運行 jetson_clocks 命令,禁用 DVFS 調節器並將時鐘鎖定在當前 nvpmodel 模式下的最大值。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully