GPU Passthrough with 2 NVIDIA card (1 host, 1 KVM)

Hi all, was thinking whether there is a way to do a GPU pass-through with two nvidia cards which 1 using for host while the other one using for VM.

Current setting:
pci-stub blocking two nvidia card being load from the default driver (nvidia & nouveau)

Tried:
If only block on 1 card, the host will get the nvidia or nouveau driver before the pci-stub blocking on another card kick in…

Just wonder whether there is a way to run 1 card on NVIDIA or nouveau driver while the other card still blocked for VM use…

Thank you. =)

You get my virgin post…
With vfio, yes. Not pcistub.
I don’t know your specifics, but the vfio driver does allow the nouveau driver to hook and unhook, no blacklist. It can even yank the host card for a vm and pass it back on vm close.

`root@stretch:/var/log# lspci -v -d 10de:

03:00.0 VGA compatible controller: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev a2) (prog-if 00 [VGA controller])
Subsystem: Gigabyte Technology Co., Ltd GM107 [GeForce GTX 750 Ti]
Flags: bus master, fast devsel, latency 0, IRQ 77, NUMA node 0
Kernel driver in use: nouveau
Kernel modules: nouveau

03:00.1 Audio device: NVIDIA Corporation Device 0fbc (rev a1)
Subsystem: Gigabyte Technology Co., Ltd Device 36ca
Flags: bus master, fast devsel, latency 0, IRQ 74, NUMA node 0
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel

04:00.0 VGA compatible controller: NVIDIA Corporation GK107GL [Quadro K600] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Hewlett-Packard Company GK107GL [Quadro K600]
Flags: bus master, fast devsel, latency 0, IRQ 29, NUMA node 0
Capabilities: [100] Virtual Channel
Kernel driver in use: vfio-pci
Kernel modules: nouveau

04:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1)
Subsystem: Hewlett-Packard Company GK107 HDMI Audio Controller
Flags: fast devsel, IRQ 47, NUMA node 0
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel

`
You can use two identical cards.