I would recommend you to read this wiki page [1].
[1] <
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF>
I was able to configure it on my computer, basically you need to make
sure that you have IOMMU available and enabled, that your GPU card is
in it's own isolated IOMMU group, configure kernel to assign vfio-pci
driver while booting and properly configure guest XML in libvirt.
Everything is described and explained on that wiki page.