anrieff / libcpuid

a small C library for x86 CPU detection and feature extraction
Other
445 stars 105 forks source link

Show FSB, litography and even socket? #32

Closed wdlkmpx closed 8 years ago

wdlkmpx commented 8 years ago

It looks like processors from the same family and model/brand share some striking some similarities.

cpu-world shows that a particular brand/model share FSB, litography and in many cases the same socket.

I'm collecting cpu-z screenshots and all screenshots from Core i3 1st gen have the same socket.

Litography (technology) is 100% accurate FSB might be 90-100% accurate socket might be 60-70% accurate

Of course at least the socket can be taken as a reference, not a fact

I can provide input for these fields in case there is interest...

wdlkmpx commented 8 years ago

For example P-4 Celeron Willamette

Facts: Produced only for socket 478 mPGA techonlogy: 180nm FSB 400mhz

http://www.cpu-world.com/CPUs/Celeron/TYPE-Celeron (Willamette).html

# cpu-z
Processor : Intel(R) Celeron(R) CPU 1.80GHz
Code name : P-4 Celeron (Willamette-128)
Cache size: 128 KB
Socket    : 478 mPGA
Bus speed : 400 MHz
Technology: 180 nm        Arch: 32 bits
Cores     : 1
Threads   : 2
Flags     : 
            fpu vme de pse tsc msr pae
            mce cx8 apic mtrr sep pge mca
            cmov pat pse36 clflush dts acpi mmx
            fxsr sse sse2 ss ht tm 
wdlkmpx commented 8 years ago

Actually it might not be a good idea, i'm writing a shell script to handle every situation. Perhaps it could be accepted as an extra in about 2 months?

anrieff commented 8 years ago

Yes, I'm thinking libcpuid has to remain a purely CPU detection library. We discussed that previously in issue #8 . Additional, catalogue-like data, is welcome in a non-code format, like a SQL dump, a XML, or anything else suitable to the task (indeed, whatever you choose, it's going to have a lot of repetitive info).

wdlkmpx commented 8 years ago

I see.

By the way, I think there is a bug regarding HyperThreading (num_logical_cpus > 1) in p4 cpus. As you can see from the example above there is no way such a primitive p4 celeron can do hyperthreading, but has the HT flag... which is misleading. Right I'm with another processor (but quite similar), as you can see here:

This is the output 'lscpu'... 1 thread:

Architecture:          i686
CPU op-mode(s):        32-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            15
Model:                 2
Model name:            Intel(R) Celeron(R) CPU 2.50GHz
Stepping:              9
CPU MHz:               2500.000
CPU max MHz:           2500.0000
CPU min MHz:           312.5000
BogoMIPS:              5001.32
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid xtpr

Some interesting pages: http://unix.stackexchange.com/questions/33450/checking-if-hyperthreading-is-enabled-or-not

Interesting pages:

http://unix.stackexchange.com/questions/33450/checking-if-hyperthreading-is-enabled-or-not http://fibrevillage.com/sysadmin/155-how-to-tell-if-cpu-hyperthreading-enabled-on-linux https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/sys-utils/lscpu.c

wdlkmpx commented 8 years ago

Actually even an Atom (Diamonville) processor has the HT flag, and it shows 'num_logical: 2' which is not the case...

wdlkmpx commented 8 years ago

Well I was wrong, Atom (Diamondville) processors do have 2 'threads'.

Having said that, I have a fix for this, I'll make a pull request later. I'll add a test for Pentium 4 Prescott 3.2GHz with HT enabled, so you can see.