Install NVIDIA KVM driver on the host machine, how to use CUDA in MIG instance

Hello,

as far as I know and experienced myself nvidia.runtime=true has some limitations. In particular on default container settings. There are quite a few other posts around this topic:

For all my instances I added the gpu as a device and installed the driver into the container to get it all working smoothly. With a little try and error you will find out the minimum required packages for your application. Important is to install exactly the same version as on your host otherwise you run into some wired situations.

There is a small catch with latest NVidia drivers and CUDA starting with version 545? It requiresto run a small program on the host, something like bandwidth test, before incus starts the instances. Otherwise there will be no NVidia support in the container. Haven’t tried newer versions if this issue is still present.

Hope it helps