Which kmod is needed for reading nvme temps?

I am running a custom build on x86-64. I cannot seem to get the sensors to read the temp chip on my nvme SSD. I think I am missing a kernel module.

Under Arch Linux live image, I can read the sensor:

# sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +53.9°C  

nvme-pci-0100
Adapter: PCI adapter
Composite:    +48.9°C  (low  = -273.1°C, high = +82.8°C)
                       (crit = +84.8°C)

amdgpu-pci-0500
Adapter: PCI adapter
vddgfx:      631.00 mV 
vddnb:       781.00 mV 
edge:         +58.0°C  
PPT:           5.00 W  

Since it is named "nvme-pci-0100" I figured kmod-nvme would supply it (which I am building) but it does not.

Assuming our kmod-nvme is not what I need, can anyone take a guess what I do need to build?

Here is lsmod output again, under Arch Linux live image:

lsmod
Module                  Size  Used by
ext4                 1163264  1
crc32c_generic         16384  0
mbcache                16384  1 ext4
jbd2                  217088  1 ext4
qrtr                   57344  4
ccm                    20480  0
algif_aead             16384  0
cbc                    16384  0
des_generic            16384  0
libdes                 24576  1 des_generic
ecb                    16384  0
algif_skcipher         16384  0
cmac                   16384  0
md4                    16384  0
algif_hash             16384  0
af_alg                 36864  3 algif_hash,algif_skcipher,algif_aead
snd_acp3x_pdm_dma      16384  1
snd_acp3x_rn           16384  0
snd_soc_dmic           16384  1
snd_sof_amd_rembrandt    16384  0
snd_sof_amd_renoir     16384  0
snd_sof_amd_acp        57344  2 snd_sof_amd_rembrandt,snd_sof_amd_renoir
snd_sof_pci            24576  2 snd_sof_amd_rembrandt,snd_sof_amd_renoir
snd_sof_xtensa_dsp     20480  1 snd_sof_amd_acp
snd_sof               389120  2 snd_sof_amd_acp,snd_sof_pci
snd_sof_utils          20480  1 snd_sof
snd_soc_core          438272  4 snd_acp3x_rn,snd_sof,snd_soc_dmic,snd_acp3x_pdm_dma
snd_compress           32768  1 snd_soc_core
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      20480  1 snd_soc_core
wl                   6512640  0
intel_rapl_msr         20480  0
intel_rapl_common      36864  1 intel_rapl_msr
edac_mce_amd           57344  0
snd_pci_ps             20480  0
kvm_amd               204800  0
snd_rpl_pci_acp6x      20480  0
kvm                  1327104  1 kvm_amd
irqbypass              16384  1 kvm
snd_acp_pci            16384  0
mt7921e                36864  0
snd_usb_audio         442368  0
snd_hda_codec_hdmi     94208  1
snd_pci_acp6x          20480  0
mt7921_common         118784  1 mt7921e
mt76_connac_lib        86016  2 mt7921e,mt7921_common
mt76                  122880  3 mt7921e,mt7921_common,mt76_connac_lib
mac80211             1503232  3 mt76,mt7921_common,mt76_connac_lib
snd_hda_intel          65536  0
snd_usbmidi_lib        53248  1 snd_usb_audio
snd_rawmidi            53248  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
snd_intel_dspcfg       36864  2 snd_hda_intel,snd_sof
snd_intel_sdw_acpi     20480  1 snd_intel_dspcfg
snd_hda_codec         217088  2 snd_hda_codec_hdmi,snd_hda_intel
libarc4                16384  1 mac80211
snd_hda_core          139264  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
mc                     90112  1 snd_usb_audio
snd_hwdep              20480  2 snd_usb_audio,snd_hda_codec
snd_pcm               200704  14 snd_sof_amd_acp,snd_hda_codec_hdmi,snd_pci_acp6x,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_sof,snd_compress,snd_soc_core,snd_sof_utils,snd_hda_core,snd_acp3x_pdm_dma,snd_pci_ps,snd_pcm_dmaengine
snd_timer              53248  1 snd_pcm
crct10dif_pclmul       16384  1
snd                   151552  13 snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_sof,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
soundcore              16384  1 snd
btusb                  77824  0
snd_pci_acp5x          20480  0
polyval_clmulni        16384  0
btrtl                  28672  1 btusb
btbcm                  24576  1 btusb
btintel                57344  1 btusb
btmtk                  16384  1 btusb
polyval_generic        16384  1 polyval_clmulni
bluetooth            1085440  6 btrtl,btmtk,btintel,btbcm,btusb
snd_rn_pci_acp3x       24576  0
gf128mul               16384  1 polyval_generic
ecdh_generic           16384  1 bluetooth
crc16                  16384  2 bluetooth,ext4
snd_acp_config         16384  6 snd_rn_pci_acp3x,snd_pci_acp6x,snd_sof_amd_rembrandt,snd_acp_pci,snd_pci_ps,snd_sof_amd_renoir
snd_soc_acpi           16384  2 snd_sof_amd_acp,snd_acp_config
wmi_bmof               16384  0
sp5100_tco             20480  0
snd_pci_acp3x          20480  0
cfg80211             1286144  5 wl,mt76,mac80211,mt7921_common,mt76_connac_lib
ghash_clmulni_intel    16384  0
pcspkr                 16384  0
cm32181                16384  0
ccp                   151552  1 kvm_amd
rfkill                 40960  4 bluetooth,cfg80211
i2c_piix4              36864  0
i2c_hid_acpi           16384  0
amd_sfh                53248  0
i2c_hid                40960  1 i2c_hid_acpi
industrialio          126976  1 cm32181
k10temp                16384  0
rapl                   20480  0
mac_hid                16384  0
acpi_cpufreq           32768  0
pkcs8_key_parser       16384  0
fuse                  204800  1
dm_mod                225280  0
bpf_preload            24576  0
ip_tables              40960  0
x_tables               61440  1 ip_tables
overlay               204800  1
squashfs               98304  1
loop                   40960  2
isofs                  65536  0
cdrom                  86016  1 isofs
hid_cmedia             16384  0
uas                    36864  1
usbhid                 77824  0
usb_storage            86016  1 uas
amdgpu              11730944  0
drm_buddy              20480  1 amdgpu
gpu_sched              57344  1 amdgpu
r8169                 114688  0
i2c_algo_bit           20480  1 amdgpu
drm_ttm_helper         16384  1 amdgpu
realtek                40960  1
crc32_pclmul           16384  0
crc32c_intel           24576  2
sha512_ssse3           49152  0
aesni_intel           401408  0
ttm                   102400  2 amdgpu,drm_ttm_helper
mdio_devres            16384  1 r8169
nvme                   65536  1
crypto_simd            16384  1 aesni_intel
cryptd                 32768  2 crypto_simd,ghash_clmulni_intel
drm_display_helper    208896  1 amdgpu
video                  73728  1 amdgpu
nvme_core             237568  2 nvme
xhci_pci               24576  0
libphy                217088  3 r8169,mdio_devres,realtek
igc                   184320  0
cec                    86016  1 drm_display_helper
xhci_pci_renesas       24576  1 xhci_pci
nvme_common            24576  1 nvme_core
wmi                    45056  2 video,wmi_bmof

EDIT: I added these just now but still no output for nvme-pci-0100:

CONFIG_PACKAGE_kmod-ata-core=y
CONFIG_PACKAGE_kmod-hwmon-drivetemp=y
CONFIG_PACKAGE_kmod-pmbus-core=y
CONFIG_PACKAGE_kmod-i2c-piix4=y

Here is the output of sensors under OpenWRT:

# sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +40.6°C  

amdgpu-pci-0500
Adapter: PCI adapter
vddgfx:      643.00 mV 
vddnb:       743.00 mV 
edge:         +40.0°C  
slowPPT:     1000.00 uW 

Tried hddtemp or smartctl ?

Yes, smartctl works to read the temp but I would like sensors to do it as it does under Arch. Maybe our package for sensors is not configured properly?

Have a look at 5.3 at https://wiki.archlinux.org/title/lm_sensors, have you loaded drivetemp ?

And do you see
/sys/class/nvme/nvme0/device/hwmon/hwmon1/ ?

1 Like

Nice find. But still no luck:

# modprobe drivetemp
# lsmod | grep drive
drivetemp              16384  0 

# sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +45.5°C  

amdgpu-pci-0500
Adapter: PCI adapter
vddgfx:      643.00 mV 
vddnb:       743.00 mV 
edge:         +45.0°C  
slowPPT:     1000.00 uW 

I do not see that:

# find /sys -name 'hwmon*'
/sys/class/hwmon
/sys/class/hwmon/hwmon0
/sys/class/hwmon/hwmon1
/sys/devices/pci0000:00/0000:00:18.3/hwmon
/sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon0
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/hwmon
/sys/devices/pci0000:00/0000:00:08.1/0000:05:00.0/hwmon/hwmon1

Check if hwmon is another module you need to load.

# modprobe hwmon
failed to find a module named hwmon

This is all I see available to build:

You're on x86, just enable them all, see if it starts working, then remove them one by one.

1 Like

CONFIG_NVME_HWMON is not set in the kernel config: https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/x86/64/config-5.15;h=d972668e543fbc6767ab36a83ced50954f41fda2;hb=refs/heads/main#l337

And it is the same for the kmod-nvme package (but I guess that doesn't matter on x86-64, as it is built-in anyway): https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/kernel/linux/modules/block.mk;h=bdf84e8ae29b238f97aa84ffeb03ebffe7a07db6;hb=refs/heads/main#l504

2 Likes

@janh - you are a genius, thank you!

# sensors
amdgpu-pci-0500
Adapter: PCI adapter
vddgfx:      756.00 mV 
vddnb:       743.00 mV 
edge:         +46.0°C  
slowPPT:     1000.00 uW 

nvme-pci-0100
Adapter: PCI adapter
Composite:    +34.9°C  (low  = -273.1°C, high = +82.8°C)
                       (crit = +84.8°C)

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +49.9°C  
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.