rocm_smi_lib icon indicating copy to clipboard operation
rocm_smi_lib copied to clipboard

Temperature on 5700XT

Open strawbs1 opened this issue 6 years ago • 4 comments

I am calling rsmi_dev_temp_metric_get() with RSMI_TEMP_CURRENT

That then calls get_dev_mon_value with the following params: type: amd::smi::kMonTemp dv_ind: 1 sensor_ind: 1

The issue is that val_str = "" and the later stoi (line 397) causes the application to crash.

Do you know how I can modify this to support the 5700XT ?

strawbs1 avatar Nov 27 '19 16:11 strawbs1

Hi, It sounds like the contents of the sysfs file from which the temperature is being read may be not what is expected.

The device index may vary from run to run, but on my machine, the value being read looks like this:

$ cat /sys/class/drm/card0/device/hwmon/hwmon0/temp1_input 30000

This is for "card0" on my machine.It may be card1, card2,... on your machine. What do you see if you cat that (those) files?

On Wed, Nov 27, 2019 at 10:04 AM Sean [email protected] wrote:

I am calling rsmi_dev_temp_metric_get() with RSMI_TEMP_CURRENT

That then calls get_dev_mon_value with the following params: type: amd::smi::kMonTemp dv_ind: 1 sensor_ind: 1

The issue is that val_str = "" and the later stoi (line 397) causes the application to crash.

Do you know how I can modify this to support the 5700XT ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RadeonOpenCompute/rocm_smi_lib/issues/52?email_source=notifications&email_token=ADDTF2NUTJWHVGGFFX6DEEDQV2LAFA5CNFSM4JSI7ZOKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4OTRJA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDTF2LX7VT3TQ6G4XK7OLDQV2LAFANCNFSM4JSI7ZOA .

cfreehill avatar Nov 27 '19 17:11 cfreehill

Okay I didn't realize it used sys. I think maybe the Linux kernel I have doesn't support this card. temp1_input exists but when I try to cat it I get: "cat: temp1_input: Invalid argument"

I will update my setup and try again next week. Thanks

strawbs1 avatar Nov 28 '19 07:11 strawbs1

Also, I think the main issue for me is that stoi("") leads to rocm_smi to exit. But it would be helpful if it checked for a blank string and returned an error/fail rather than exiting.

strawbs1 avatar Nov 28 '19 14:11 strawbs1

Can you cat that file if you do it as root? It's weird that it says invalid argument. What are the permissions on that file?

On Thu, Nov 28, 2019 at 8:55 AM Sean [email protected] wrote:

Also, I think the main issue for me is that stoi("") leads to rocm_smi to exit. But it would be helpful if it checked for a blank string and returned an error/fail rather than exiting.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/RadeonOpenCompute/rocm_smi_lib/issues/52?email_source=notifications&email_token=ADDTF2NLZZSOAFSWCMIWZW3QV7LVTA5CNFSM4JSI7ZOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFM2OFI#issuecomment-559523605, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDTF2K4HLWLTK5A4IKWBNLQV7LVTANCNFSM4JSI7ZOA .

--

cfreehill avatar Nov 28 '19 15:11 cfreehill

Added a fix for empty files in here: https://github.com/ROCm/rocm_smi_lib/commit/a4b470fe71f723fe2c3b90480922820ae8102558

dmitrii-galantsev avatar Dec 12 '23 21:12 dmitrii-galantsev