Bookmarks

ECC — error-correcting code memory

A type of RAM where check bits are added to the data: the controller corrects single-bit errors on the fly, while double-bit errors are only detected and reported to the system.

Also: ECC memory, error-correcting code, error correction code

checked 9 Nov

All terms

Bits in memory do get corrupted: because of cosmic particles and chip ageing, a one is read back as a zero and vice versa. In ordinary memory the fault passes unnoticed, while in ECC memory the controller recalculates the check bits on every access, corrects single-bit errors and logs double-bit errors — the program gets its data undamaged and the system knows about every error.

How it works

Each memory word carries bits computed with a Hamming code (SECDED) — in the classic DDR4 scheme that is 8 check bits per 64 bits of data. DDR5 splits the bus into two 32-bit subchannels, each with its own 8 check bits. From the resulting code bits the controller tells whether there is an error and in which bit.

ErrorsWhat happensFlag
0the data is correctCE counter does not grow
1corrected on the fly, the counter growscorrectable error, CE
2detected but not correcteduncorrectable error, UCE

Where it is used

ECC is used where a silent bit flip costs more than the extra bits on the bus: in servers, workstations and data-centre GPUs with HBM and GDDR. Ordinary desktop modules omit ECC to save cost.

  • Server memory: DDR5 RDIMM and LRDIMM modules are built with ECC.
  • GPUs: HBM on data-centre cards always comes with ECC; on GDDR cards ECC is enabled by a driver setting and requires a reboot.

How to calculate

The usable capacity of a module is smaller than its physical capacity: the check bits are stored in separate chips.

bash
# ECC DDR4: 72 bits versus 64 — overhead = 8 / 64 = 12.5%# ECC DDR5: two 32+8 subchannels — now 16 check bits per 64 bits of data

A diagnostics example on a GPU

bashon the host
nvidia-smi -q -d ECCnvidia-smi -q -d ROW_REMAPPER

The counters are tracked on two timescales: volatile counts from the last driver load, aggregate counts over the whole life of the card. A rising UCE count is a reason to reboot the node (on a GPU this resets the card), and if the errors keep coming back, the module or the card should be replaced.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • BMCserver management controller

    A BMC is a server management controller: it monitors the board and the power supply but does not correct memory bits; that is the job of the ECC controller.

In depth in the references

where the topic is covered in detail