Is there any way to use MxGPU enabled graphics cards in lxd containers.
I can see there is support for sriov nics but not gpus. I don’t mind sharing the gpu as it is with virtual functions disabled.



So we’ve received hardware to work on GPU SR-IOV using the mxgpu driver, but even though we can easily enough get the card to show all the VFs, as far as we can tell, there’s no way to bind the driver itself to those functions.

I’m assuming you’re using AMD hardware (unless I missed someone else doing GPU SR-IOV), if that’s the case, we’re currently poking at some of their drivers to see what’s needed to bind a VF rather than the primary function but so far without a whole lot of success.


Yes, I am using AMD hardware.
Is it possible to share the primary function across all containers in the host using it is a normal GPU for now?
I understand that GPU sharing is easier in LXD.


Yes, that should be fine, but that means the scheduling (resource division) ends up being up to the driver and I don’t know exactly what AMD does for that.

On the NVIDIA side, some cards only allow a single workload to use the card at once, on some others it does basic time division and on others it’s got a complex configurable scheduler, I don’t know what AMD does on their cards.

Is it possible to test that easily? with my limited knowledge of lxd and linux in general i can do it if you give me pointers.

Find an OpenCL test application and run two instances of it at the same time on the same GPU and see if both are running at the same time or if the second one waits for the first to be done.

This isn’t container specific so can be tested even outside of LXD.

@stgraber: I just got the confirmation from AMD that MxGPU is not supported for Linux guests. So i believe their linux driver isn’t compatible with Virtual functions of MxGPU.