Having trouble getting GPU to passthrough for Windows VM

Hi there, newb user to Linux switching over from Win10 to Kubuntu.
I was hoping someone could point me in the right direction for some difficulties I can’t figure out.
I’ve gone through the steps that many forums/tutorials have listed but can’t get the GPU to passthrough.
I got the IOMMU groups needed to make the VFIO work, but the nvidia driver keeps grabbing the GPU instead of the VFIO.
The blacklist placed on the nvidia driver isn’t working.
The GPU’s audio device however is getting grabbed by the IOMMU but the gpu itself isn’t.

Specs:
Geforce GTX 1060 6GB
GeForce GTX 660
Intel Core i5 8600 Core 3 10GHz LGA1151 Processor
Asus ROG Strix Z370-H Gaming LGA 1151 ATX Motherboard

The 1060 is the one I intend to passthrough and the 660 is for linux.

I had this issue with my amd gpu initially. You need to add the vfio driver to the kernel command line. Blacklisting doesn’t work if the kernel grabs it first.

Thank you for the fast reply.
How do I add the VFIO to the kernal command line?

First get your gpu’s video pci id with:

lspci -nnk

Its the alphanumeric set of 8 characters separated by a colon, such as 10de:13c2

Add them to your kernel command line. Not familiar with Kubuntu, but assuming you’re on Grub2, go to /etc/default/grub
Edit the command line to include at the end:
vfio-pci.ids=10de:13c2,10de:0fbb
Replace the pci ids with your gpu pci id (this would be how to set it up for two gpus)

Run:

update-grub

To verify:

cat /proc/cmdline

Reboot and let us know if you have issues.

Thanks for that.
I’ve tried a few different versions of the grub changes and none have worked yet.
I’ll try tomorrow cause AUTZ.

To clarify, the “cat /proc/cmdline” shows what you booted with, not what was changed during this session. Sorry, that wasn’t very clear.

Grub is always a pain, don’t get too frustrated if you have issues.

That will not work because the VFIO kernel module needs to be initialized in initramfs BEFORE your video driver.