Hi, and thanks for the tips everyone.
Using https://lab.piszki.pl/cloudstack-kvm-and-running-vm-with-vgpu/ as a guide,
I got the Radeon Pro WX 5100 PCI id's and modified Grub on my Ubuntu 20.04 host
with this:
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on kvm.ignore_msrs=1
vfio-pci.ids=1002:67c7,1002:aaf0"
The Radeon card can now be assigned easily to Linux guests by adding this in
the Cloudstack WebUI (Compute, Instances, then select the Instance, Settings)
instance settings:
#Name:
extraconfig-1
#Value:
<devices>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0xd9' slot='0x00' function='0x0'/>
</source>
<alias name='hostdev0' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'
multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0xd9' slot='0x00' function='0x1'/>
</source>
<alias name='hostdev1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07'
function='0x1'/>
</hostdev>
</devices>
Linux guests work perfectly, the card is detected and is available straight
away.
However with a Windows guest I have had nothing but problems!
The Radeon device will turn up OK inside the Windows guest when passed through
with these 2x settings:
#Name:
extraconfig-1
#Value:
<features>
<hyperv>
<vendor_id state='on' value='randomid'/>
</hyperv>
</features>
#Name:
extraconfig-2
#Value:
<devices>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0xd9' slot='0x00' function='0x0'/>
</source>
<alias name='hostdev0' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'
multifunction='on'/>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0xd9' slot='0x00' function='0x1'/>
</source>
<alias name='hostdev1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x00'
function='0x1'/>
</hostdev>
</devices>
But when I install the AMD video driver (the onboard audio installs
automatically) and then reboot, the system always hangs.
I have tried multiple Windows OS versions and multiple AMD driver versions.
I don't know whether the AMD driver is broke, or this card is just not
supported somehow.
If anyone has any ideas I would be pleased to hear them.
Many thanks, Jim