jetson-print-device-info

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

jetson-print-device-info

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.
打印此技能运行所在的Jetson设备的简要信息汇总。
本技能是
jetson-device-skills
仓库和NVIDIA全平台技能CI的参考示例。它运行在Jetson目标设备上(而非主机PC),仅执行只读检查——在运行性能测试前作为基准信息捕获十分有用。

Purpose

用途

Capture a baseline snapshot of a Jetson target's software stack and power mode before running performance, regression, or compatibility tests.
在运行性能测试、回归测试或兼容性测试前,捕获Jetson目标设备软件栈和电源模式的基准快照。

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.
  • 启动性能测试时,希望捕获设备软件栈和电源模式的基准信息。
  • 验证新刷机的Jetson设备是否符合预期的L4T/JetPack版本。

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).
  • 运行在Jetson目标设备上(而非主机PC)。
  • 具备标准CLI工具:
    tr
    cat
    uname
    uptime
    lsb_release
    (或
    /etc/os-release
    )。
  • 具备
    nvpmodel
    工具以获取电源模式(可选——技能会优雅降级处理)。

Inputs

输入

None. The skill reads only from the local Jetson filesystem and standard CLIs.
无。该技能仅从本地Jetson文件系统和标准CLI读取信息。

Instructions

操作步骤

Run each step in order and print the captured values into the report shown under 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"
按顺序执行每一步,并将捕获的值打印到输出格式所示的报告中。
  1. 捕获模块型号并验证设备为Jetson目标设备——否则提前退出:
    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. 提取L4T发布信息的首行——跳过文件其余内容(冗长的库SHA列表):
    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. 运行
    nvpmodel -q
    合并其两行输出(
    NV Power Mode: <name>
    和模式编号)为一行。
    paste -sd
    仅使用分隔符的第一个字符,因此使用
    awk
    插入字面量
    /
    分隔符:
    bash
    nvpmodel -q 2>/dev/null | awk 'NR==1{a=$0; next} {print a" / "$0}' \
      || echo "nvpmodel not available"
  4. 打印内核版本和运行时长:
    bash
    uname -r
    uptime -p
  5. 打印操作系统版本(优先使用
    lsb_release
    ,降级到
    /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>
打印包含以下部分的简短报告,尽可能每行对应一项:
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
Orin AGX开发套件(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
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.
如果底层文件或二进制文件缺失,每个命令都会降级输出清晰标记的
"... not found"
/
"... not available"
字符串——技能不会在报告中途报错。如果
/proc/device-tree/model
缺失或不包含Jetson字符串,则提前退出并显示清晰的“未运行在Jetson目标设备上”提示信息。

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.
  • 仅支持只读检查——无法检测GPU/CPU时钟频率、热状态或单轨电源信息。
  • 不同L4T版本的
    nvpmodel
    输出格式有所不同;技能会直接打印原始输出而非解析。

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.
  • 错误:
    /proc/device-tree/model: No such file or directory
    原因: 在主机PC而非Jetson目标设备上运行。 解决方案: 直接在Jetson设备上运行该技能(例如通过SSH)。
  • 错误:
    nvpmodel: command not found
    原因: 未安装L4T BSP,或在未包含
    nvpmodel
    的极简容器中运行。 解决方案: 在非Jetson环境或精简环境中属于预期情况——技能会打印
    "nvpmodel not available"
    并继续执行。

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.
  • 只读操作。请勿更改电源模式、安装软件包或修改任何文件。
  • 如果误在主机PC上调用该技能,
    /proc/device-tree/model
    将不包含Jetson型号字符串——需检测此情况并退出,显示清晰提示信息,而非打印误导性内容。