I get access to some xeon machines for checking performance. I want to find out what architecture they are using such as Haswell, Sandybridge , Ivybridge. Is there a command to find this out?

  • 2
    /proc/cpuinfo actually gives the model name like Intel (R) blah blah blah GHz, you should google it directly. – Arthur2e5 Sep 18 '15 at 21:50
  • I was asking for architecture family – I just want to code Sep 18 '15 at 22:07
  • 1
    I don't think the “architecture family” is reported, they're just commercial names. You get the model name in /proc/cpuinfo, I think it's up to you to translate that into the corresponding family name. – Gilles Sep 18 '15 at 22:30
  • @Ijustwanttocode You have to use some kind of table to look up those commercial names. – Arthur2e5 Sep 19 '15 at 0:24

It's a bit of a cheap workaround but you could get that info from gcc ! I'll explain : gcc is able to optimize binaries for each subarch with the -march option. Moreover, it is able to detect yours and automatically optimize for your machine with -march=native Assuming so, you just have to call gcc with march=native and ask it what flags it would use : in short

gcc -march=native -Q --help=target|grep march

for me it gives

-march=                               bdver1

but my pc runs with an amd buldozer processor

  • your solution answers the question. It works for me. – AJN Oct 9 '17 at 17:20
  • This doesn't work for me as it returns broadwell instead of kabylake. This is probably because my version of gcc doesn't distinguish those two families when generating assembly. – Tyilo Jan 13 '18 at 5:35
  • gcc8 can identify skylake as such whereas gcc5 identifies as broadwell, indeed. – Eric Aug 12 '18 at 17:00

You probably can't because those are marketing names for commercial sale, not the "technical" name.

You can, however, obtain what you need from dmidecode and then visit http://ark.intel.com (for your Xeon processor) to determine the commercial family.

[root@mediasrv ~]# dmidecode|grep -i intel
        Socket Designation: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
        Manufacturer: Intel
        Version: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz

From that output, I could visit Intel's ark website and search for the 3770 CPU, which would tell me I have an Ivy Bridge chip.

  • 1
    To do it automated with a script i would use dmidecode or /proc/cpuinfo and combine it with grep or awk or perl and the printable version of the xeon cpu list on wikipedia which you get with curl or wget: en.wikipedia.org/w/… – erik Sep 19 '15 at 22:23

Below is a bash script that automatically finds the architecture code name for your CPU using /proc/cpuinfo and https://ark.intel.com/. To work it requires that you have pup installed.

Running the code on my computer I get the following result:

$ ./intel_codename
Processor name: i7-7700HQ
Kaby Lake


set -euo pipefail

if [[ $# == 0 ]]; then
    modelname=$(cat /proc/cpuinfo | grep 'model name' | head -1)
    if ! grep Intel <<<"$modelname" > /dev/null; then
        echo "You don't seem to have an Intel processor" >&2
        exit 1

    name=$(sed 's/.*\s\(\S*\) CPU.*/\1/' <<<"$modelname")
    echo "Processor name: $name" >&2

links=($(curl --silent "https://ark.intel.com/search?q=$name" | pup '.result-title a attr{href}'))

if [[ $results == 0 ]]; then
    echo "No results found" >&2
    exit 1

if [[ $results != 1 ]]; then
    echo "Warning: $results results found" >&2
    echo "Using: $link" >&2

codename=$(curl --silent "$url" | pup '.CodeNameText .value text{}' | xargs | sed 's/Products formerly //')

echo "$codename"
  • It works and does what @erik suggested! – Panayotis Jan 31 '18 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.