You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running lscpu on a Debian (or other linux) VM on an arm64 system (for example an Apple M2 system) does not output the line Core(s) per socket but outputs Core(s) per cluster. Because Core(s) per socket is not in the output the line calculating the number of cpus crashes:
[2023-09-01T11:36:36+02:00] TRACE: Plugin CPU threw #<TypeError: nil can't be coerced into Integer>
[2023-09-01T11:36:36+02:00] TRACE: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.0.26/lib/ohai/plugins/cpu.rb:201:in `*'
[2023-09-01T11:36:36+02:00] TRACE: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.0.26/lib/ohai/plugins/cpu.rb:201:in `parse_lscpu'
[2023-09-01T11:36:36+02:00] TRACE: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.0.26/lib/ohai/plugins/cpu.rb:362:in `block (2 levels) in <main>'
The output of a Debian 12 VM on an amd64 system gives (truncated to relevant part):
Vendor ID: AuthenticAMD
BIOS Vendor ID: AMD
Model name: AMD EPYC 7F52 16-Core Processor
BIOS Model name: CPU @ 3.5GHz
BIOS CPU family: 1
CPU family: 23
Model: 49
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
Stepping: 0
The output of lscpu on a Debian 12 VM on an arm64 system (in a Debian VM) gives (truncated to relevant part):
Vendor ID: ARM
BIOS Vendor ID: Apple
Model name: -
BIOS Model name: Apple Silicon None CPU @ 2.0GHz
BIOS CPU family: 257
Model: 0
Thread(s) per core: 1
Core(s) per cluster: 2
Socket(s): 1
Cluster(s): 1
Stepping: r0p0
Ohai Version
# ohai --version
Ohai: 18.0.26
Platform Version
Debian 12 on a Apple M2 Macbook Pro.
Ohai Output
I've added some debug output at line 196 of the CPU plugin:
[2023-09-01T11:42:55+02:00] TRACE: Plugin CPU: real cpu & core data is missing in /proc/cpuinfo and lscpu
[2023-09-01T11:42:55+02:00] TRACE: Plugin CPU: ran 'lscpu' and returned 0
[2023-09-01T11:42:55+02:00] TRACE: Plugin CPU: ran 'lscpu -p=CPU,CORE,SOCKET' and returned 0
[2023-09-01T11:42:55+02:00] INFO: sockets: 1
[2023-09-01T11:42:55+02:00] INFO: cores_per_socket: nil
[2023-09-01T11:42:55+02:00] INFO: threads_per_core: 1
[2023-09-01T11:42:55+02:00] TRACE: Plugin CPU threw #<TypeError: nil can't be coerced into Integer>
[2023-09-01T11:42:55+02:00] TRACE: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.0.26/lib/ohai/plugins/cpu.rb:200:in `*'
[2023-09-01T11:42:55+02:00] TRACE: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.0.26/lib/ohai/plugins/cpu.rb:200:in `parse_lscpu'
[2023-09-01T11:42:55+02:00] TRACE: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ohai-18.0.26/lib/ohai/plugins/cpu.rb:361:in `block (2 levels) in <main>'
The text was updated successfully, but these errors were encountered:
This is due to a newer version of util-linux (>= 2.37.0) changing the formatting:
lscpu(1) has been reimplemented. Now it analyzes /sys for all CPUs and provides
information for all CPU types used by the system (for example heterogeneous
big.LITTLE ARMs, etc.). This command reads also SMBIOS tables to get CPU
identifiers. Thanks to Masayoshi Mizuma from Fujitsu and Jeffrey Bastian from
Red Hat. The default output on the terminal is more structured now to be more
human-readable.
This is also breaking on RHEL >= 9 and Ubuntu >= 22.04. I am working on creating a PR to resolve this.
Starting in util-linux v2.36, the output of lscpu changed which introduced some
bugs in some platforms. To work around this, the previous output can be retained
if the lscpu command is piped to something else. To work around that, this just
pipes the output to cat.
This fixeschef#1805
Signed-off-by: Lance Albertson <lance@osuosl.org>
Description
Running
lscpu
on a Debian (or other linux) VM on an arm64 system (for example an Apple M2 system) does not output the lineCore(s) per socket
but outputsCore(s) per cluster
. BecauseCore(s) per socket
is not in the output the line calculating the number of cpus crashes:The output of a Debian 12 VM on an amd64 system gives (truncated to relevant part):
The output of
lscpu
on a Debian 12 VM on an arm64 system (in a Debian VM) gives (truncated to relevant part):Ohai Version
Platform Version
Debian 12 on a Apple M2 Macbook Pro.
Ohai Output
I've added some debug output at line 196 of the CPU plugin:
This results in:
The text was updated successfully, but these errors were encountered: