How do I passthrough AVX/"host" cpu type to a docker container?

I’m trying to deploy Filecloud Community Edition via a docker container, to test it out.

MongoDB version 6+ says that it needs a CPU with AVX instructions.

My dual Intel Xeon 2697A v4s does have the AVX instruction set (according to wikipedia) and I was able to confirm that in the Ubuntu VM where this is being deployed/tested.

I’ve tried to google "docker" "cpu-type" and I’m not really finding much in the way of any documentation that talks about how to change the CPU type of the docker container from “Common KVM Processor” to “host”.

If anybody has some experience passing AVX through to a docker container, your help is greatly appreciated.

Thank you.

Seeing you mention “Common KVM Processor” I’m assuming you are running Docker in a VM. Your hypervisor definitely has options to configure which type of CPU is presented to the guest OS.

For instance, on Proxmox, you would find the option under VM settings → CPU Type. Changing this to ‘host’ will present all CPU flags (ie. including AVX extensions)

You don’t need to pass CPU features. It’s not a device. Make sure the underlying vm is set to host-passthrough.