LinuxCommandLibrary

cpuid

Display CPU identification and feature information

TLDR

Display information for all CPUs

$ cpuid
copy

Display information only for the current CPU
$ cpuid [[-1|--one-cpu]]
copy

Display raw hex information with no decoding
$ cpuid [[-r|--raw]]
copy

SYNOPSIS

cpuid [-r] [-1] [-t index] [-s start -e end] [-u] [-x eax] [-y ecx] [-i] [-v] [-hv] [-l] [-p] [-f] [-d]

PARAMETERS

-r
    Raw output (hexadecimal).

-1
    One CPU only (useful for SMP systems).

-t index
    Run specific test (index from 0).

-s start -e end
    Specify the start and end test indexes.

-u
    Print the unformatted dump.

-x eax
    Execute raw cpuid instruction with specified EAX value. Hex value.

-y ecx
    Execute raw cpuid instruction with specified ECX value, using EAX=0x80000000. Hex value.

-i
    Decode extended topology enumeration (Intel CPUID leaf 0x0B).

-v
    Verbose mode.

-hv
    Hypervisor verbose mode.

-l
    List all tests.

-p
    Print parameters.

-f
    Print flags.

-d
    Print data.

DESCRIPTION

The cpuid command is a Linux utility that displays detailed information about the CPU. It primarily operates by executing the CPUID instruction, which provides data about the processor's vendor, family, model, stepping, features, cache configuration, and other architectural details. The output is presented in a human-readable format, making it easier to understand the CPU's capabilities. This information is extremely valuable for system administrators, developers, and hardware enthusiasts. It can be utilized for troubleshooting hardware issues, optimizing software for specific processors, ensuring compatibility with certain applications or operating systems, and understanding system architecture. By analyzing the CPUID output, users can gain insights into various CPU features such as SSE, AVX, virtualization support, and power management capabilities. It is particularly useful when dealing with different CPU generations or when comparing the features of multiple processors.

CAVEATS

The information returned by cpuid depends on the CPU and the version of the utility. Some features may not be reported correctly on older CPUs or if the utility is outdated. Also, some information may be misleading if virtualization is enabled.

UNDERSTANDING CPUID LEAVES

The CPUID instruction uses different "leaves" (EAX register values) to access specific information. Leaf 0 provides the vendor ID and the highest supported standard CPUID function number. Leaves 1 and higher provide detailed information about processor features, cache sizes, and other architectural details. Extended function leaves (0x80000000 and higher) provide information such as brand string and extended feature flags.

INTERPRETING FEATURE FLAGS

The output often contains feature flags (e.g., SSE2, AVX, VMX). These flags indicate the presence of specific instruction sets or hardware features. Understanding these flags is crucial for optimizing software to leverage the CPU's capabilities. Documentation from Intel and AMD provides detailed explanations of each flag.

HISTORY

The cpuid utility has been a standard tool on Linux systems for many years. Its development likely coincided with the increasing complexity of x86 processors and the need for detailed information about their capabilities. The original versions provided basic CPU identification, while later versions were expanded to support new CPUID leaves and features introduced by Intel and AMD. Its usage has become more widespread as software developers and system administrators require precise information about the underlying hardware to optimize application performance and ensure compatibility.

SEE ALSO

lscpu(1), dmidecode(8)

Copied to clipboard