How do I find out if my Linux server CPU can run a 64 bit kernel version (apps) or not?

by on April 7, 2006 · 18 comments· LAST UPDATED September 7, 2007

in , ,

It happens many times. Often new Linux system administrators and user(s) get confused. They are not able to determine if Linux system can run a 64 bit kernel version (and application) or not. There is simple way to find out:

(a) Ask your hardware vendor

(b) Find out yourself by reading manuals

(c) Or run the following commands:
Here is output from one of my production Dual Opteron server:
$ less /proc/cpuinfo
Output:

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron (tm) Processor 848
stepping        : 10
cpu MHz         : 2197.161
cache size      : 1024 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall
nx mmxext lm 3dnowext 3dnow
bogomips        : 4308.99
TLB size        : 1088 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp
processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron (tm) Processor 848
....
...
*** Output truncated ***
....

Look for flag entry in above output. If you see lm flags then you will able to run 64 bit kernel and applications. Now consider output from my Workstation (32 bit system you will not able to find out lm [long mode] flag):

$ less /proc/cpuinfo

Output:

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 1
model name      : Intel(R) Celeron(R) CPU 1.70GHz
stepping        : 3
cpu MHz         : 1717.118
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 3437.80

You can also type command uname command to find out this info:

$ uname -a

Output:

Linux ora100 2.6.5-7.252-smp #1 SMP Tue Feb 14 11:11:04 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux

The x86_64 confirms you can run 64 bit apps. You can also use live CD such as Knoppix to boot and find out this info.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 18 comments… read them below or add one }

1 chandar February 1, 2008 at 6:11 am

this was neat and very informative with out any garbage information.. Short and sweet

Reply

2 hvdp August 20, 2008 at 9:43 am

uname -a return information about the installed kernel, not the processor. So if you don’t have the x86_64 you may have however a 64 bit processor

Reply

3 Caner November 6, 2008 at 3:18 pm

very nice trick. Thanks.

Reply

4 McMuffin December 13, 2008 at 12:48 pm

thank you!

Reply

5 saharey February 2, 2009 at 5:58 am

I this info is confusing in my Linux box when I run this command:
cat /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx lm constant_tsc up pni cx16 lahf_lm

and my uname -a command gives this info:

#1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

now what should I conclude does I am using both 32 and 64 bit?

Reply

6 david March 29, 2011 at 6:16 am

$>cat /proc/cpuinfo contains ‘lm’

but $>uname -a contains ‘i686 i686 i386…’

that must mean you are using a 32 bit linux os on a 64 bit capable hardware.

Reply

7 Niels Dettenbach March 29, 2011 at 11:07 am

This is not correct at all – please read the full thread why…

Niels.
http://dettenbach.de

Reply

8 Me Privacy October 31, 2011 at 5:50 am

Sorry Neils, you are quite authoritatively wrong.

uname -i is enough to know if the kernel is RUNNING in 64-bit mode. If it was compiled for amd64 and is able to run (since you are able to run uname), obviously the OS is in 64 bit mode.

Prior to installing a 64-bit OS, you can look at /proc/cpuinfo flags to see if the CPU supports 64 bit mode.

So David’s inference is accurate.

Reply

9 CR February 27, 2009 at 6:51 pm

I think that is showing that you have a CPU capable of 64-bit, but only have the 32-bit linux kernel running on the machine.

Reply

10 Richard June 4, 2009 at 1:45 pm

if you use

uname -i

You will get either ‘i386′ for 32 bit OS or ‘X86_64′ for 64-bit OS.

Reply

11 George July 9, 2009 at 7:01 pm

Thanks a lot!!! Really informative stuff.

Reply

12 Nilesh May 27, 2010 at 2:44 am

My system can run 64bit version of apps and OS. I am running 32bit currently. Changing it to 64bit will give any advantages ?

Reply

13 Niels Dettenbach March 3, 2011 at 7:58 am

“uname” just gives you out how your sys / kernel was compiled and – not the hardware specs – and there are many situations where differences (could) appear there. cat /proc/cpuinfo is not responsible too in many cases (i.e. several Intel XEONs). If uname shows a 64 then you (should) HAVE a 64bit (capable) CPU (in this case you are on step 6 of my “check list” at bottom) – but not vice versa!

Just to sum up the discussion here: To find out if a cpu is 64 bit capable you have the following options – from less responsible to responsible:

1.) uname
2.) getconf LONG_BIT / cat /usr/include/asm/cpufeature.h
3.) cat /proc/cpuinfo
4.) DMI / dmidecode
5.) read the official CPU specs
6.) try to boot a 64bit linux (i.e. live system)

This means uname is the option with the lowest trust in this question – the only reliable way to find out if the CPU is 64bit capable is 6.).

cheers,

Niels.

Reply

14 Ceri James March 4, 2011 at 10:50 am

The “dmidecode” is the best option! You need to be “root” or use “sudo”.

E.g.
sudo dmidecode

Look for
Characteristics:

in the CPU section.

Reply

15 Ceri James March 4, 2011 at 10:54 am

In fact you can use the following:

sudo dmidecode –type processor

Reply

16 Niels Dettenbach March 4, 2011 at 3:48 pm

> The “dmidecode” is the best option!
sorry, but not really, as there are several non working (means non cordect) DMI implementations (from bith sides – regarding hard- as software) out known to be wrong or incorrect.

This is why there are know scenarios where even dmidecode does not give a clear answer to this questions – take a look at some history of dmi implementations and bug reports within the net..

The BEST (means most reliable) options are 5.) – read the official CPU specs or 6.) try to run a 64bit OS.

cheers,

Niels.

Reply

17 Peter April 9, 2012 at 3:09 am

Great info. It makes me more clear about 32bit/b4bit identification

Reply

18 Vijay April 27, 2012 at 7:42 am

Thank you guys for the information. It is really helpful

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous post:

Next post: