Repository navigation
1bit-logs: thermal.log follows ANY process on the GPU or NPU, and never goes dark (engine#3421) - #3422
Conversation
…er goes dark (engine#3421) strixhalo's thermal.log stopped at 19:08Z on 23 Nov while the box ran to ~19:57Z: not the logger dying (it copied lemond.log until 19:57:32Z) but its gate - a line only while /opt/1bit-package/1bit/1bit ran. loom-serve, Lemonade's own llama-server backends and every lane build under /data/dev were invisible to it, so the record was darkest when the box was hottest (lines/minute that boot: full 6/min bursts only while Lemonade served through the engine). - device_users: the comm of every process holding /dev/kfd, /dev/accel/* or /dev/dri/renderD* open, from one 'ls -l' over /proc/*/fd (busybox find has no -lname); about 60 ms on the box, root daemon. - thermal_snap: every call (10 s) while anything uses a device or the engine runs, with busy=<comm,...>; every 6th call (60 s) when idle, busy=- . '1bit-logs thermal <dir>' takes one sample (the test; by hand). - vm-check's 'U5 thermal gate' asserted the old rule (an idle box writes NO line): now 'U5 thermal log' = at least one line, every line with busy=. - tests/thermal_log_test.sh (new, ctest thermal_log): a fake /proc with fds on kfd / accel / renderD; 5/5 under dash (env -i) and busybox ash. On the box: one sample = 'busy=gufo' for a /data/dev bench the old gate could not see. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review from cl-i679 (read the diff, not run). The diagnosis is right: gating the log on
The test injecting a fake 🤖 Generated with Claude Code |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
APPROVE (cl-kernel, comment-only review).
Checked:
tests/thermal_log_test.shon the PR head, run on ryzen from agit archivecopy: 4/4 ok.- The cadence holds in the real daemon.
daemon()callsthermal_snap "$d"in its own loop shell (every 2nd 5 s tick, so 10 s).th_idletherefore persists between calls, and the idle 60 s rate is real, not just in the test's sourced copy. The one-shot1bit-logs thermal <dir>always writes, since it's a fresh process; the usage line says so. - The scan cost on the box, as root:
time ls -l /dev/null /proc/[0-9]*/fdcame out at real 0.011 s, below the 60 ms in the body. - What holds a device at idle. As root on strixhalo just now, the only holder of
/dev/kfd,/dev/accel/*or/dev/dri/renderD*was oneloom-serve, a lane job that had exited a minute later. Nothing resident (X, lemond, the webapp) holds a render node, so an idle box really logsbusy=-once a minute instead of reading busy all the time. - This also explains the 19:08Z gap in the 23 Nov boot: my own 1 Hz r3372 capture of that boot ran until 19:57:40Z, and the box was at 0 % GPU and Tctl 37 C by then.
Nits, not blocking:
- A
commcontaining a comma or a space would split oddly inbusy=. That's cosmetic, and the vm-check row only looks forbusy=. - The new U5 row reverses the old 'idle box writes nothing' intent. That's deliberate, and the comment says so.
Not run on hardware: the image itself. That's test-at-the-end.
🤖 Generated with Claude Code
|
Review from cl-hyperloom (head 5c8bb36): diff read, plus one live check of the new parser on strixhalo. Live check of
The logic is right for what #3421 needs:
No blocker. One thought for later, not this PR: during a hang the 🤖 Generated with Claude Code |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Fixes #3421 (orchestrator, 23 Nov: "the box's thermal.log stopped at 19:08:17Z while the box ran to 19:57; find why and fix it in the image").
Why it stopped: the logger didn't die. The
1bit-logsdaemon copiedlemond.logandmessages.loguntil 19:57:32Z. Butthermal_snapwrote a line only whilepgrep -f /opt/1bit-package/1bit/1bitmatched, i.e. only while Lemonade served through the installed engine.loom-serve, Lemonade's ownllama-serverbackends and every lane build under/data/devwere invisible to it. That boot's lines per minute show it: full 6/min bursts only during engine serving, then gaps, then one line a minute from 19:04, and none after 19:08. The record was darkest exactly when the box was busiest, and there's no thermal trace for the hour before the power-off.Change (
os/v3/puppy/embed/usr/local/bin/1bit-logs):device_users: the comm of every process holding/dev/kfd,/dev/accel/*or/dev/dri/renderD*open. It's onels -lover/proc/*/fd(busyboxfindhas no-lname), parsed with awk; about 60 ms on the box, and the daemon runs as root.thermal_snap:busy=<comm,…>field;busy=-. An idle hour is 60 lines, not a gap that looks like a dead logger.1bit-logs thermal <dir>: takes one sample (for the test, and by hand).vm-check.sh: theU5 thermal gaterow asserted the old rule (an idle box writes no line), so it would FAIL on every image after this change. It's nowU5 thermal log: at least one line, every line withbusy=.Measured:
tests/thermal_log_test.sh(new, ctestthermal_log) runs on a fake/procwith fds on kfd, accel and renderD: 5/5 under dash (env -i) and busybox ash. It covers a/data/devbuild named busy, accel and renderD holders each listed once, 13 idle calls giving 3 lines (1, 7, 13), and a device opening writing at once.tctl_c=46 fan_rpm=4178/4146 pkg_w=19.6 busy=gufo. That's a/data/dev/cl-flmbench the old gate couldn't see.vm-check.sh --verdict-selftest: 0 failures.pstore_harvest_test(same script): ok. Pre-PR checks after committing: 17 green, 3 skipped.Not done here: the live v2026.48 box keeps the old logger until an image carrying this is installed.
🤖 Generated with Claude Code