Skip to content

_read_temp: fall back to hwmon k10temp when thermal_zone0 is absent — max_temp_c is inert on the whole production fleet #208

Description

@VijitSingh97

Why

_read_temp reads /sys/class/thermal/thermal_zone0/temp (with the env-only THERMAL_ZONE override). Surveyed 2026-07-10: none of the 8 production rigs has any /sys/class/thermal/thermal_zone* — on both the 7800X3D and the EPYC 7642s, CPU temperature is exposed only through hwmon (k10temp: 72°C on miner-0, 89–92°C Tctl on the loaded EPYCs). Consequence: the #139 watchdog's max_temp_c cutoff is inert fleet-wide (unreadable temp skips thermal — correct fail-safe, but the feature can't be used at all), and tune's hashrate-per-watt temperature sampling (#54) is equally blind on these boards. THERMAL_ZONE can't rescue the watchdog: the timer unit bakes no env, deliberately.

Scope

  • _read_temp fallback chain: TUNE_TEMP_CMD (unchanged, test override) → THERMAL_ZONE/thermal_zone0 (unchanged) → first hwmon whose name is k10temp (AMD) or coretemp (Intel), reading temp1_input (same millidegree format, so the awk conversion is shared). Still best-effort: all absent → empty, thermal logic skips, exactly today's behavior.
  • Docs (configuration.md max_temp_c row + operations.md watchdog section): name the fallback and add the Tctl caveat — k10temp on EPYC reports Tctl, a control temperature that can sit well above ambient-style expectations (the loaded 7642s idle-of-nothing at ~90 Tctl); operators must check the live reading before choosing a cutoff, which the existing "check what your board reports" guidance already implies.
  • Tests: stubbed hwmon tree (right name → read, wrong-name-first → keeps scanning, none → empty); watchdog + tune paths pick it up for free since both call _read_temp.

Acceptance criteria

  • On a machine with no thermal_zone but a k10temp hwmon, _read_temp returns the k10temp value; watchdog's max_temp_c becomes functional there.
  • No thermal source at all still returns empty (thermal skipped, miner never stopped by a missing sensor).
  • Docs carry the Tctl caveat. make lint + make test green (bash 3.2 + Linux).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsetuprigforge.sh, config.json, first-run setup

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions