Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

francescolavra
Copy link
Member

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:

  • execution of the GPU ROM by the BIOS appears to lock up the VM (at least with Qemu version 6.2.0) when the GPU is the only VGA-compatible device in the VM
  • configuration of a GPU in VGA text mode by the BIOS causes the VGA console driver in the Nanos kernel to bind to the GPU device, thereby preventing the Nvidia GPU klib from binding to the GPU

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:
- execution of the GPU ROM by the BIOS appears to lock up the VM
(at least with Qemu version 6.2.0) when the GPU is the only VGA-
compatible device in the VM
- configuration of a GPU in VGA text mode by the BIOS causes the
VGA console driver in the Nanos kernel to bind to the GPU device,
thereby preventing the Nvidia GPU klib from binding to the GPU
@francescolavra francescolavra merged commit ec85867 into master Oct 23, 2023
2 checks passed
@francescolavra francescolavra deleted the fix/gpu-passthrough branch October 23, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants