Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't show ssd nvme (udisk2) temperature sensor #129

Closed
maravento opened this issue Dec 22, 2022 · 19 comments
Closed

Doesn't show ssd nvme (udisk2) temperature sensor #129

maravento opened this issue Dec 22, 2022 · 19 comments

Comments

@maravento
Copy link

maravento commented Dec 22, 2022

Expected behaviour

  1. show ssd nvme pcie m.2 (udisk2) temperature sensor
  2. show correct temperature of ssd sata3

Actual behaviour

Doesn't show ssd nvme pcie m.2 (udisk2) temperature sensor

Captura de pantalla -2022-12-22 13-15-58


sudo inxi -xD
  ID-1: /dev/nvme0n1 vendor: Kingston model: SNV2S500G size: 465.76 GiB
    temp: 26.9 C

sudo nvme smart-log /dev/nvme0 | grep '^temperature'
temperature				: 27 C (300 Kelvin)

On another computer with Ubuntu Mate 22.04.1 and sata3 ssd disk

Captura de pantalla -2022-12-22 18-52-18

these data of the temperature of a SATA SSD are incorrect. it says 100 degrees celsius all time, and crystaldiskinfo (win) and hddtemp, inxi (linux) says 24°C.

sudo inxi -xD
ID-2: /dev/sda vendor: Kingston model: SA400S37480G size: 447.13 GiB
    temp: 24.0 C

sudo hddtemp /dev/sda
/dev/sda: KINGSTON SA400S37480G: 24°C

Related link: https://bugs.launchpad.net/ubuntu/+source/libatasmart/+bug/1581594

MATE general version

1.26.0

Linux Distribution

Ubuntu Mate 22.04.1

@maravento maravento changed the title Doesn't show udisk temperature sensor Doesn't show ssd nvme (udisk2) temperature sensor Dec 22, 2022
@N0rbert
Copy link

N0rbert commented Aug 5, 2023

Confirmed on Debian 11 with mate-sensors-applet 1.24.1-1. It does not show the temperature of my NVME SSD.
My device has only one NVME disk, so I proceed with the following.
I found the following workaround - I have added Command applet to MATE Panel and placed the following command

bash -c "inxi -xD -c0 | grep 'temp.*' --only-matching | tail -n1 | sed 's/temp:/🖴/' | sed 's/C/°C/'"

into Command field. Note: inxi 3.3.26 from bullseye-backports is needed to avoid sudo.

@lukefromdc
Copy link
Member

lukefromdc commented Aug 5, 2023

If the problem is in libatasmart there's nothing we can do about it here. That said, the issue report at Rupan/libatasmart#9 says it could fix this and similar problems in several other packages

@maravento
Copy link
Author

maravento commented Aug 5, 2023

If the problem is in libatasmart there's nothing we can do about it here. That said, the issue report at Rupan/libatasmart#9 says it could fix this and similar problems in several other packages

I don't think so. this problem has been unresolved for years. was reported on 2016-05-13 with no solution until today https://bugs.launchpad.net/ubuntu/+source/libatasmart/+bug/1581594

@lukefromdc
Copy link
Member

If they won't fix it, we cannot fix it for them unless someone want to reimplement their work or find a way to bypass it. I don't know enough about reading the sensors to implement such a workaround myself. Looks like libatasmart in turn is choking on a problem in udisks2.

Anyone able to code a fix should submit it as a PR to libatasmart instead of waiting for them to fix it. As a DE with a small team, we don't have the peoplepower to fork things like libatasmart much less udisks2 over this.

I get these errors in the output of running sensors , no idea what the actual temperature of that device sitting at idle is. Wonder if libatasmart is erroring out on not being able to see that minimum temperature rather than ignoring it and moving on?

nvme-pci-0100
Adapter: PCI adapter
ERROR: Can't get value of subfeature temp1_min: I/O error
Composite: +47.9°C (low = +0.0°C, high = +99.8°C)
(crit = +119.8°C)
ERROR: Can't get value of subfeature temp2_min: I/O error
Sensor 1: +47.9°C (low = +0.0°C, high = +65261.8°C)

@maravento
Copy link
Author

libatasmart

check this alternative storaged-project/udisks#433

@N0rbert
Copy link

N0rbert commented Aug 5, 2023

If we talk about inxi -Dx (version 3.3.01-1-1) - it uses nvme smart-log /dev/nvme0n1 under the hood to get disk info (including its temperature). Another way to get NVME temperature is smartctl -a /dev/nvme0n1.
So actually mate-sensors-applet may need new plugin for NVME.

I have also reported storaged-project/udisks#1163 to udisks2 about temperature of NVME drives. Udisks2 does not read temperature of NVME drive, so it seems that udisks2-plugin.c of mate-sensors-applet works correctly (there is no data = nothing to show).
Update 20230806: the above bug in Udisks is already fixed and updated udisks is available in Debian trixie/sid, it shows temperature for NVME drives by udisksctl.

@N0rbert
Copy link

N0rbert commented Aug 6, 2023

I have digged a bit deeper and now I see the following on my Debian 11:
NVME temperature(s) may be obtained from libsensors plugin.
For example the below output from lm-sensors:

$ sensors
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +30.0°C  

nvme-pci-0100
Adapter: PCI adapter
Composite:    +28.9°C  (low  = -273.1°C, high = +81.8°C)
                       (crit = +84.8°C)
Sensor 1:     +28.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +29.9°C  (low  = -273.1°C, high = +65261.8°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +35.0°C  (crit = +100.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +32.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +30.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +32.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +30.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +31.0°C  (high = +100.0°C, crit = +100.0°C)

BAT1-acpi-0
Adapter: ACPI interface
in0:          11.02 V  
curr1:       799.00 mA 

means that user can view NVME temperature as Composite without any additional coding and so on:

nvme-as-composite

I see this behavior on one modern 11th intel laptop and two desktops (11th intel and AMD Ryzen 5700G).

@maravento
Copy link
Author

maravento commented Aug 6, 2023

Great. I guess since these values are constantly changing and the refresh rate of "composite" is not every second, I think your solution works.

Captura de pantalla -2023-08-06 11-26-33

But this solution only applies to NVMe SSDs (not SATA SSDs). That's why I have to use this script, so that it alerts if the temperature rises above the value that I set (variable degrees=50) (program it in cron). Tested in Ubuntu 22.04

https://raw.githubusercontent.com/maravento/vault/master/scripts/bash/disktemp.sh

@raveit65
Copy link
Member

raveit65 commented Aug 6, 2023

No idea what composite means. I think sensor 1 or 2 are valid and i use sensor 2 for displaying the temp in sensor-applet.
Can we close the issue?

@raveit65
Copy link
Member

raveit65 commented Aug 6, 2023

Btw. sata disk temps are displayed with udisk2 in applet since more than many years.

@tbzatek
Copy link

tbzatek commented Aug 7, 2023

No idea what composite means. I think sensor 1 or 2 are valid and i use sensor 2 for displaying the temp in sensor-applet. Can we close the issue?

Composite means kind of average of multiple sensors on the drive, if any. UDisks provides this value as the primary org.freedesktop.UDisks2.NVMe.Controller.SmartTemperature property: http://storaged.org/doc/udisks2-api/latest/gdbus-org.freedesktop.UDisks2.NVMe.Controller.html#gdbus-property-org-freedesktop-UDisks2-NVMe-Controller.SmartTemperature

@maravento
Copy link
Author

Btw. sata disk temps are displayed with udisk2 in applet since more than many years.

And that is precisely why this issue is still open. Because the value provided by udisk2 does not correspond to reality and is always 98% or 100% with sata ssd.

@tbzatek
Copy link

tbzatek commented Aug 7, 2023

Btw. sata disk temps are displayed with udisk2 in applet since more than many years.

And that is precisely why this issue is still open. Because the value provided by udisk2 does not correspond to reality and is always 98% or 100% with sata ssd.

That's storaged-project/udisks#568 on a short-term TODO list.

@maravento
Copy link
Author

another bug reported in 2018 and we are in 2023 with no solution...

PS: If I knew what the solution is, I would have already pushed a pull request, but unfortunately I don't know how to fix it. That's why I posted a workaround bash script #129 (comment)

@raveit65
Copy link
Member

raveit65 commented Aug 7, 2023

Btw. sata disk temps are displayed with udisk2 in applet since more than many years.

And that is precisely why this issue is still open. Because the value provided by udisk2 does not correspond to reality and is always 98% or 100% with sata ssd.

Hmm,

  1. Report called Doesn't show ssd nvme (udisk2) temperature sensor and not someting with sata disk.
  2. Sadly, i can confirm that with a noname industrial ssd.
  3. With former Samsung SSD 850 PRO or Crucial Mx500 temp was always displayed correct many years.

So, it seems it is hardware specific.
Also sensor-applet is only a frontend for udisk2 or libsensors. IHMO it is an issue with udisk if your disk displays 100% temp

@tbzatek
Copy link

tbzatek commented Aug 7, 2023

another bug reported in 2018 and we are in 2023 with no solution...

That falls under the "Feel free to open a pull request" category since 2019: storaged-project/udisks#433 (comment)

So, it seems it is hardware specific. Also sensor-applet is only a frontend for udisk2 or libsensors. IHMO it is an issue with udisk if your disk displays 100% temp

Agree, the SATA SSD temperature will be fixed in UDisks and requires no change in mate-sensors-applet. The NVMe stuff is a new interface with slightly different value representation however.

@maravento
Copy link
Author

At least, as N0rbert says in #129 (comment). This is a great advance.

@raveit65
Copy link
Member

raveit65 commented Aug 7, 2023

good, closing.

@antoniovazquezblanco
Copy link

This has been fixed in an independent fork of the original lib that it is not currently recognized as official upstream by maintainers at https://github.com/libatasmart/libatasmart.

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

No branches or pull requests

6 participants