How to Check X86_64 Versions in Linux

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
390
Reaction score
467
Credits
14,550
Recently I came across a problem when installing a VirtualBox machine for CentOS 10 Stream.

I kept getting a kernel panic error when installing the Operating System (OS). Nothing I did fixed it.

Everyone on the Internet made a response that I needed to enable my Virtualization. Guess what? I had it enabled, because other Distros ran fine. So, I knew it was specifically an error with CentOS 10 Stream.

Red Hat has set requirements for processor code (micro-architecture) which only works with newer processors.

Instruction Set

The base 64-bit processors had the general instruction set. When a new base instruction set came out, around 2008, it included SSE3, SSE4.1, and SSE4.2 and was called x86-64v2.

Streaming SIMD Extensions 3 (SSE3) allows for better handling of gaming systems. The SSE4.1 and SSE4.2 allow for instructions to help with things other than gaming.

The process has these functions built into it to help speed up specific instruction types.

To be clear, the SSE3, SSE4.1 and SSE4.2 are all part of x86_64v2.

There is also x86_64v3 and x86_64v4. Currently, there is no version 5.

x86-64-v3

Version 3 of the instruction set includes bit manipulation and AVX2, MOVBE, FMA.

Advanced Vector Extensions (AVX) is an improvement to allow the use of integer commands up to a size of 256 bits.

The Move Data After Swapping Bytes (MOVB) instruction allows for swapping data to (write) or from RAM (read).

Fused-Multiply-Add (FMA) allows for the multiplication and addition of integers in a single operation without requiring multiple steps. This speeds up operations of math functions.

x86-64-v4

Version 4 of the instruction set contains Advanced Vector Extensions for 512 bit (AVX-512) which allows for two 512 bit instructions in a single operation. This doubles the capability from AVX2.

AVX-512 helps improve processing of data sets and especially ray tracing.

What does all this mean for Linux?

What this means for right now is that CentOS 10 Stream requires x86-64-v3. CentOS 9 Stream still works on x86-64-v2.

Speculation is that Fedora will be as well at some point.

You may wonder if this only affects Red Hat distros on Virtual Box. This is not the case. If you try to install the OS on the hardware directly, it will not work either. The micro-architecture passes through to the VirtualBox machine.

Other Linux Distros might follow suit at some point. Most have already dropped support for 32-bit processors.

If other distros follow suit, then some people may need to get upgraded systems.

Determining Your Version

If you are looking to change distros or perform an upgrade, you will need to know what version of micro-architecture you have in your CPU.

So, within Linux, you need to perform the following command in a terminal:

Code:
/usr/lib64/ld-linux-x86-64.so.2 --help

The response should show you which versions of the micro-architecture are available. Of course, if you have a version, then you have all the lower versions as well. You can see the output in Figure 1.

Figure 1.jpg

FIGURE 1

You can see that this system has support for Version 2 and Version 3, but no support for Version 4.

As long as you have support for Version 3, you can run CentOS 10 Stream as your main OS, or on VirtualBox since the hardware micro-architecture is still present while being virtualized.

Conclusion

In the future, there may be more Linux distros that require certain micro-architecture instruction sets. You can always run a Live CD to test your instruction set version.

Be aware when buying a new system that you may need to check these requirements for running Red Hat Distros, or at least the newer ones.
 
Last edited by a moderator:


sudo uname -ar

command also give Info.

and with your command all Info we see with my command together
 
So, within Linux, you need to perform the following command in a terminal:

/usr/lib64/ld-linux-x86-64.so.2 –help

It's not working here, I'm using Debian 12:

Bash:
/usr/lib64/ld-linux-x86-64.so.2 –help
–help: error while loading shared libraries: –help: cannot open shared object file
 
I guess this is a politically correct program that identifies as...

Code:
This program interpreter self-identifies as: /lib64/ld-linux-x86-64.so.2

.....
Shared library search path:
  (libraries located via /etc/ld.so.cache)
  /lib64 (system search path)
  /usr/lib64 (system search path)

Subdirectories of glibc-hwcaps directories, in priority order:
  x86-64-v4 (supported, searched)
  x86-64-v3 (supported, searched)
  x86-64-v2 (supported, searched)
ansible@LianLi:~$ file /usr/lib64/ld-linux-x86-64.so.2
/usr/lib64/ld-linux-x86-64.so.2: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), static-pie linked, BuildID[sha1]=2a596
04186d5fbec715f683557fd69077886233a, with debug_info, not stripped
 
help: error while loading shared libraries: –help: cannot open shared object file

Are you using two dashes, or one?

Code:
/usr/lib64/ld-linux-x86-64.so.2 --help

dash help doesn't work, but dash dash help does.
 
  • Like
Reactions: Rob
I usually don't like posting random links to some application from someone I don't know, but this seems to work.
If you're the trusting sort...
He does post the source code.

Code:
wget https://raw.githubusercontent.com/HenrikBengtsson/x86-64-level/main/x86-64-level

chmod +x x86-64-level

./x86-64-level

I simply get a 3 on one system and a 4 on this system.
 
Are you using two dashes, or one?
Already tried that, same error:

Bash:
/usr/lib64/ld-linux-x86-64.so.2 -–help
-–help: error while loading shared libraries: -–help: cannot open shared object file
 
I usually don't like posting random links to some application from someone I don't know, but this seems to work.
If you're the trusting sort...
He does post the source code.

Code:
wget https://raw.githubusercontent.com/HenrikBengtsson/x86-64-level/main/x86-64-level

chmod +x x86-64-level

./x86-64-level

I simply get a 3 on one system and a 4 on this system.
wait İ will check
 
A shared object library is exactly that, a library file. This file is not an executable binary. It is intended to be linked into an executable program when it is run, rather than being run directly. It didn't work for me with one dash or two. Can you suggest another commonly available program in Linux that might provide this information? I know ffmpeg lists stuff like this.

Signed,

Matthew Campbell
 
Maybe it's a fedora/redhat thing?

It works in fedora 41, rocky 9.4 and alma 10.
 
I bet that double-dash got wrecked as he pasted it in.. I just updated his original post so it shows the double-dash. Thanks!
Thanks Rob, I didn't notice it changed it it when I pasted it in.
 
Maybe it's a fedora/redhat thing?
I'm pretty sure reason why it doesn't work on Debian is because lib64 directory contains only this file, so the so can't find shared libraries because it's directly invoked.

Do you have any other files in lib64 directory beside this one on fedora?
 
I found this script, but I didn't get to test it...

Code:
#!/bin/sh -eu

flags=$(cat /proc/cpuinfo | grep flags | head -n 1 | cut -d: -f2)

supports_v2='awk "/cx16/&&/lahf/&&/popcnt/&&/sse4_1/&&/sse4_2/&&/ssse3/ {found=1} END {exit !found}"'
supports_v3='awk "/avx/&&/avx2/&&/bmi1/&&/bmi2/&&/f16c/&&/fma/&&/abm/&&/movbe/&&/xsave/ {found=1} END {exit !found}"'
supports_v4='awk "/avx512f/&&/avx512bw/&&/avx512cd/&&/avx512dq/&&/avx512vl/ {found=1} END {exit !found}"'

echo "$flags" | eval $supports_v2 || exit 2 && echo "CPU supports x86-64-v2"
echo "$flags" | eval $supports_v3 || exit 3 && echo "CPU supports x86-64-v3"
echo "$flags" | eval $supports_v4 || exit 4 && echo "CPU supports x86-64-v4"
 
I wrote my own long time ago, before I learned about so library:

Code:
#!/usr/bin/awk -f

BEGIN {
 # Collect CPU features from lscpu
cmd = "lscpu | grep 'Flags:' | awk '{for (i=2; i<=NF; i++) print $i}'"
while (cmd | getline) {
features = features " " $0
}
close(cmd)

 # Define required features for each x86-64-v level
levels[1] = "lm cmov cx8 fpu fxsr mmx syscall sse2"
levels[2] = "cx16 lahf_lm popcnt sse4_1 sse4_2 ssse3"
levels[3] = "avx avx2 bmi1 bmi2 f16c fma abm movbe xsave"
levels[4] = "avx512f avx512bw avx512cd avx512dq avx512vl"

level = 0
missing = ""

 # Check features for each level
for (i = 1; i <= 4; i++) {
level_met = 1
split(levels[i], flags, " ")
missing = ""
for (j in flags) {
if (features !~ flags[j]) {
missing = missing flags[j] " "
level_met = 0
}
}
if (level_met == 1) {
level = i
} else {
print "Current level: x86-64-v" level
print "Missing for x86-64-v" i ": " missing
exit i
}
}

 # Report the highest supported level
print "Current level: x86-64-v" level
exit level + 1
}

Result:
Code:
$ ./x86_64_level.sh 
Current level: x86-64-v3
Missing for x86-64-v4: avx512f avx512bw avx512cd avx512dq avx512vl

Intel Core 2 Duo laptop:
Code:
$ ./x86_64_check.sh
Current level: x86-64-v1
Missing for x86-64-v2: popcnt sse4_2
 



Top