I’d be a bit surprised if any of my readers weren’t already aware of CPU-Z: it’s a very handy utility to run on a Windows PC when you are contemplating buying new RAM (and need to know what type of RAM your motherboard takes), or wondering whether your CPU has the hardware virtualisation extensions:
It has a couple of flaws, however. The first is that, like a lot of Windows freeware these days, you have to be careful during the installation process, because it will suggest by default to install the Ask toolbar and to change your browser’s home page. Why anyone, ever, thought that would be a good thing for a user to experience, I have never worked out -but it’s certainly annoying to me.
The second problem is that it’s a Wndows-only affair. If you want to check these sorts of hardware details when you’re running Linux, it’s not the tool for you!
So is there a Linux equivalent of CPU-Z?
Indeed there is -and, if you’re running Scientific Linux 6.1, at least, it’s already installed and you merely have to invoke it. The program is called dmidecode. It’s a text utility (none of your twittering GUIs here, thank you very much) which must be run as root (you’ll get ‘permission denied’ errors if you try running it as yourself). As root, therefore, issue this sort of command:
dmidecode | more
…and you’ll see stuff that looks like this:
[root@dirac ~]# dmidecode | more # dmidecode 2.10 SMBIOS 2.5 present. 27 structures occupying 3569 bytes. Table at 0x000FB520. Handle 0x0000, DMI type 0, 24 bytes BIOS Information Vendor: American Megatrends Inc. Version: V1.07 Release Date: 08/21/2009 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 1024 kB Characteristics: ISA is supported PCI is supported PNP is supported APM is supported BIOS is upgradeable
…and so on and on (press Enter to step through the output line-by-line).
Pretty detailed stuff! It’s basically an entire dump of the information that CPU-Z displays on all of its separate tabs. Is there a way to break this output up into the same sort of separate ‘sections’, so that you only see data on, say, the mainboard, the CPU or the memory modules, as you direct?
Of course there is. Notice that in the output seen so far different parts of it are displayed as DMI Type x …in the above output, it was “DMI Type 0″, for example. Well, you can supply a DMI Type number to the dmidecode program as a run-time parameter, and only that section of the entire output will be displayed.
The bit about which system you own, for example, has DMI Type number 1, so this command:
dmidecode --type 1
…only returns this output:
[root@dirac ~]# dmidecode --type 1 # dmidecode 2.10 SMBIOS 2.5 present. Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: Hewlett-Packard Product Name: HP dx2810 MT Version: 103C Serial Number: xxxxxxxxx UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX Wake-up Type: Power Switch SKU Number: AB123CD#EFG Family: 103C_53307F
The CPU bits and pieces are DMI type 4, so the command dmidecode –type 4 yields just this:
Handle 0x0004, DMI type 4, 40 bytes Processor Information Socket Designation: CPU 1 Type: Central Processor Family: Other Manufacturer: Intel ID: 7A 06 01 00 FF FB EB BF Signature: Type 0, Family 6, Model 23, Stepping 10 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz Voltage: 1.2 V External Clock: 1333 MHz Max Speed: 2666 MHz Current Speed: 2666 MHz Status: Populated, Enabled Upgrade: Other L1 Cache Handle: 0x0005 L2 Cache Handle: 0x0006 L3 Cache Handle: Not Provided Serial Number: Asset Tag: Part Number: Core Count: 4 Core Enabled: 4 Thread Count: 4 Characteristics: 64-bit capable
Memory details are type 17:
[root@dirac ~]# dmidecode --type 17 # dmidecode 2.10 SMBIOS 2.5 present. Handle 0x0010, DMI type 17, 27 bytes Memory Device Array Handle: 0x000E Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 2048 MB Form Factor: DIMM Set: None Locator: DIMM0 Bank Locator: BANK0 Type: DDR2 Type Detail: Synchronous Speed: 800 MHz Manufacturer: CE00000000000000 Serial Number: SerNum0 Asset Tag: AssetTagNum0 Part Number: M3 78T5663QZ3-CF7
And so on an on. The complete list of which DMI type numbers exist and what parts of your system they represent is easily obtainable by checking the man pages for dmidecode (i.e., just type the command man demidecode and scroll down about half-way).
Not something you’ll use every day, I realise (and hence the reason for me committing it to the blog instead of trusting to my memory!), but an excellent and simple utility that saves having to download stuff and worry about installing extras you never intended to have!



Wow, nice long article, hope more ppl will use Linux, coz IMHO it’s easier to use than Windows, eg. in 95% no need to install drivers, all programs in Software Center,no need to search exe’s all over internet, and thats why no viruses.
There’s also (or at least used to be) a utility called lshw, which was a kind of wrapper for dmidecode. It had both a gui part and a command line part, and you could do something like ‘lshw -C memory’ to check the memory config, ‘lshw -C CPU’ for cpu-info etc.
regds
/M
That’s a good tip, M. On SL6.1, a simple yum install lshw will work (so long as the rpmforge repository is installed and enabled beforehand). The commands you mention then work as you say. I can’t say I’ve seen any GUI component for it, though. So in my mind, there’s not a lot of difference between doing a dmidecode and doing a lshw, except that you can use words like ‘CPU’ and ‘memory’ instead of knowing it’s “type 17″ or “type 4″ -but that may make a difference to someone, so it’s definitely worth knowing about! So thanks.
install “lshw-gtk” for the gui version. This works for Ubuntu at least, dunno about others.
Yet another useful command is ‘lscpu’:
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 5
On-line CPU(s) list: 0-4
Thread(s) per core: 1
Core(s) per socket: 5
CPU socket(s): 1
Vendor ID: AuthenticAMD
CPU family: 16
Model: 10
Stepping: 0
CPU MHz: 3013.451
BogoMIPS: 6026.90
Virtualization: AMD-V
L1d cache: 64K
L1i cache: 64K
L2 cache: 512K
L3 cache: 6144K
Cheers.
Just to add from the man page:
The lscpu command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/
Yup: There are lots of good utilities for this sort of thing. I wrote about the one I did because it’s already installed, by default. Thanks for mentioning this, though: you’ve obviously found it useful in the past, and I’m sure others will too.
But none of these show the true frequency of a CPU, only the core speed.
Ken, there are a couple of programs available to monitor the true freq and the turbo freq if you’re using Intel processors. For the latest I-core processors i7z is pretty good and for older NHM or WSM I would recommend turbostat which is part of pmtools.
For AMD processors, clkconfig will output the current and turbo frequencies.
Sorry, but what the different with lshw?
Hi there: not sure who you’re addressing that question to, but here’s part of a reply I made higher up the comments:
“So in my mind, there’s not a lot of difference between doing a dmidecode and doing a lshw, except that you can use words like ‘CPU’ and ‘memory’ instead of knowing it’s “type 17″ or “type 4″ -but that may make a difference to someone, so it’s definitely worth knowing about! “