Fatal glibc Error "CPU does not support" on CentOS 9
This error occurs when trying to run binaries compiled for newer CPU instructions on older hardware, or when glibc detects CPU features that aren't supported.
What Causes This Error?
The error "Fatal glibc error: CPU does not support" typically happens because:
- Binary compiled for newer CPU - Software compiled for modern CPUs with AVX/AVX2 instructions
- Hardware incompatibility - Older CPU doesn't support required instructions
- Virtualization issues - VM not exposing required CPU features
- Glibc version mismatch - Incompatible glibc version
Error Message
Fatal glibc error: CPU does not support x86-64-v2
Or similar messages indicating missing CPU features.
Solution 1: Check CPU Features
First, check what CPU features your system supports:
cat /proc/cpuinfo | grep flags
Look for flags like:
avx- Advanced Vector Extensionsavx2- AVX2 instructionssse4_2- SSE 4.2 instructions
Solution 2: Enable CPU Features in Virtualization
If running in a VM (VirtualBox, VMware, etc.):
VirtualBox
- Power off the VM
- Go to VM Settings → System → Processor
- Enable "Enable PAE/NX"
- Enable "Enable VT-x/AMD-V"
- Enable "Enable Nested VT-x/AMD-V"
- Increase CPU count if needed
VMware
- Edit VM settings
- Go to Processors
- Enable "Virtualize Intel VT-x/EPT or AMD-V/RVI"
- Enable "Virtualize CPU performance counters"
KVM/QEMU
Edit VM configuration to expose CPU features:
<cpu mode='host-passthrough'>
<feature policy='require' name='avx'/>
<feature policy='require' name='avx2'/>
</cpu>
Solution 3: Reinstall glibc
If glibc is corrupted or incompatible:
# Backup current glibc
cp -r /lib64/libc.so.6 /lib64/libc.so.6.backup
# Reinstall glibc
yum reinstall glibc
# or
dnf reinstall glibc
Solution 4: Use Compatible Binary
If the binary is compiled for newer CPUs:
Option A: Recompile from Source
Compile the software on your server to match your CPU:
# Download source code
wget https://source-url/software.tar.gz
tar -xzf software.tar.gz
cd software
# Configure for your CPU
./configure --disable-avx --disable-avx2
# Compile
make
make install
Option B: Use Older Version
Use an older version of the software that supports your CPU:
# Check available versions
yum list available package-name
# Install older version
yum install package-name-version
Solution 5: Update System and glibc
Ensure your system and glibc are up to date:
# Update system
yum update -y
# or
dnf update -y
# Check glibc version
ldd --version
# Update glibc if needed
yum update glibc
Solution 6: Check Binary Requirements
Check what CPU features the binary requires:
# Install binutils if not present
yum install binutils
# Check binary requirements
objdump -p /path/to/binary | grep -i flags
# Or use readelf
readelf -A /path/to/binary
Solution 7: Use Docker/Containers
Run the application in a container with compatible CPU settings:
# Create Dockerfile
cat > Dockerfile << EOF
FROM centos:9
# Your application setup
EOF
# Build with CPU compatibility
docker build --build-arg BUILDPLATFORM=linux/amd64 .
Solution 8: Virtual CPU Configuration
If using virtualization, configure CPU compatibility:
For KVM
Edit VM XML configuration:
<cpu mode='custom' match='exact'>
<model fallback='allow'>Haswell</model>
</cpu>
Or use host-passthrough for full CPU feature access:
<cpu mode='host-passthrough'/>
Prevention
To prevent this issue:
- Check CPU before installation - Verify CPU supports required features
- Use compatible binaries - Download/compile for your CPU architecture
- Virtualization settings - Properly configure CPU features in VM
- Test in staging - Test software compatibility before production
Diagnostic Commands
Run these commands to diagnose the issue:
# Check CPU model
lscpu
# Check CPU flags
cat /proc/cpuinfo | grep flags
# Check glibc version
ldd --version
# Check system architecture
uname -m
# Test binary compatibility
file /path/to/binary
ldd /path/to/binary
FAQ
Can I upgrade my CPU to fix this?
If using physical hardware, you'd need to replace the CPU. In virtualization, adjust VM CPU settings.
Will this affect all software on my server?
Only software compiled for newer CPUs will be affected. Most standard packages work on older CPUs.
Is there a way to emulate missing CPU features?
No, CPU instructions cannot be emulated. You need actual CPU support or compatible binaries.
Should I use a different Linux distribution?
CentOS 9 requires modern CPUs. Consider CentOS 7 or RHEL 7 if you have older hardware.