public class CPUID extends Object
This class provides low-level access to CPU identification and feature flags.
It loads a platform-specific native library (libjcpuid.so / jcpuid.dll)
that executes the CPUID assembly instruction and returns register values.
Bits 31:28 Reserved Bits 27:20 Extended Family ID Bits 19:16 Extended Model ID Bits 15:12 Processor Type (Intel only; AMD reserved) Bits 11:8 Base Family ID Bits 7:4 Base Model ID Bits 3:0 Stepping ID
The actual (displayed) family and model are computed as follows:
| Family (hex) | Microarchitecture | Products |
|---|---|---|
| 15 (0xF) | K8 / Hammer | Athlon 64, Opteron |
| 16 (0x10) | K10 | Phenom, Athlon II |
| 20 (0x14) | Bobcat | Ontario, Zacate |
| 21 (0x15) | Bulldozer family | FX, Opteron |
| 22 (0x16) | Jaguar | Kabini, Temash |
| 23 (0x17) | Zen / Zen+ / Zen 2 | Ryzen 1000-3000, EPYC 7001-7002 |
| 25 (0x19) | Zen 3 / Zen 4 | Ryzen 5000-8000, EPYC 7003-9004 |
| 26 (0x1A) | Zen 5 | Ryzen 9000, EPYC 9005, Ryzen AI 300 |
0x00-0x0F Milan/Chagall (Zen 3) - EPYC 7003, Threadripper 5000 0x10-0x1F Stones/Storm Peak (Zen 4) - EPYC 9004, Threadripper 7000 0x20-0x2F Vermeer (Zen 3) - Ryzen 5000 desktop 0x30-0x3F Badami (Zen 3) - EPYC (internal) 0x40-0x4F Rembrandt (Zen 3+) - Ryzen 6000 mobile 0x50-0x5F Cezanne (Zen 3) - Ryzen 5000 APU 0x60-0x6F Raphael (Zen 4) - Ryzen 7000 desktop (AM5) 0x70-0x77 Phoenix/HawkPoint1 (Zen 4) - Ryzen 7040/8040 APU 0x78-0x7F Phoenix2/HawkPoint2(Zen 4) - Ryzen 8040 APU 0xA0-0xAF Stones-Dense (Zen 4) - EPYC 4004/Siena
Sources: LLVM Host.cpp, Linux kernel amd.c, InstLatx64 CPUID dumps.
0x00-0x0F Breithorn/Turin (Zen 5) - EPYC 9005 server 0x10-0x1F Breithorn-Dense (Zen 5) - EPYC 9005 dense 0x20-0x2F Strix Point (Zen 5) - Ryzen AI 300 mobile 0x30-0x37 Strix Point (2nd) (Zen 5) - Ryzen AI 300 mobile 0x38-0x3F Strix Point (3rd) (Zen 5) - Ryzen AI 300 mobile 0x40-0x4F Granite Ridge (Zen 5) - Ryzen 9000 desktop (AM5) 0x50-0x5F Weisshorn (Zen 6) - NOT Zen 5! 0x60-0x6F Krackan Point (Zen 5) - Ryzen AI 300 mobile 0x70-0x77 Sarlak/Strix Halo (Zen 5) - Ryzen AI Max 300 0xD0-0xD7 Annapurna (Zen 5) - Future EPYC
CPUID leaves 0x80000002-0x80000004 return a 48-byte ASCII brand string programmed by AMD/Intel into the CPU. This is the most reliable way to identify a specific CPU model, as model number ranges can overlap across product lines (e.g., model 0x44 is Granite Ridge desktop, not Strix Halo).
| Modifier and Type | Class and Description |
|---|---|
protected static class | CPUID.CPUIDResultHolds the four 32-bit register values (EAX, EBX, ECX, EDX) returned
by a single CPUID instruction call. |
| Constructor and Description |
|---|
CPUID() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static int | getCPUExtendedFamily()Returns the Extended Family ID from CPUID leaf 1, EAX bits 27:20. |
(package private) static int | getCPUExtendedModel()Returns the Extended Model ID from CPUID leaf 1, EAX bits 19:16. |
(package private) static int | getCPUFamily()Returns the Base Family ID from CPUID leaf 1, EAX bits 11:8. |
(package private) static int | getCPUModel()Returns the Base Model ID from CPUID leaf 1, EAX bits 7:4. |
(package private) static String | getCPUModelName()Returns the CPU brand string from CPUID extended leaves 0x80000002-0x80000004. |
(package private) static int | getCPUStepping() |
(package private) static int | getCPUType() |
(package private) static String | getCPUVendorID()Returns the 12-byte CPU vendor ID string from CPUID leaf 0. |
(package private) static int | getECXCPUFlags()Return the ECX feature flags |
(package private) static int | getEDXCPUFlags()Return the EDX feature flags |
(package private) static int | getExtendedEBXFeatureFlags() |
(package private) static int | getExtendedECXCPUFlags()Return the extended ECX feature flags |
(package private) static int | getExtendedECXFeatureFlags()There's almost nothing in here. |
(package private) static int | getExtendedEDXCPUFlags() |
static CPUInfo | getInfo()Return information. |
static int | getJcpuidVersion()Return the jcpuid version |
static void | main(String[] args)main. |
static int getCPUExtendedFamily()
To compute the actual family when Base Family == 0xF:
actualFamily = baseFamily + extendedFamily
For AMD CPUs, this is always added to the base family.
static int getCPUExtendedModel()
To compute the actual model for CPUs where Base Family is 6 or 0xF:
actualModel = baseModel + (extendedModel << 4)
For AMD CPUs, this is always added to the base model.
static int getCPUFamily()
WARNING: This is the raw Base Family, NOT the computed family.
For AMD CPUs with Base Family == 0xF (15), you must add
getCPUExtendedFamily() to get the actual family.
For other AMD families (17h, 19h, 1Ah), the extended family is always
added to the base family to form the actual family.
for the extended family componentstatic int getCPUModel()
WARNING: This is the raw Base Model, NOT the computed model.
For CPUs with Base Family == 0x6 or 0xF, you must add
getCPUExtendedModel() << 4 to get the actual model.
For AMD CPUs, the extended model is always applied when computing
the actual model.
for the extended model componentstatic String getCPUModelName()
This is the most reliable way to identify a specific CPU model. The brand string is a 48-byte ASCII string programmed by AMD/Intel into the CPU. Examples:
"AMD Ryzen 9 9900X 12-Core Processor""Intel(R) Core(TM) i9-14900K""AMD EPYC 9754 128-Core Processor"IMPORTANT: This is preferred over model-based identification. AMD model number ranges overlap across product lines (e.g., model 0x44 is Granite Ridge desktop, but model ranges can be ambiguous). The brand string is always correct when available.
static int getCPUStepping()
static int getCPUType()
static String getCPUVendorID()
Known vendor strings:
"AuthenticAMD" - AMD"GenuineIntel" - Intel"CentaurHauls" - VIA/Centaur"HygonGenuine" - Hygon (AMD-based Chinese JV)static int getECXCPUFlags()
static int getEDXCPUFlags()
static int getExtendedEBXFeatureFlags()
static int getExtendedECXCPUFlags()
static int getExtendedECXFeatureFlags()
static int getExtendedEDXCPUFlags()
public static CPUInfo getInfo() throws UnknownCPUException
UnknownCPUExceptionpublic static int getJcpuidVersion()
public static void main(String[] args)