We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I am working on an application which has to deal with compute capacity of the host system. I am using gopsutil to get the capacity.
It works fine on amd64 machines. But when I tested on arm64 machine, the mhz field was 0.
mhz
To Reproduce
package main import ( "fmt" "github.com/shirou/gopsutil/cpu" ) func main() { cores, _ := cpu.Info() for i := 0; i < len(cores); i++ { fmt.Println(cores[i].Mhz) } }
Expected behavior On an arbitrary amd64 machine, I get output similar to this:
2199.998 2199.998
On an arm64 machine, I get this:
0 0
Environment (please complete the following information):
/etc/os-release
uname -a
$ cat /etc/os-release PRETTY_NAME="Ubuntu 22.04 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy $ uname -a Linux ip-10-2-1-38 5.15.0-1014-aws #18-Ubuntu SMP Wed Jun 15 20:06:08 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Additional context
I am testing it on Ubuntu 22.04, but I have also tested the same thing on Ubuntu 18.04 and 20.04.
The text was updated successfully, but these errors were encountered:
Could you tell us /proc/cpuinfo content? We want to know cpu MHz line exists and the content of that line.
/proc/cpuinfo
cpu MHz
Sorry, something went wrong.
@shirou No, there is no such line with MHz.
MHz
ubuntu@ip-10-2-1-38:~$ cat /proc/cpuinfo processor : 0 BogoMIPS : 243.75 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x3 CPU part : 0xd0c CPU revision : 1 processor : 1 BogoMIPS : 243.75 Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x3 CPU part : 0xd0c CPU revision : 1
However, output of dmidecode has the info:
dmidecode
ubuntu@ip-10-2-1-38:~$ sudo dmidecode | grep MHz Max Speed: 2500 MHz Current Speed: 2500 MHz
Adding a fallback to dmidecode to get cpu frequencies was previously discussed in #282 (comment)
It has too many drawbacks in my opinion to be valuable to add it as a fallback.
No branches or pull requests
Describe the bug
I am working on an application which has to deal with compute capacity of the host system. I am using gopsutil to get the capacity.
It works fine on amd64 machines. But when I tested on arm64 machine, the
mhz
field was 0.To Reproduce
Expected behavior
On an arbitrary amd64 machine, I get output similar to this:
On an arm64 machine, I get this:
Environment (please complete the following information):
/etc/os-release
and the result ofuname -a
]Additional context
I am testing it on Ubuntu 22.04, but I have also tested the same thing on Ubuntu 18.04 and 20.04.
The text was updated successfully, but these errors were encountered: