I have rather interesting problem. Vfio partly works: It claims audio side of the card, but not graphics card itself:
29:00.0 VGA compatible controller : NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
Subsystem: eVga.com. Corp. GM204 [GeForce GTX 970] [3842:2974]
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia_375_drm, nvidia_375
29:00.1 Audio device : NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1)
Subsystem: eVga.com. Corp. GM204 High Definition Audio Controller [3842:2974]
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
Address is correct at vfio conf:
[~]% cat /etc/modprobe.d/vfio.conf
options vfio-pci ids=10de:13c2,10de:0fbb
I can't blacklist nvidia driver, because my other card is Nvidia too.
I'm running Ubuntu 17.04 with 4.10.0-26-generic, NVidia driver is the newest 375.66. Any suggestions what to do?
I think problem is that nvidia driver is loaded too early. I have tried several tricks to load driver at later stage with no luck. For example blacklisted it at /etc/modprobe/blacklist and tried load it at /etc/initramfs-tools/modules.
I think udev rule which loads vfio stuff before nvidia might do the trick. Tried this, but didn't work. Found udev rules pretty hard to understand. Tried this but it didn't help. Anyone knows how to write udev rule?
[~]% cat /etc/udev/rules.d/50-vfio.rules
SUBSYSTEM=="vfio", ACTION=="add", RUN+="/sbin/modprobe vfio"
SUBSYSTEM=="vfio", ACTION=="add", RUN+="/sbin/modprobe vfio_iommu_type1"
SUBSYSTEM=="vfio", ACTION=="add", RUN+="/sbin/modprobe vfio_pci"
SUBSYSTEM=="vfio", ACTION=="add", RUN+="/sbin/modprobe vfio_virqfd"