[ovirt-users] How to passthrough GPU to windows guest

Martin Polednik mpolednik at redhat.com
Tue Mar 28 07:17:07 UTC 2017


On 28/03/17 02:12 +0800, yimao wrote:
>Hi,
>
>I'm trying to passthrough gpu card to windows 7 guest, but I got the
>error code 43.
>I use ovirt node: ovirt-node-ng-installer-ovirt-4.1-2017032304.iso and
>ovirt-engine-appliance-4.1-20170322.1.el7.centos.noarch.rpm
>I have added  options "intel_iommu=on rdblacklist=nouveau
>pci-stub.ids=10de:1380,10de:0fbc" to the grub.conf and attached these
>devices to the guest. After I have installed the gpu's driver, I got
>the error code 43.
>Did I miss something? Any pointers or suggestions would be greatly appreciated.

You are most likely using consumer grade GPU that errors out in
Windows if it's running under virtualized environment. You could try
using the following hook (make sure it's in
/usr/libexec/vdsm/hooks/before_vm_start and it's executable bit is set
(chmod +x ...)).

Just copy paste the following block to a bash and try to start the VM
again.

cd /usr/libexec/vdsm/hooks/before_vm_start
cat << EOF >> 99_mask_kvm
#!/usr/bin/python2

import hooking
domxml = hooking.read_domxml()

hyperv = domxml.getElementsByTagName('hyperv')[0]
smm = domxml.createElement('vendor_id')
smm.setAttribute('state', 'on')
smm.setAttribute('value', 'whatever')
hyperv.appendChild(smm)

features = domxml.getElementsByTagName('features')[0]
kvm = domxml.createElement('kvm')
hidden = domxml.createElement('hidden')
hidden.setAttribute('state', 'on')
kvm.appendChild(hidden)
features.appendChild(kvm)

hooking.write_domxml(domxml)
EOF
chmod +x 99_mask_kvm


>Thanks in advance.
>Yiimao Yang.


More information about the Users mailing list