"required=false" for GPU device?


I try to use a set of default profiles to configure containers. One of this profiles forwards the gpu to the container. This works fine on bare metal, but fails when inside kvm (Failed to detect requested GPU device).

Is there something like the “required” property for usb devices for GPUs?

Hi …

Well if I understand correctly you have LXD and LXC on your bare metal and you have profiles for it that manage PCI Passthrough (GPU for your containers). The way that happens in my understanding it’s because Nvidia has a component called nvidia-container-runtime that communicates with LXC.

Now you want the same on KVM right ?
I don’t believe that KVM has anything like that. But I can suggest this.


Also take a look on this…



I’m not looking to forward a GPU into KVM. I want lxd to not fail if there is no GPU on the host (be it kvm or something else). As things look today, I have to implement some logic to setup GPU forwarding conditionally.

I’d like to write something like:
lxc config device add jessie gpu0 gpu gid=44 required=false

@brauner should be easy enough to implement right?