jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.62k stars 174 forks source link

Linux: failed to determine memory area for node: open /sys/devices/system/node/node0/memory_failure/state: no such file or directory #341

Closed matildeY closed 1 year ago

matildeY commented 1 year ago

Failed to get topologyNodes return error failed to determine memory area for node: open /sys/devices/system/node/node0/memory_failure/state: no such file or directory

1- since latest linux kernel there is a new directory called "memory_failure" that matches pattern defined in function memoryTotalPhysicalBytesFromPath and makes it failed.

2- is it possible to call "memTotalPhysicalBytes" instead of "memoryTotalPhysicalBytesFromPath" in function "AreaForNode" which contains a fallback function to the syslog approach ?

jaypipes commented 1 year ago

Hi @matildeY! Thanks for submitting this bug report. Do you think that the fix for a related bug will resolve this issue? I'm planning on cutting a ghw release with that fix today (was waiting on a couple other PRs to merge first). If you could pull the latest main branch and check on your system whether the issue still appears that would be super helpful. Thank you!

matildeY commented 1 year ago

hi, thanks for your answer, before submitting this bug i've tried with the main branch and the error is still present.

The memoryTotalUsableBytesFromPath call is ok and does not return error

jaypipes commented 1 year ago

hi, thanks for your answer, before submitting this bug i've tried with the main branch and the error is still present.

The memoryTotalUsableBytesFromPath call is ok and does not return error

OK, thank you for verifying that @matildeY! I will push a fix ASAP.

asiffer commented 1 year ago

Hi! I got the same warning when calling ghw.GPU : WARNING: failed to determine memory area for node: open /sys/devices/system/node/node0/memory_failure/state: no such file or directory (it is hidden when I use the ghw.WithDisableWarnings() option)

jaypipes commented 1 year ago

Hi! I got the same warning when calling ghw.GPU : WARNING: failed to determine memory area for node: open /sys/devices/system/node/node0/memory_failure/state: no such file or directory (it is hidden when I use the ghw.WithDisableWarnings() option)

Hi @asiffer! What version of ghw are you using? I believe I fixed that issue but have not yet cut a new release of ghw that includes it.

asiffer commented 1 year ago

Thanks @jaypipes for your quick response! v0.10.0 in my go.mod file

jaypipes commented 1 year ago

@asiffer I just cut a new release: https://github.com/jaypipes/ghw/releases/tag/v0.11.0

Wait a bit for Go mod/packaging to publish the new package and then update your go.mod. Should be good to go after that! :)

asiffer commented 1 year ago

Awesome 🤩 Thanks a lot!

ffromani commented 1 year ago

@asiffer @matildeY Hi! could you please kindly confirm version v0.11.0 fixes your issues, so we can close this bug? Thanks!

asiffer commented 1 year ago

Yes the last version fixed it 👍🏻 Thanks again

matildeY commented 1 year ago

yes, it's ok for me. Thanks

CapCreeperGR commented 3 months ago

Doesn't seem to be fixed. I am getting this warning with 0.12.0

ffromani commented 3 months ago

Doesn't seem to be fixed. I am getting this warning with 0.12.0

Hi, could you please give more details? e.g. which kernel version are you running?