Any plans for GPU in KVM?

I’m getting more and more requests from users to get access to the GPUs we have in our bare metal racks. Tesla V100s, to be precise, to run workloads. Are there any plans to include this as a resource we can add to a KVM host? Are there any good tutorials for making GPUs available as a resource?

Thank you!

2 Likes

I believe if you orchestrate with Juju/LXD you can without too much pain, spin up GPU workload-ready containers/metal/k8s.

MAAS 2.8 includes support for LXD VM hosts. We plan to eventually support GPU’s but do not currently have an ETA.

In the meantime you can manually add GPUs or other resources to a VM MAAS creates.

Is there documentation for manually adding GPU or other resources to VMs that MAAS creates? Can you point me in that direction?

@jonathanhatch, we don’t have any in the MAAS doc yet, but I’m going to go look for KVM/LXD doc on that and see what I can find. If I find it, I’ll let you know and also add it as a reference to the doc.

Thank you, Bill. I really appreciate that!

@jonathanhatch the underlying VM provider in MAAS is moving to LXD, which can certainly do PCIE passthrough to containers and, if it doesn’t already, will soon do the same for VMs. All the KVM hosts in a single MAAS rack will become a LXD cluster. Suggest you dig into LXD and then you’ll be ahead of the curve :slight_smile:

1 Like

lxc config device add NAME-OF-INSTANCE gpu1 gpu pci=ADDR

This was introduced in LXD 4.2 but is getting backported to 4.0.x too (is in 4.0.2 that will hit stable tomorrow).

Note that instead of pci=ADDR you can also select based on productid/vendorid if that’s more convenient.

I have such a VM here that’s managed by MAAS:

root@athos:~# lxc config show maas-vm12
architecture: x86_64
config:
  volatile.eth0.hwaddr: 00:16:3e:73:1f:58
  volatile.eth1.hwaddr: 00:16:3e:73:e3:7a
  volatile.last_state.power: STOPPED
  volatile.vm.uuid: 63f91205-2ee8-47ac-9406-d821210c6f7c
devices:
  gpu1:
    pci: "0000:04:00.0"
    type: gpu
  gpu2:
    pci: "0000:82:00.0"
    type: gpu
ephemeral: false
profiles:
- maas
stateful: false
description: ""
1 Like