jetson-headless-mode
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJetson Headless Mode
Jetson 无头模式
Plan-then-apply for safe, reversible user-space memory reclamation: switch the default systemd target away from and disable a curated set of non-essential daemons. This is the highest-yield, lowest-risk memory win on Jetson.
graphical.target采用先规划后应用的方式,安全、可逆地回收用户空间内存:将默认systemd目标从切换为其他目标,并禁用一组经过筛选的非必要守护进程。这是Jetson上收益最高、风险最低的内存优化方案。
graphical.targetPurpose
用途
Build a user-approved headless-mode plan from live audit data, then apply only safe, reversible user-space changes that reduce desktop and daemon memory use on Jetson.
基于实时审计数据制定用户认可的无头模式方案,然后仅应用安全、可逆的用户空间更改,以减少Jetson上桌面和守护进程的内存占用。
When to use
适用场景
- "Free as much memory as possible — I don't need the GUI."
- "I'm shipping this Jetson as an inference appliance / edge node."
- After shows
jetson-memory-auditor showsdefault_systemd_target=graphical.target/gdm3/lightdmactive on a system the user describes as headless.sddm
- "尽可能释放内存——我不需要GUI。"
- "我要将该Jetson作为推理设备/边缘节点部署。"
- 当显示
jetson-memory-audit,或显示default_systemd_target=graphical.target/gdm3/lightdm在用户描述为无头的系统上处于活跃状态时。sddm
When NOT to use
不适用场景
- The user needs the local desktop, display output, kiosk UI, or any X/Wayland session. In that case, do not recommend disabling the graphical target or display manager; use for a read-only view and suggest non-GUI memory options instead.
jetson-memory-audit - You do not have current audit data. Run first, or ask the user for its output, before proposing changes or estimating savings.
jetson-memory-audit
Use live device data as the source of truth. Jetson family, SKU/variant, memory totals, active display services, and savings estimates must come from , , or a fresh run. If a value is not available, say it is unknown instead of guessing. The savings numbers below are upper bounds; the real delta is whatever a before/after audit reports.
jetson-diagnostic/scripts/detect_jetson.shaudit.jsonjetson-memory-audit- 用户需要本地桌面、显示输出、信息亭UI或任何X/Wayland会话。这种情况下,请勿建议禁用图形目标或显示管理器;应使用获取只读视图,并建议非GUI相关的内存优化选项。
jetson-memory-audit - 没有当前审计数据。在提出更改建议或估算内存节省量之前,请先运行,或向用户索要其输出结果。
jetson-memory-audit
以设备实时数据为事实依据。Jetson系列、SKU/型号、总内存、活跃显示服务以及内存节省估算必须来自、或最新的运行结果。如果某个值不可用,请说明未知,不要猜测。以下节省数值为上限;实际差值以审计前后的报告为准。
jetson-diagnostic/scripts/detect_jetson.shaudit.jsonjetson-memory-auditPrerequisites
前提条件
- Start from a current JSON snapshot.
jetson-memory-audit - Confirm the user does not need the local desktop, display output, kiosk UI, or X/Wayland session.
- Mutating changes require and explicit user approval; dry-run first unless approval was already given in the same prompt.
sudo - Run on the Jetson host or in a host-visible sandbox with access to systemd state.
- 从最新的JSON快照开始。
jetson-memory-audit - 确认用户不需要本地桌面、显示输出、信息亭UI或X/Wayland会话。
- 变更操作需要权限和用户明确批准;除非在同一提示中已获得批准,否则先执行试运行。
sudo - 在Jetson主机或可访问systemd状态的主机可见沙箱中运行。
Available Scripts
可用脚本
| Script | Purpose | Arguments |
|---|---|---|
| Reads a memory audit JSON and emits a plan containing safe, reversible recommendations. | |
| Prints or applies the safe commands from a plan JSON. Dry-run by default. | |
If your agent runtime supports , use it to run and and summarize the returned output. Otherwise run the scripts with from the repository root.
run_scriptscripts/plan.shscripts/apply.shbash| 脚本 | 用途 | 参数 |
|---|---|---|
| 读取内存审计JSON并输出包含安全、可逆建议的方案。 | |
| 打印或应用方案JSON中的安全命令。默认处于试运行模式。 | |
如果你的Agent运行时支持,请使用它来运行和并总结返回的输出。否则,从仓库根目录使用运行这些脚本。
run_scriptscripts/plan.shscripts/apply.shbashInstructions
操作步骤
- Run to read
scripts/plan.sh(fromaudit.json) and emit a plan with onlyjetson-memory-auditknobs (target switch, display managers, audio, print, modem, etc.).safety: safe - Show the plan to the user and confirm.
- Run for a dry run. Re-run with
scripts/apply.sh --plan plan.jsonto execute. Add--applyto flush the page cache afterward, or--drop-cachesto take effect immediately.--reboot - Re-run to verify the actual delta.
jetson-memory-audit/scripts/audit.sh
- 运行读取
scripts/plan.sh(来自audit.json),输出仅包含jetson-memory-audit配置项的方案(目标切换、显示管理器、音频、打印、调制解调器等)。safety: safe - 将方案展示给用户并确认。
- 运行进行试运行。添加
scripts/apply.sh --plan plan.json参数重新运行以执行变更。可添加--apply参数在之后刷新页缓存,或添加--drop-caches参数使变更立即生效。--reboot - 重新运行以验证实际内存差值。
jetson-memory-audit/scripts/audit.sh
Expected workflow
预期工作流程
Use the scripts for estimates and application so recommendations are based on the current device state rather than the static upper-bound table alone.
- For "what would headless save", "estimate", "plan", or production planning prompts, run and report
scripts/plan.sh --audit <audit.json>, the topestimated_total_savings_mb, and whether any display manager orrecommendations[*].knobis active. Do not rungraphical.target.apply.sh - For prompts where the user explicitly says to apply headless mode now, run once as a dry run first. If the user has already approved mutation in the same prompt, re-run the same command with
scripts/apply.sh --plan <plan.json>and mention the reversible command(s).--apply - If direct execution fails in an agent runtime, invoke scripts with . Do not try to
bash {baseDir}/scripts/<script-name> ...installed skill files.chmod
使用脚本进行估算和应用,确保建议基于当前设备状态,而非仅依赖静态上限表格。
- 对于“无头模式能节省多少内存”、“估算”、“规划”或生产规划类请求,运行并报告
scripts/plan.sh --audit <audit.json>、排名靠前的estimated_total_savings_mb,以及是否有任何显示管理器或recommendations[*].knob处于活跃状态。请勿运行graphical.target。apply.sh - 对于用户明确要求立即应用无头模式的请求,先运行进行试运行。如果用户已在同一提示中批准变更,则添加
scripts/apply.sh --plan <plan.json>参数重新运行相同命令,并提及可逆命令。--apply - 如果在Agent运行时中直接执行失败,请使用调用脚本。不要尝试修改已安装技能文件的
bash {baseDir}/scripts/<script-name> ...权限。chmod
Plan / apply contract
规划/应用约定
- emits the same JSON shape as
plan.sh: an array ofjetson-inference-mem-tune/scripts/recommend.pywithrecommendations.{layer, knob, estimated_savings_mb, safety, command, reversible_command, rationale} - filters entries to
apply.shwith a non-emptysafety == "safe", then re-checks the filtered safety marker in the shell loop before execution. Anything else, such as kernel command-line changes, device-tree changes, or accuracy tradeoffs, is out of scope for this skill.command - Default mode is dry-run. is required to mutate the system.
--apply
- 输出的JSON格式与
plan.sh一致:一个包含jetson-inference-mem-tune/scripts/recommend.py的数组,每个元素包含recommendations。{layer, knob, estimated_savings_mb, safety, command, reversible_command, rationale} - 会筛选出
apply.sh且safety == "safe"非空的条目,然后在shell循环中再次检查筛选后的安全标记,之后才执行。其他操作(如内核命令行更改、设备树更改或精度权衡)不属于本技能的范围。command - 默认模式为试运行。必须添加参数才能修改系统。
--apply
Knobs covered
涵盖的配置项
| Knob | Action | Estimated savings | Reversible? |
|---|---|---|---|
| | up to 865 MB | yes |
| | ~200 MB / svc | yes |
| disable audio daemon | ~8 MB | yes |
| disable Bluetooth stack | ~6 MB | yes |
| disable WWAN manager | ~4 MB | yes |
| disable print stack | ~5 / ~3 MB | yes |
| disable Snap daemon | ~30 MB | yes |
| disable crash reporters | ~4 / ~2 MB | yes |
| disable mDNS | ~3 MB | yes |
| disable background package work | ~6 / ~8 MB | yes |
| 配置项 | 操作 | 估算节省内存 | 是否可逆 |
|---|---|---|---|
| 执行 | 最高865 MB | 是 |
| 执行 | 每个服务约200 MB | 是 |
| 禁用音频守护进程 | 约8 MB | 是 |
| 禁用蓝牙栈 | 约6 MB | 是 |
| 禁用WWAN管理器 | 约4 MB | 是 |
| 禁用打印栈 | 约5 / 约3 MB | 是 |
| 禁用Snap守护进程 | 约30 MB | 是 |
| 禁用崩溃报告器 | 约4 / 约2 MB | 是 |
| 禁用mDNS | 约3 MB | 是 |
| 禁用后台包管理工作 | 约6 / 约8 MB | 是 |
Do NOT disable these services
请勿禁用以下服务
- — required for any libargus camera pipeline.
nvargus-daemon - — serial console; disabling can lock you out of recovery.
nvgetty.service - — power-mode service; required for clock/power tuning.
nvpmodel - /
containerd— leave on if you run containers (most inference workloads do).docker - /
nvfb-related kernel services — tied to boot-time display configuration, so this skill does not change them.nvdisplay
- — 任何libargus相机管线都需要该服务。
nvargus-daemon - — 串行控制台;禁用可能导致无法进入恢复模式。
nvgetty.service - — 电源模式服务;时钟/电源调优需要该服务。
nvpmodel - /
containerd— 如果运行容器(大多数推理工作负载都会运行),请保持启用。docker - /
nvfb相关内核服务 — 与启动时的显示配置绑定,因此本技能不会更改这些服务。nvdisplay
Safety
安全性
- Does not edit , the device tree, or boot-time memory reservations.
/boot/extlinux/extlinux.conf - Does not disable services it does not have an explicit entry for (no blanket "disable everything not whitelisted").
- Every applied change has a documented . Re-running the plan with the reverts is sufficient to restore.
reversible_command - Dry-run by default. is the only way to mutate.
--apply - Report only device facts and savings figures that came from live detection or audit output.
- 不会编辑、设备树或启动时的内存预留。
/boot/extlinux/extlinux.conf - 不会禁用没有明确条目的服务(不会采用“禁用所有未列入白名单的服务”的一刀切方式)。
- 每个应用的更改都有文档记录的。重新运行包含恢复操作的方案即可恢复原状。
reversible_command - 默认处于试运行模式。只有添加参数才能修改系统。
--apply - 仅报告来自实时检测或审计输出的设备事实和内存节省数据。
Cross-platform behavior
跨平台行为
The same set of knobs applies to every Jetson family in the matrix above. The script reads / / from (and still exports legacy ) so the agent can attribute the savings correctly in its summary, but it does not branch on product line.
JETSON_GENERATIONJETSON_PRODUCT_LINEJETSON_VARIANTjetson-diagnostic/scripts/detect_jetson.shJETSON_SKU上述配置项适用于所有Jetson系列。脚本从读取//(仍会导出旧版),以便Agent在总结中正确归因内存节省量,但不会按产品线分支处理。",
jetson-diagnostic/scripts/detect_jetson.shJETSON_GENERATIONJETSON_PRODUCT_LINEJETSON_VARIANTJETSON_SKU