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

[linux] Can't recognize the cpu name correctly on arm64. #567

Closed
xzl01 opened this issue Sep 27, 2023 · 19 comments
Closed

[linux] Can't recognize the cpu name correctly on arm64. #567

xzl01 opened this issue Sep 27, 2023 · 19 comments
Labels
bug Something isn't working

Comments

@xzl01
Copy link
Contributor

xzl01 commented Sep 27, 2023

Sorry I didn't follow your feedback format. I noticed that on Huawei Pangu ARM machines the CPU name is output as unknown:
image
But the name output on the lscpu is correct, After looking at the code I realized that the lscpu does something special for arm64 cpus https://github.com/util-linux/util-linux/blob/87f491671efb920ddd1c45c70dc8016f072851bb/sys-utils/lscpu-arm.c

Hopefully fastfetch will also support recognizing

@xzl01 xzl01 added the bug Something isn't working label Sep 27, 2023
@CarterLi
Copy link
Member

I will just call lscpu and fetch its output

@danie-dejager
Copy link

danie-dejager commented Sep 27, 2023

I have output from lscpu on the AWS t4g here: #566

@CarterLi
Copy link
Member

What's lscpu -p=MODELNAME?

@CarterLi
Copy link
Member

Screenshot_2023-09-27-14-16-19-753_com.termux.jpg

Tested on Android, lscpu prints different model names for different cores. In this case should fastfetch use only the first name, or print them all?

@danie-dejager
Copy link

danie-dejager commented Sep 27, 2023

lscpu | awk '/Model name:/ { print $3 }'
Neoverse-N1
lscpu -p=MODELNAME
lscpu: unknown column: MODELNAME

@CarterLi
Copy link
Member

CarterLi commented Sep 27, 2023

What's lscpu -h?

lscpu | awk '/Model name:/ { print $3 }'

I can't use that, because the property Model name is localized in different locale.

@CarterLi
Copy link
Member

CarterLi commented Sep 27, 2023

Seems that CPU part is id_part::id in lscpu-arm.c. I decided to use it.

We can't use code of lscpu because of the GPL license issue.

@xzl01
Copy link
Contributor Author

xzl01 commented Sep 27, 2023

This is the output of my lscpu:

deepin@deepin-pc-52:~$ lscpu
Architecture:           aarch64
  CPU op-mode(s):       64-bit
  Byte Order:           Little Endian
CPU(s):                 24
  On-line CPU(s) list:  0-23
Vendor ID:              HiSilicon
  Model name:           Kunpeng-920
    Model:              0
    Thread(s) per core: 1
    Core(s) per socket: 24
    Socket(s):          1
    Stepping:           0x1
    BogoMIPS:           200.00
    Flags:              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm
Caches (sum of all):    
  L1d:                  1.5 MiB (24 instances)
  L1i:                  1.5 MiB (24 instances)
  L2:                   12 MiB (24 instances)
  L3:                   24 MiB (1 instance)
Vulnerabilities:        
  Itlb multihit:        Not affected
  L1tf:                 Not affected
  Mds:                  Not affected
  Meltdown:             Not affected
  Spec store bypass:    Not affected
  Spectre v1:           Mitigation; __user pointer sanitization
  Spectre v2:           Not affected
  Srbds:                Not affected
  Tsx async abort:      Not affected

@CarterLi
Copy link
Member

Does lscpu -p=MODELNAME work?

@xzl01
Copy link
Contributor Author

xzl01 commented Sep 27, 2023

Does lscpu -p=MODELNAME work?  lscpu -p=MODELNAME 有效吗?

no

lscpu: unknown column: MODELNAME

@CarterLi
Copy link
Member

Strange. Maybe you are using an old lscpu version

@xzl01
Copy link
Contributor Author

xzl01 commented Sep 27, 2023

Strange. Maybe you are using an old lscpu version strange. Maybe you are using an old lscpu version

It's possible, the version I'm using is 2.38-5 but I'll update it soon when I realize

@danie-dejager
Copy link

lscpu --version
lscpu from util-linux 2.37.4

@CarterLi
Copy link
Member

Please test it

@danie-dejager
Copy link

Working for me:
image

@theofficialgman
Copy link

@CarterLi please re-open. this issue is still present

fastfetch 2.16.0

                                            CPU: ARMv8 rev 1 (v8l) (4) @ 2.09 GHz

lscpu -p=MODELNAME

# The following is the parsable format, which can be fed to other
# programs. Each different item in every column has an unique ID
# starting usually from zero.
# Modelname
Cortex-A57
Cortex-A57
Cortex-A57
Cortex-A57

cat /proc/cpuinfo

processor       : 0
model name      : ARMv8 Processor rev 1 (v8l)
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 1

processor       : 1
model name      : ARMv8 Processor rev 1 (v8l)
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 1

processor       : 2
model name      : ARMv8 Processor rev 1 (v8l)
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 1

processor       : 3
model name      : ARMv8 Processor rev 1 (v8l)
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd07
CPU revision    : 1

I would prefer that lscpu output always be default on arm (armv6/7/8/9)

@NitroNils
Copy link

NitroNils commented Jun 22, 2024

We can't use code of lscpu because of the GPL license issue.

There is a BSD clause 3 licensed version of lscpu too.

EDIT: Not sure whether it would work on Linux, though.

@CarterLi
Copy link
Member

We can't use code of lscpu because of the GPL license issue.

There is a BSD clause 3 licensed version of lscpu too.

EDIT: Not sure whether it would work on Linux, though.

It's for x86 only

@theofficialgman
Copy link

theofficialgman commented Jun 26, 2024

We can't use code of lscpu because of the GPL license issue.

mapping tables matching the variant/part to a friendly name are not code and are not subject to licenses. these variant/part to friendly name tables all come from public license free resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants