Created attachment 1326556 [details]
Patch provided by customer
Add support in qemu-kvm for the "hidden state" feature in libvirt to prevent VMs from seeing that they're VMs
Virtual Linux guests using PCI-passthrough of an NVidia graphics card fail with a driver error. The error from the NVidia driver indicates it is not compatible with the passed-through graphics card (P400), but this is not correct.
The NVidia driver is apparently detecting that it is running in a KVM virtual environment, and fails to load. If the KVM signature is "hidden" from the guest CPU features, then the NVidia driver loads and runs normally. The libvirt XML schema provides the means to hide the KVM signature with the "<hidden state='on'/>" tag in the <kvm> features section. This causes the "kvm=off" parameter to be added to the "-cpu" section of the qemu-kvm command line invocation.
However, the version of qemu-kvm shipped with RHEL7.4 does not honor this flag, and instead exits with an error. I'm marking this as a bug, since the shipping libvirtd *does* support this capability, as does the upstream version of qemu, however Red Hat has chosen not to implement the capability in their shipping version.
I've attached a patch that adds this capability to the qemu-kvm binary, based on qemu-kvm-1.5.3-141.el7_4.1.src.rpm.
Please see the RHEL7 Virtualization and Administration Guide, section 17.6:
"Red Hat Enterprise Linux 7 supports PCI device assignment of NVIDIA K-Series Quadro (model 2000 series or higher), GRID, and Tesla as non-VGA graphics devices. Currently up to two GPUs may be attached to the virtual machine in addition to one of the standard, emulated VGA interfaces. The emulated VGA is used for pre-boot and installation and the NVIDIA GPU takes over when the NVIDIA graphics drivers are loaded. Note that the NVIDIA Quadro 2000 is not supported, nor is the Quadro K420 card."
For RHEL-7.4 this is being updated to include M-series and P-series Quadro devices, but the model 2000 or higher requirement still stands. Quadro P400 is not supported for GPU assignment on RHEL. Red Hat only supports assignment of NVIDIA GPUs which are also supported by NVIDIA for this purpose. The NVIDIA driver failing when detecting the KVM hypervisor is an indication that NVIDIA does not support this configuration and therefore neither does Red Hat.
As an NVIDIA partner, I don't think we can in good faith backport this feature specifically for enabling assignment of unsupported devices, nor could we support customers making use of this feature if we did backport it. Upstream, community enable-ment of such features does not imply Red Hat support of such configurations. Recommendation is for customer to upgrade GPU to match supported hardware requirements.