I need to write a script, which will work slightly differently on Intel Skylake processors. I can see that the lscpu tool outputs Model number differently on different CPUs, for example:

i7-4578U   Model number = 69 (it's my laptop)
E5-2699    Model number = 63 (it's a server)

However, both processors belong to the Haswell micro-architecture family, so this method doesn't look reliable.

What is the reliable and recommended method to determine Intel CPU micro-archirtecture from a Linux script?

OS: Ubuntu (various versions)

  • 1
    Does gcc -march=native -Q --help=target | grep march work for you, or any of the other solutions in unix.stackexchange.com/q/230634/209755 ? – Harry Apr 12 at 16:01
  • @Harry - the gcc trick works for me! But I can't verify it with Skylake CPU now – HEKTO Apr 12 at 16:33
  • More importantly, why do you need to know the micro-arch? For optimization? To avoid some bug/misfeature? Curiosity? Some other reason? – ilkkachu Apr 12 at 17:31
  • @ilkkachu - for instance, to compile kernel modules from right sources – HEKTO Apr 12 at 18:08
up vote 1 down vote accepted

Model numbers do map to micro-architectures, but several model numbers can correspond to the same micro-architecture. To determine what model numbers to look for, you need to look at Intel’s “specification updates”; these provide exhaustive lists of model identifications.

For example, for Haswell you need to look at the mobile 4th gen update, the desktop 4th gen update, and probably the server 4th gen update. The first two list models 60, 69, and 70 (look for the “identification information” page, then take the “extended model” and “model number” values).

For Skylake, the X-series 6th gen update lists model 85, the generic 6th gen update lists models 78 and 94.

  • It looks like this info is distributed over many pdfs... Do you know any document, listing all the model numbers in one place? – HEKTO Apr 12 at 16:37
  • May be, this is the summary: software.intel.com/en-us/articles/… - but it looks really old – HEKTO Apr 12 at 19:51
  • That article was indeed supposed to be an exhaustive list, but it hasn’t been updated since it was published, nearly six years ago. If you only want to identify Skylake, there aren’t many PDF files to look at... Unfortunately I don’t know of a single, authoritative document listing all the model numbers. – Stephen Kitt Apr 13 at 15:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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