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

Physical indexes of Core objects do not match with lscpu #610

Closed
xiongzubiao opened this issue Aug 11, 2023 · 2 comments
Closed

Physical indexes of Core objects do not match with lscpu #610

xiongzubiao opened this issue Aug 11, 2023 · 2 comments

Comments

@xiongzubiao
Copy link
Contributor

What version of hwloc are you using?

lstopo 2.7.0

Which operating system and hardware are you running on?

Linux genoa3 6.2.16 #1 SMP PREEMPT_DYNAMIC Tue Jul 11 23:25:59 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Details of the problem

I thought the physical indexes are OS provided. But those are not consistent with the result of lscpu command. They are not even continuous. Am I missing something?

# lstopo -v | grep Core
  Package L#0 (P#0 total=133890784KB CPUVendor=AuthenticAMD CPUFamilyNumber=25 CPUModelNumber=17 CPUModel="AMD EPYC 9354 32-Core Processor                " CPUStepping=1)
            Core L#0 (P#0)
            Core L#1 (P#1)
            Core L#2 (P#2)
            Core L#3 (P#3)
            Core L#4 (P#32)
            Core L#5 (P#33)
            Core L#6 (P#34)
            Core L#7 (P#35)
            Core L#8 (P#16)
            Core L#9 (P#17)
            Core L#10 (P#18)
            Core L#11 (P#19)
            Core L#12 (P#48)
            Core L#13 (P#49)
            Core L#14 (P#50)
            Core L#15 (P#51)
            Core L#16 (P#24)
            Core L#17 (P#25)
            Core L#18 (P#26)
            Core L#19 (P#27)
            Core L#20 (P#56)
            Core L#21 (P#57)
            Core L#22 (P#58)
            Core L#23 (P#59)
            Core L#24 (P#8)
            Core L#25 (P#9)
            Core L#26 (P#10)
            Core L#27 (P#11)
            Core L#28 (P#40)
            Core L#29 (P#41)
            Core L#30 (P#42)
            Core L#31 (P#43)
  Package L#1 (P#1 total=272127180KB CPUVendor=AuthenticAMD CPUFamilyNumber=25 CPUModelNumber=17 CPUModel="AMD EPYC 9354 32-Core Processor                " CPUStepping=1)
            Core L#32 (P#0)
            Core L#33 (P#1)
            Core L#34 (P#2)
            Core L#35 (P#3)
            Core L#36 (P#32)
            Core L#37 (P#33)
            Core L#38 (P#34)
            Core L#39 (P#35)
            Core L#40 (P#16)
            Core L#41 (P#17)
            Core L#42 (P#18)
            Core L#43 (P#19)
            Core L#44 (P#48)
            Core L#45 (P#49)
            Core L#46 (P#50)
            Core L#47 (P#51)
            Core L#48 (P#24)
            Core L#49 (P#25)
            Core L#50 (P#26)
            Core L#51 (P#27)
            Core L#52 (P#56)
            Core L#53 (P#57)
            Core L#54 (P#58)
            Core L#55 (P#59)
            Core L#56 (P#8)
            Core L#57 (P#9)
            Core L#58 (P#10)
            Core L#59 (P#11)
            Core L#60 (P#40)
            Core L#61 (P#41)
            Core L#62 (P#42)
            Core L#63 (P#43)
# lscpu -e=socket,core
SOCKET CORE
     0    0
     0    1
     0    2
     0    3
     0    4
     0    5
     0    6
     0    7
     0    8
     0    9
     0   10
     0   11
     0   12
     0   13
     0   14
     0   15
     0   16
     0   17
     0   18
     0   19
     0   20
     0   21
     0   22
     0   23
     0   24
     0   25
     0   26
     0   27
     0   28
     0   29
     0   30
     0   31
     1   32
     1   33
     1   34
     1   35
     1   36
     1   37
     1   38
     1   39
     1   40
     1   41
     1   42
     1   43
     1   44
     1   45
     1   46
     1   47
     1   48
     1   49
     1   50
     1   51
     1   52
     1   53
     1   54
     1   55
     1   56
     1   57
     1   58
     1   59
     1   60
     1   61
     1   62
     1   63
     0    0
     0    1
     0    2
     0    3
     0    4
     0    5
     0    6
     0    7
     0    8
     0    9
     0   10
     0   11
     0   12
     0   13
     0   14
     0   15
     0   16
     0   17
     0   18
     0   19
     0   20
     0   21
     0   22
     0   23
     0   24
     0   25
     0   26
     0   27
     0   28
     0   29
     0   30
     0   31
     1   32
     1   33
     1   34
     1   35
     1   36
     1   37
     1   38
     1   39
     1   40
     1   41
     1   42
     1   43
     1   44
     1   45
     1   46
     1   47
     1   48
     1   49
     1   50
     1   51
     1   52
     1   53
     1   54
     1   55
     1   56
     1   57
     1   58
     1   59
     1   60
     1   61
     1   62
     1   63
@bgoglin
Copy link
Contributor

bgoglin commented Aug 12, 2023

lscpu isn't reporting core IDs here. Core IDs are identical between sockets because they are hardwired in each CPUs, not recomputed depending on the number of sockets. Hence they should be 0-31 twice on your system, not 0-31 in one socket and 32-63 in the other. I don't know lscpu enough to understand what they mean here, but my lscpu manpage talks about logical and physical IDs, at least in the -y option description, so maybe you're just showing their logical core IDs.

Anyway, beware that physical core IDs have been strange for years. For instance, they've been non-contiguous on many Intel CPUs (those where you don't have the maximal number of cores enabled in your SKUs).
Run this to see the list of core IDs reported by Linux and used by hwloc by default:

cat /sys/devices/system/cpu/cpu{?,??}/topology/core_id

@xiongzubiao
Copy link
Contributor Author

I got it now. Yes, it does align with lscpu -y. Thank you for the education! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants