openimsdk / open-im-server

IM Chat
https://openim.io
Apache License 2.0
13.99k stars 2.45k forks source link

MongoDB 5.0+ AVX Support Requirement Warning on Non-AVX System #1533

Closed cubxxw closed 10 months ago

cubxxw commented 10 months ago

Issue Description: Problem I encountered a warning message while attempting to run MongoDB 5.0+ on my system. The warning message states: "WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!" However, my system does not support the AVX instruction set.

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://jira.mongodb.org/browse/SERVER-54407
  see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

/usr/local/bin/docker-entrypoint.sh: line 423:    29 Illegal instruction     (core dumped) "${mongodHackedArgs[@]}" --fork

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://jira.mongodb.org/browse/SERVER-54407
  see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

/usr/local/bin/docker-entrypoint.sh: line 423:    28 Illegal instruction     (core dumped) "${mongodHackedArgs[@]}" --fork

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://jira.mongodb.org/browse/SERVER-54407
  see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

/usr/local/bin/docker-entrypoint.sh: line 423:    28 Illegal instruction     (core dumped) "${mongodHackedArgs[@]}" --fork

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://jira.mongodb.org/browse/SERVER-54407
  see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

/usr/local/bin/docker-entrypoint.sh: line 423:    28 Illegal instruction     (core dumped) "${mongodHackedArgs[@]}" --fork

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see http

Environment

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@docker-server-02:~/aa-im-server# lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         40 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-7
Vendor ID:               GenuineIntel
  Model name:            QEMU Virtual CPU version 2.5+
    CPU family:          15
    Model:               107
    Thread(s) per core:  1
    Core(s) per socket:  2
    Socket(s):           4
    Stepping:            1
    BogoMIPS:            4199.99
    Flags:               fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni ssse3 cx16 sse4_1 sse4
                         _2 x2apic popcnt aes hypervisor lahf_lm cpuid_fault pti
Virtualization features:
  Hypervisor vendor:     KVM
  Virtualization type:   full
Caches (sum of all):
  L1d:                   256 KiB (8 instances)
  L1i:                   256 KiB (8 instances)
  L2:                    32 MiB (8 instances)
  L3:                    64 MiB (4 instances)
NUMA:
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-7
Vulnerabilities:
  Gather data sampling:  Not affected
  Itlb multihit:         KVM: Mitigation: VMX unsupported
  L1tf:                  Mitigation; PTE Inversion
  Mds:                   Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
  Meltdown:              Mitigation; PTI
  Mmio stale data:       Unknown: No mitigations
  Retbleed:              Not affected
  Spec rsta

Steps to Reproduce:

  1. Install MongoDB 5.0+ on a system without AVX support.
  2. Attempt to run MongoDB.

Expected Behavior: MongoDB should run without warnings or errors on systems without AVX support.

Actual Behavior: A warning message is displayed, indicating that MongoDB 5.0+ requires AVX support.

Additional Information: I understand that MongoDB 5.0+ may require AVX support for performance reasons, but I'm looking for a workaround or solution to run MongoDB on my non-AVX system.

Possible Solutions:

  1. Lower MongoDB Version: Consider using a lower version of MongoDB that does not require AVX support. You can download an earlier version from the MongoDB website or package repositories.
  2. Use Alternative Databases: If running MongoDB on your system is not feasible due to the lack of AVX support, explore alternative database solutions that do not have this requirement. You can consider databases like MySQL, PostgreSQL, or others that are compatible with your system.
  3. Community Patches or Forks: Check if there are any community-driven patches or forks of MongoDB that have been modified to work on systems without AVX support. Sometimes, the open-source community may provide alternative builds or patches to address specific issues.

Please note that the choice of solution depends on your specific requirements and constraints. MongoDB's AVX requirement is there for performance enhancements, so using an earlier version or alternative databases may come with trade-offs in terms of performance.

kubbot commented 10 months ago

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


The system is running on the Ubuntu 22.04.3 LTS operating system. The CPU is a virtual CPU (QEMU Virtual CPU version 2.5+) and runs on the x86_64 architecture. Here are some key information about your system:

OS information:

CPU Information:

There are no obvious errors or issues with the configuration. Your OS is Ubuntu 22.04.3 LTS and the CPU is virtualized QEMU Virtual CPU.

The problem mentioned in the error message is that MongoDB 5.0+ requires the CPU to support the AVX instruction set, and the model information of your virtual CPU is "QEMU Virtual CPU version 2.5+". Typically, virtualized environments emulate basic CPU functionality but may not necessarily support all specific CPU instruction sets.

The cause of the problem may be that the version of MongoDB you are running requires the system to support the AVX instruction set, and the CPU in the virtualized environment does not meet this requirement. This is a reasonable error because MongoDB 5.0+ may rely on the AVX instruction set to improve performance.

To resolve this issue, you may consider the following options:

  1. Downgrade MongoDB version: Install older versions of MongoDB, which may not require AVX support.
  2. Check virtualization settings: If you are running the system in a virtual machine, check the configuration options of the virtual machine manager (such as KVM) to ensure that the virtual CPU emulation meets MongoDB requirements. Sometimes you can provide more instruction set support by adjusting the virtual CPU's configuration.
  3. Consider physical hardware: If a virtualized environment cannot meet your requirements, you may want to consider running MongoDB on physical hardware that supports the AVX instruction set.
cubxxw commented 10 months ago

@charles-chenzz

kubbot commented 10 months ago

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


@charles-chenzz

cubxxw commented 10 months ago

用MongoDB 4.4 LTSθ―•θ―•

kubbot commented 10 months ago

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


Try it with MongoDB 4.4 LTS

charles-chenzz commented 10 months ago

resolve by enabling AVX in vm /close

cubxxw commented 10 months ago

/close

kubbot commented 10 months ago

We value close connections with our users, developers, and contributors here at Open-IM-Server. With a large community and maintainer team, we're always here to help and support you. Whether you're looking to join our community or have any questions or suggestions, we welcome you to get in touch with us.

Our most recommended way to get in touch is through Slack. Even if you're in China, Slack is usually not blocked by firewalls, making it an easy way to connect with us. Our Slack community is the ideal place to discuss and share ideas and suggestions with other users and developers of Open-IM-Server. You can ask technical questions, seek help, or share your experiences with other users of Open-IM-Server.

In addition to Slack, we also offer the following ways to get in touch:

kubbot commented 10 months ago

πŸ€– Auto-closing issue, if you still need help please reopen the issue or ask for help in the community above