jetson-print-device-info
NVIDIA/skills
捕獲 Jetson 裝置模組型號、L4T 版本、核心、作業系統版本和電源模式的基線快照,用於效能測試或驗證。
...展開全部jetson-print-device-info
列印執行此技能的 Jetson 裝置的簡明摘要。
此技能旨在作為 jetson-device-skills 倉庫和 NVIDIA 全域性技能 CI 的參考示例。它在 Jetson 目標裝置(而非主機 PC)上執行,並執行只讀檢查——在執行效能測試之前作為基線捕獲非常有用。
目的
在執行效能、迴歸或相容性測試之前,捕獲 Jetson 目標裝置軟體棧和電源模式的基線快照。
使用場景
- 啟動效能測試時,希望捕獲裝置軟體棧和電源模式的基線資料。
- 驗證新刷寫的 Jetson 裝置是否符合預期的 L4T / JetPack 版本。
前置條件
- 在 Jetson 目標裝置上執行(而非主機 PC)。
- 可用的標準命令列工具:
tr、cat、uname、uptime、lsb_release(或/etc/os-release)。 - 可用
nvpmodel獲取電源模式(可選——技能會優雅地回退)。
輸入
無。該技能僅從本地 Jetson 檔案系統和標準命令列工具中讀取資料。
指令
按順序執行每個步驟,並將捕獲的值列印到“輸出格式”部分顯示的報告中。
捕獲模組型號並驗證其為 Jetson 目標裝置——否則提前退出:```
裝置樹字串以空字元結尾,因此在列印前需去除 NUL 字元。
model=$(tr -d '\0' /dev/null) case "$model" in Jetson) ;; *) echo "未在 Jetson 目標裝置上執行 (型號: '${model:-unknown}')"; exit 1 ;; esac echo "$model"
提取 L4T 發行版標題行——跳過檔案其餘部分(長列表的庫 SHA 值):``` head -1 /etc/nv_tegra_release 2>/dev/null || echo "未找到 L4T 發行版資訊"
等效命令: grep -m1 '^# R' /etc/nv_tegra_release
執行
nvpmodel -q並合併其兩行輸出(NV Power Mode: <name></name>和模式編號)到一行。paste -sd僅使用分隔符的第一個字元,因此使用awk插入字面量/分隔符:``` nvpmodel -q 2>/dev/null | awk 'NR==1{a=$0; next} {print a" / "$0}' \ || echo "nvpmodel 不可用"列印核心版本和執行時間:``` uname -r uptime -p
列印作業系統版本(優先使用
lsb_release,回退到/etc/os-release):``` lsb_release -ds 2>/dev/null || (. /etc/os-release && echo "$PRETTY_NAME") || echo "未找到作業系統版本"
輸出格式
列印包含以下部分的簡短報告,儘可能每部分一行:
Model: <device-tree>
L4T release: <release>
Power mode: <nvpmodel> / <mode>
Kernel: <uname>
Uptime: <uptime>
OS version: <lsb_release></lsb_release></uptime></uname></mode></nvpmodel></release></device-tree>示例
Orin AGX 開發套件(L4T R36 / Ubuntu 22.04)上的示例輸出:
Model: NVIDIA Jetson AGX Orin Developer Kit
L4T release: # R36 (release), REVISION: 3.0
Power mode: NV Power Mode: MAXN / 0
Kernel: 5.15.136-tegra
Uptime: up 2 hours, 14 minutes
OS version: Ubuntu 22.04.4 LTS
AGX Thor(L4T R39 / Ubuntu 24.04)上的示例輸出:
Model: NVIDIA Jetson AGX Thor Developer Kit
L4T release: # R39 (release), REVISION: 0.0
Power mode: NV Power Mode: 120W / 1
Kernel: 6.8.0-tegra
Uptime: up 12 minutes
OS version: Ubuntu 24.04 LTS
錯誤處理
如果底層檔案或二進位制檔案缺失,每個命令都會回退到帶有清晰標籤的 "... not found" / "... not available" 字串——該技能在報告過程中絕不會報錯。如果 /proc/device-tree/model 缺失或不包含 Jetson 字串,則提前退出並顯示清晰的“未在 Jetson 目標裝置上執行”訊息。
侷限性
- 僅進行只讀檢查——不檢測 GPU/CPU 時鐘、熱狀態或各供電軌功耗。
nvpmodel的輸出格式因 L4T 版本而異;該技能會原樣列印,而不進行解析。
故障排除
- 錯誤:
/proc/device-tree/model: No such file or directory原因: 在主機 PC 上執行,而非 Jetson 目標裝置。解決方案: 直接在 Jetson 裝置上執行該技能(例如透過 SSH)。 - 錯誤:
nvpmodel: command not found原因: 未安裝 L4T BSP,或在沒有nvpmodel的最小化容器中執行。解決方案: 在非 Jetson 或精簡環境中預期會出現此情況——該技能會列印"nvpmodel not available"並繼續執行。
備註
- 只讀。請勿更改電源模式、安裝軟體包或修改任何檔案。
- 如果誤在主機 PC 上呼叫該技能,
/proc/device-tree/model將不包含 Jetson 型號字串——檢測到這一點後,應顯示清晰訊息並退出,而不是列印誤導性資訊。
---
name: jetson-print-device-info
description: Captures a baseline snapshot of a Jetson device's module model, L4T version, kernel, OS version, and power mode for performance testing or verification.
license: Apache-2.0
---
# jetson-print-device-info
Prints a concise summary of the Jetson device this skill runs on.
This skill is intended as a reference example for the `jetson-device-skills` repo and the NVIDIA-wide skills CI. It runs on the Jetson target (not the host PC) and performs read-only inspection — useful as a baseline capture before running performance tests.
## Purpose
Capture a baseline snapshot of a Jetson target's software stack and power mode before running performance, regression, or compatibility tests.
## When to use
- Starting a performance run and you want a captured baseline of the device's software stack and power mode.
- Verifying that a freshly flashed Jetson matches an expected L4T / JetPack version.
## Prerequisites
- Running on a Jetson target (not the host PC).
- Standard CLIs available: `tr`, `cat`, `uname`, `uptime`, `lsb_release` (or `/etc/os-release`).
- `nvpmodel` available for power mode (optional — skill falls back gracefully).
## Inputs
None. The skill reads only from the local Jetson filesystem and standard CLIs.
## Instructions
Run each step in order and print the captured values into the report shown under [Output format](#output-format).
1. **Capture** the module model and **validate** it is a Jetson target — exit early otherwise:
```bash
# Device-tree strings are null-terminated, so strip NULs before printing.
model=$(tr -d '\0' < /proc/device-tree/model 2>/dev/null)
case "$model" in
*Jetson*) ;;
*) echo "Not running on a Jetson target (model: '${model:-unknown}')"; exit 1 ;;
esac
echo "$model"
```
2. **Extract** the L4T release header line — skip the rest of the file (long list of library SHAs):
```bash
head -1 /etc/nv_tegra_release 2>/dev/null || echo "L4T release info not found"
# Equivalent: grep -m1 '^# R' /etc/nv_tegra_release
```
3. **Run** `nvpmodel -q` and **join** its two output lines (`NV Power Mode: <name>` and the mode number) onto one line. `paste -sd` only uses the first char of its delimiter, so use `awk` to insert the literal ` / ` separator:
```bash
nvpmodel -q 2>/dev/null | awk 'NR==1{a=$0; next} {print a" / "$0}' \
|| echo "nvpmodel not available"
```
4. **Print** the kernel version and uptime:
```bash
uname -r
uptime -p
```
5. **Print** the OS version (prefer `lsb_release`, fall back to `/etc/os-release`):
```bash
lsb_release -ds 2>/dev/null || (. /etc/os-release && echo "$PRETTY_NAME") || echo "OS version not found"
```
## Output format
Print a short report with these sections, one line each where possible:
```text
Model: <device-tree model string>
L4T release: <release header line>
Power mode: <nvpmodel name> / <mode number>
Kernel: <uname -r>
Uptime: <uptime -p>
OS version: <lsb_release / /etc/os-release output>
```
## Examples
Example output on an Orin AGX dev kit (L4T R36 / Ubuntu 22.04):
```text
Model: NVIDIA Jetson AGX Orin Developer Kit
L4T release: # R36 (release), REVISION: 3.0
Power mode: NV Power Mode: MAXN / 0
Kernel: 5.15.136-tegra
Uptime: up 2 hours, 14 minutes
OS version: Ubuntu 22.04.4 LTS
```
Example output on an AGX Thor (L4T R39 / Ubuntu 24.04):
```text
Model: NVIDIA Jetson AGX Thor Developer Kit
L4T release: # R39 (release), REVISION: 0.0
Power mode: NV Power Mode: 120W / 1
Kernel: 6.8.0-tegra
Uptime: up 12 minutes
OS version: Ubuntu 24.04 LTS
```
## Error handling
Each command falls back to a clearly labeled `"... not found"` / `"... not available"` string if the underlying file or binary is missing — the skill never errors out mid-report. If `/proc/device-tree/model` is missing or does not contain a Jetson string, exit early with a clear "not running on a Jetson target" message.
## Limitations
- Read-only inspection only — does not detect GPU/CPU clocks, thermal state, or per-rail power.
- `nvpmodel` output format varies between L4T versions; the skill prints it verbatim rather than parsing.
## Troubleshooting
- **Error:** `/proc/device-tree/model: No such file or directory`
**Cause:** Running on a host PC, not a Jetson target.
**Solution:** Run the skill on the Jetson device directly (e.g. via SSH).
- **Error:** `nvpmodel: command not found`
**Cause:** L4T BSP not installed, or running in a minimal container without `nvpmodel`.
**Solution:** Expected on non-Jetson or stripped environments — the skill prints `"nvpmodel not available"` and continues.
## Notes
- Read-only. Do not change power mode, install packages, or modify any files.
- If the skill is invoked on a host PC by mistake, `/proc/device-tree/model` will not contain a Jetson model string — detect that and exit with a clear message rather than printing misleading info.
所有檔案
5 個檔案安裝 jetson-print-device-info
將技能檔案下載並解壓至你的 .claude/skills/ 目錄。
下載 ZIP複製儲存庫並將技能檔案複製到您的專案中。
git clone https://github.com/NVIDIA/skills/tree/main/skills/jetson-print-device-info # Copy SKILL.md to your .claude/skills/ directory
複製





首頁
