-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are avx
and avx2
the **only** CPU flags needed to run MongoDB 5 and higher?
#583
Comments
|
@yosifkit, thanks for that link! I compared my
I'm good now, so you can close this out. Not sure if you want to update the logic here to check for |
Glad you got it figured out! 👍 The warning we added was intended as a hint for users running into issues with the new builds (not to be exhaustive) -- coming up with an exhaustive list of opcodes/features that the compiled binaries provided by MongoDB use is a somewhat complicated proposition, which is why we chose to just use one or two "sentinel" features from the new chipset they're targeting vs the old for showing this warning. |
Hi @loganmarchione, I did create |
@adelynx Did you shutdown the VM, change the CPU to the new custom CPU type, then start the VM? That's all I had to do. |
@loganmarchione I did shutdown the VM. I tried all what you mentioned and too many other solutions none of them worked so I gave up installing MongoDB in Proxmox tbh. |
as of now, you can just use x86-64-v3, which include all these flags |
I'll start by saying I'm sorry this is long and I don't know if this is an issue with my hypervisor, or Mongo in general, or the Mongo Docker image...
I run a hypervisor called Proxmox. On the Proxmox box, I have a virtual machine running Debian 11. On that VM, I have Docker installed and I'm trying to run
mongo:5.0.13-focal
.By default, Proxmox doesn't expose the
avx
andavx2
instructions to VMs (the default CPU type is calledkvm64
and it only has a limited set of flags). Below is what those flags look like inside my Debian 11 VM.When I run this command on my Debian 11 VM, running the default
kvm64
CPU:I receive this error (as intended because of this PR in the Docker image):
The Proxmox team has a way to create custom CPUs with specific flags. See here for documentation. Basically, I added the correct file, shutdown my Debian 11 VM, changed the CPU type, started the VM, and can now see the AVX flags from Debian 11.
When running that same
docker run...
command as before, it doesn't crash and I now see the CPU flags.However, when I try to actually run the container (e.g.,
docker run -it -d mongo:5.0.13-focal
), I get this error indmesg
.Question one: Why is this happening? I have AVX and AVX2 support, so the container should run, right?
To make matters more interesting, the Proxmox support team suggests (one, two, three) to just pass the
host
CPU directly to the VMs (instead of creating a custom CPU type).When I do that, and run
docker run -it --rm mongo:5.0.13-focal grep avx /proc/cpuinfo
, I get these flags (this is from an Intel Core i5-10400).However, this fixes me running
docker run -it -d mongo:5.0.13-focal
. No errors indmesg
and the container stays up.Question two: Are
avx
andavx2
the only CPU flags needed to run MongoDB 5 and higher? Should the PR mentioned earlier be checking for other CPU flags?The text was updated successfully, but these errors were encountered: