Proxmox VM missing CPU Flag for MongoDB installation

Problem

You want to install MongoDB, e.g. version 8.0, but it fails and you get warnings like e.g.:

"Your CPU is no longer officially supported by MongoDB themselves"
 

Cause

MongoDB requires CPUs with AVX (Advanced Vector Extensions) support. If your Proxmox VM is not configured to expose the hardware host CPUs AVX feature to the guest VM. The VM will report no AVX support and MongoDB may fail to run or use a non‑compatible binary.

Solution 

Source: https://forum.proxmox.com/threads/cpu-with-avx-support.146138/#post-716615 from iscrow from Oct 31, 2024:


My solution was to define a new CPU model based on x86-64-v2-AES that also exposes AVX

New models can be defined here cluster wide:
/etc/pve/virtual-guest/cpu-models.conf

Add this definition to the /etc/pve/virtual-guest/cpu-models.conf file:

cpu-model: x86-64-v2-AES-AVX
flags +avx;+avx2;+xsave;+aes;+popcnt;+ssse3;+sse4_1;+sse4_2
phys-bits host
hidden 0
hv-vendor-id proxmox
reported-model kvm64

It will then be immediately available in the GUI as a Custom (QEMU) CPU:


1730381574184.png 

Example

  1. Create /etc/pve/virtual-guest/cpu-models.conf on your proxmox system to create a new cpu-model
  2. Put in the following lines:

    cpu-model: x86-64-v2-AES-AVX
    flags +avx;+avx2;+xsave;+aes;+popcnt;+ssse3;+sse4_1;+sse4_2
    phys-bits host
    hidden 0
    hv-vendor-id proxmox
    reported-model kvm64

  3. Select in the Proxmox GUI in the settings of the VM "x86-64-v2-AES-AVX" 
    or
    edit on the Proxmox CLI the conf-file of the VM /etc/pve/qemu-server/*VM ID*.conf and set cpu to custom-x86-64-v2-AES-AVX:

    root@prxmuc26:~#
    root@prxmuc26:~# cat /etc/pve/qemu-server/202.conf
    boot: order=scsi0;ide2;net0
    cores: 1
    cpu: custom-x86-64-v2-AES-AVX
    ide2: local:iso/debian-13.3.0-amd64-netinst.iso,media=cdrom,size=754M
    memory: 2048
    meta: creation-qemu=10.1.2,ctime=1773517174


  4. Reboot the VM
  5. Check inside the VM the following commands to see if avx is available:

    debfad@VMdebUni:~$
    debfad@VMdebUni:~$ grep -o -w 'avx' /proc/cpuinfo 
    avx
    debfad@VMdebUni:~$



No comments:

Post a Comment

Proxmox VM missing CPU Flag for MongoDB installation

Problem You want to install MongoDB, e.g. version 8.0, but it fails and you get warnings like e.g.: "Your CPU is no longer officially s...