cpuinfo module
Re: cpuinfo module
Hello,
Very nice !
Works great on my two Linux distributions with different Hardware:
- Fedora 23 - 64 Bit
- Manjaro Linux (Archlinux) - 64 Bit
Mini ITX Intel® Quad-Core Processor J1900 @ 2 Ghz
Dell Latitude E5430 with Intel® i5-3340M Processor @ 2,7 Ghz
Regards,
Alen
Very nice !
Works great on my two Linux distributions with different Hardware:
- Fedora 23 - 64 Bit
- Manjaro Linux (Archlinux) - 64 Bit
Mini ITX Intel® Quad-Core Processor J1900 @ 2 Ghz
Dell Latitude E5430 with Intel® i5-3340M Processor @ 2,7 Ghz
Regards,
Alen
- RSBasic
- Moderator
- Posts: 1228
- Joined: Thu Dec 31, 2009 11:05 pm
- Location: Gernsbach (Germany)
- Contact:
Re: cpuinfo module

(Tested on Windows 10 too.)GenuineIntel
Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
4 cores
Running on core number 6
Running at 3300 mhz
SSE2 mode
Re: cpuinfo module
thanks for testing itRSBasic wrote:
(Tested on Windows 10 too.)GenuineIntel
Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
4 cores
Running on core number 6
Running at 3300 mhz
SSE2 mode
I'll have a look and see if I can check for threads per core since it says it's running on core 6 out of 4 cores
Windows 11, Manjaro, Raspberry Pi OS


Re: cpuinfo module
Hi idle,
even APIC_ID´s are for the phys.Cores (start with 0), odd APIC_ID´s are for the log.Cores (start with 1, if HT). Without HT the APIC_ID must div.2 for GetActiveCore():
GetFrequency(): On CPUs with Invariant TSC (all new CPUs) this gives the Base-Clock (e.g. for Timings), not the "Running at ..."!
Helle
even APIC_ID´s are for the phys.Cores (start with 0), odd APIC_ID´s are for the log.Cores (start with 1, if HT). Without HT the APIC_ID must div.2 for GetActiveCore():
Code: Select all
APIC_ID.l
j = 1
hThread = GetCurrentThread_()
OldThreadAffinityMask = SetThreadAffinityMask_(hThread, j) ;Save
While SetThreadAffinityMask_(hThread, j)
Number_Threads + 1
!MOV eax,1
!CPUID
!SHR ebx,24 ;Initial APIC ID. Bit24: 0=phys., 1=log.Core
!TEST ebx,1
!JNZ @f
!mov [v_APIC_ID],ebx
Debug APIC_ID ;0, 2, 4, 6... with/without HT
Number_Cores + 1
Core_Sequence$ + "P"
!JMP NextCore
!@@:
!mov [v_APIC_ID],ebx
Debug APIC_ID ;1, 3, 5, 7... with HT
Core_Sequence$ + "L"
Hyper_Threading + 1
!NextCore:
j << 1
Wend
SetThreadAffinityMask_(hThread, OldThreadAffinityMask) ;Restore
If Hyper_Threading
Hyper_Threading$ = "Yes"
Else
Hyper_Threading$ = "No"
EndIf
Debug "----------"
Debug Number_Cores
Debug Number_Threads
Debug Core_Sequence$ ;Horror with AMD, I saw this with Bulldozer, confirmed with Pscheck (AMD Prog.)
Debug Hyper_Threading$
Helle
Re: cpuinfo module
Two of my machines produce the following:
PC - Windows 10
GenuineIntel
Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz
16 cores
Running on core number 5
Running at 3030 mhz
SSE2 mode
MacBook Pro
GenuineIntel
Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
4 cores
Running on core number 1
Running at 3115 mhz
SSE2 mode
PC - Windows 10
GenuineIntel
Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz
16 cores
Running on core number 5
Running at 3030 mhz
SSE2 mode
MacBook Pro
GenuineIntel
Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
4 cores
Running on core number 1
Running at 3115 mhz
SSE2 mode
DE AA EB
Re: cpuinfo module
How do you use #PB_CPU_HYPERVISOR from the original post in this thread? I tried the following line but I get an error about the constant #PB_CPU_HYPERVISOR not found, but it's in the Enumerations?
Code: Select all
Debug CPUInfo::IsCPU(#PB_CPU_HYPERVISOR)
Re: cpuinfo module
BarryG wrote:How do you use #PB_CPU_HYPERVISOR from the original post in this thread? I tried the following line but I get an error about the constant #PB_CPU_HYPERVISOR not found, but it's in the Enumerations?
Code: Select all
Debug CPUInfo::IsCPU(#PB_CPU_HYPERVISOR)
Code: Select all
Debug CPUInfo::IsCPU(CPUInfo::#PB_CPU_HYPERVISOR)
Re: cpuinfo module
updated module and changed IsCpu parameter to a string, so it can work with a map to print the features
Re: cpuinfo module
updated v1.1 added GetCPUSerialNumber - jassing