Minisforum MS-01 — enabling voltage and fan metrics (Nuvoton NCT6798D)

By default, on Proxmox kernel 6.8.12-15-pve, only CPU/NVMe temperatures are available. sensors-detect —auto finds only coretemp, no Super I/O support. The hardware (Nuvoton NCT6798D) requires the NCT6775 driver, which is not included in this kernel build.

Driver patching and installation

  1. Install build tools and kernel headers
sudo apt update
sudo apt install build-essential
sudo apt install proxmox-headers-$(uname -r)
Preparing to unpack .../proxmox-headers-6.8.12-15-pve_6.8.12-15_amd64.deb ...
Unpacking proxmox-headers-6.8.12-15-pve (6.8.12-15) ...
Setting up proxmox-headers-6.8.12-15-pve (6.8.12-15) ...
  1. Download the NCT6775 driver

⚠️ Do not use the abandoned killghost fork.
Instead, use the damix1/nct6775 repo, which can be patched for newer chips.

git clone https://github.com/damix1/nct6775.git /root/nct6775
cd /root/nct6775
  1. Patch for Nuvoton NCT6798D support

Edit nct6775.c. Extend the enum:

enum kinds { nct6106, nct6775, nct6776, nct6779,
             nct6791, nct6792, nct6793, nct6795,
             nct6796, nct6798 };

Add names:

static const char * const nct6775_device_names[] = {
    "nct6106", "nct6775", "nct6776", "nct6779",
    "nct6791", "nct6792", "nct6793", "nct6795",
    "nct6796", "nct6798",
};

static const char * const nct6775_sio_names[] __initconst = {
    "NCT6106D", "NCT6775F", "NCT6776D/F", "NCT6779D",
    "NCT6791D", "NCT6792D", "NCT6793D", "NCT6795D",
    "NCT6796D", "NCT6798D",
};

Add detection case:

switch (val & SIO_ID_MASK) {
    ...
    case 0xd42:   /* NCT6798D */
        sio_data->kind = nct6798;
        break;
}

This minimal patch makes the driver recognize NCT6798D.

  1. Build and install
make clean
make
CC [M]  /root/nct6775/nct6775.o
/root/nct6775/nct6775.c: In function 'is_word_sized':
/root/nct6775/nct6775.c:1335:9: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 1335 |         switch (data->kind) {
      |         ^~~~~~
/root/nct6775/nct6775.c: In function 'nct6775_update_pwm_limits':
/root/nct6775/nct6775.c:1706:17: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 1706 |                 switch (data->kind) {
      |                 ^~~~~~
/root/nct6775/nct6775.c: In function 'store_auto_pwm':
/root/nct6775/nct6775.c:3137:17: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 3137 |                 switch (data->kind) {
      |                 ^~~~~~
/root/nct6775/nct6775.c: In function 'nct6775_probe':
/root/nct6775/nct6775.c:4322:9: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 4322 |         switch (data->kind) {
      |         ^~~~~~
/root/nct6775/nct6775.c:4355:17: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 4355 |                 switch (data->kind) {
      |                 ^~~~~~
/root/nct6775/nct6775.c: In function 'pwm_update_registers':
/root/nct6775/nct6775.c:2633:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
 2633 |                 nct6775_write_value(data, data->REG_TARGET[nr],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2634 |                                     data->target_temp[nr]);
      |                                     ~~~~~~~~~~~~~~~~~~~~~~
/root/nct6775/nct6775.c:2636:9: note: here
 2636 |         default:
      |         ^~~~~~~
  MODPOST /root/nct6775/Module.symvers
  CC [M]  /root/nct6775/nct6775.mod.o
  LD [M]  /root/nct6775/nct6775.ko
  BTF [M] /root/nct6775/nct6775.ko
Skipping BTF generation for /root/nct6775/nct6775.ko due to unavailability of vmlinux

Then:

make install
cp nct6775.ko /lib/modules/6.8.12-15-pve/kernel/drivers/hwmon
depmod -a -F /boot/System.map-6.8.12-15-pve 6.8.12-15-pve

It copies nct6775.ko into hwmon/ so the kernel can autoload it.

Then:

depmod -a
modprobe nct6775
  1. After loading the module, verify with sensors
nct6798-isa-0a20
Adapter: ISA adapter
in0:                   400.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                     3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                     3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                     1.09 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                   152.00 mV (min =  +0.00 V, max =  +0.00 V)
in6:                   136.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                     3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                     3.14 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                     1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                  160.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                  128.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                  1000.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                  152.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                    1.27 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                  2205 RPM  (min =    0 RPM)
fan2:                  1732 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
fan7:                     0 RPM  (min =    0 RPM)
...
  1. Add the driver to /etc/modules so it loads automatically on reboot
echo nct6775 | tee -a /etc/modules
  1. Regenerate the initramfs images
update-initramfs -u -k all

Handling secure boot (if enabled)

Unsigned modules will fail with modprobe: ERROR: could not insert ’nct6775’: Key was rejected by service.

  1. Generate your own MOK key
openssl req -new -x509 -newkey rsa:2048 \
  -keyout /root/MOK.priv -outform DER -out /root/MOK.der \
  -nodes -days 36500 -subj "/CN=MyKernelModule/"
  1. Sign the module
/usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \
  /root/MOK.priv /root/MOK.der \
  /lib/modules/$(uname -r)/kernel/drivers/hwmon/nct6775.ko
  1. Import the key and reboot
mokutil --import /root/MOK.der
reboot

⚠️ On reboot the blue MOK Manager screen will appear → Enroll MOK → Continue → enter password.

  1. Validation
modinfo nct6775 | grep signer
signer: MyKernelModule

Post scriptum

Node Exporter (should be runned with —collector.hwmon) will expose new metrics as:

node_hwmon_in_volts{chip="nct6798-isa-0a20",sensor="in1"}
node_hwmon_fan_rpm{chip="nct6798-isa-0a20",sensor="fan1"}

Grafana hwmon dashboard should catch these metrics automatically.

Отправить
Поделиться