nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.27k stars 132 forks source link

On-prem instances: add support for VGA-compatible GPUs #1531

Closed francescolavra closed 11 months ago

francescolavra commented 11 months ago

Some GPU devices (e.g. NVIDIA GeForce RTX 3090 and 4090) are VGA-compatible, thus their PCI subclass is 0x00; the existing Ops code is assuming that all GPUs have PCI subclass 0x02 (3D controller), which prevents setting up passthrough of VGA-compatible GPUs. This change removes the check for the PCI subclass when enumerating PCI devices, so that passthrough can be configured for all available GPUs. In addition, the rombar=0 option is being added to the Qemu command line, so that any PCI option ROM present in a GPU is not exposed to the VM; this fixes 2 problems: