Skip to content

fix(doctor): count RAM channels from Locator so EPYC isn't mis-flagged single-channel#108

Merged
VijitSingh97 merged 1 commit into
mainfrom
claude/adoring-leavitt-8c7ab5
Jun 12, 2026
Merged

fix(doctor): count RAM channels from Locator so EPYC isn't mis-flagged single-channel#108
VijitSingh97 merged 1 commit into
mainfrom
claude/adoring-leavitt-8c7ab5

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

Problem

On a fully-populated 8-channel EPYC 7642 (8 DIMMs, one per channel — the optimal layout), doctor printed a false warning:

! RAM is single-channel (8 module(s), 1 channel) — RandomX wants ≥2 channels...

The board is genuinely 8-channel: it sustains ~36,880 H/s on RandomX (single-channel would be far lower), and exposes one Locator per channel.

Root cause

_mem_summary() counted memory channels as the number of distinct Bank Locator values from dmidecode -t memory. Desktop boards encode the channel there (BANK 0/P0 CHANNEL A), so the heuristic works. But server boards (EPYC/Threadripper) repeat one Bank Locator: BANK 0 for every DIMM and instead carry the channel in the Locator field's letter group:

Locator: DIMM_P0_A0   ... DIMM_P0_H0   (channels A..H)
Bank Locator: BANK 0  (same for all 8)

So the count collapsed to 1.

Fix

_mem_summary now counts distinct channels in both fields and reports whichever is larger:

  • New /^[ \t]*Locator:/ awk rule (anchored so it doesn't also match Bank Locator:) extracts the channel designator via match(v,/[A-Za-z][0-9]+$/) — the letter immediately before the trailing slot number (DIMM_P0_A0A, DIMM A1A), upper-cased into a separate set.
  • At END, channels = max(bank-locator channels, locator channels).

Taking the max keeps existing desktop dual-channel detection intact (Bank Locator path untouched) and can only raise the count toward truth — a genuine single-channel layout still reads as 1, since its populated DIMMs share one channel letter.

Tests (dependency-free, in tests/run.sh)

  • EPYC fixture — 8 × DIMM_P0_[A-H]0, all Bank Locator: BANK 0 → asserts 8 modules across 8 channels and no single-channel warning.
  • Desktop-Locator fixture — channel carried only in the Locator (DIMM A1/DIMM B1, shared BANK 0) → asserts 2 channels / no warning, proving the Locator path works independently of Bank Locator.
  • Existing single-channel and dual-channel Bank Locator tests unchanged and still pass.

Verification

  • make lint (shellcheck + shfmt -i 4): clean
  • make test-suite: 602 passed, 0 failed

🤖 Generated with Claude Code

…d single-channel (#108)

doctor's RAM check counted memory channels by distinct `Bank Locator`
values from `dmidecode -t memory`. Desktop boards encode the channel
there, but server boards (EPYC/Threadripper) repeat one `BANK 0` for
every DIMM and instead carry the channel in the `Locator` letter group
(`DIMM_P0_A0`..`DIMM_P0_H0` = channels A..H). So a fully-populated
8-channel EPYC 7642 collapsed to 1 channel and printed a false
"RAM is single-channel" warning despite sustaining ~36,880 H/s.

_mem_summary now counts distinct channels in BOTH fields and reports
the larger: a new `Locator:` rule (anchored so it doesn't also match
`Bank Locator:`) extracts the channel letter immediately before the
trailing slot number. Taking the max keeps existing desktop dual-channel
detection intact and can only raise the count toward truth — a genuine
single-channel layout still reads as 1 (its DIMMs share one channel
letter).

Tests: dependency-free dmidecode fixtures for an 8-channel EPYC (8 ×
`DIMM_P0_[A-H]0`, all `BANK 0`) asserting 8 channels / no warning, plus
a desktop board carrying the channel only in the Locator (`DIMM A1`/
`DIMM B1`). Existing single/dual-channel Bank Locator tests unchanged.
`make lint` and `make test-suite` (602 passed) stay green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VijitSingh97 VijitSingh97 merged commit 5ee0951 into main Jun 12, 2026
5 checks passed
@VijitSingh97 VijitSingh97 deleted the claude/adoring-leavitt-8c7ab5 branch June 12, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant