MAAS, LXD GPU pass through for K8s

Hi everyone,

I have a fresh MAAS installation with LXD, in the metal I have 2X GPUs RTX2080s

The main MAAS controller recognises all the GPUs as show below:

NVIDIA Corporation 10de TU104 [GeForce RTX 2080] 1e82 nvidia	0	0000:04:00.0
Matrox Electronics Systems Ltd. 102b G200eR2 0534 mgag200	0	0000:0b:00.0
NVIDIA Corporation 10de TU104 [GeForce RTX 2080] 1e82 nvidia	1	0000:82:00.0

However when I begin creating VMs I have the following under GPUs

Red Hat, Inc. 1af4 Virtio GPU 1050 virtio-pci	0	0000:04:00.0

The objective is to use these GPUs in Kubernetes(K8s) workloads for AI and rendering work, I need a guide on how to do this?

thanks Luke

Hi,

You would need to setup gpu passthrough in the hypervisor you are using

I am doing this on my system. What I had to do:

  1. Create/commission the vm in MAAS
  2. From the cli, add the gpu devices
    lxc config device add ${INSTANCE} gpu0 gpu gputype=physical pci=03:00.0
    Note: use your INSTANCE name and appropriate pci entry (from lspci)
  3. deploy the vm and install the nvidia drivers
  4. reboot vm

That’s it. Now when I shell to the vm, I can run nvidia-smi and it shows up.