middleware icon indicating copy to clipboard operation
middleware copied to clipboard

NAS-127357 / 24.10 / Retrieve PCI slots in a new endpoint so that they are easily consumed by UI

Open Qubad786 opened this issue 11 months ago • 1 comments

Context

When GPU passthrough is desired, there are essentially 2 steps which need to be done:

  1. Add GPU which is to be used for passthrough via system.advanced namespace
  2. Create PCI devices for the GPU in question based on PCI devices it is consuming and any other which fall in the same iommu group (this happens during VM creation wizard)

For (2), we have an endpoint vm.device.get_pci_ids_for_gpu_isolation which UI should be consuming to find out PCI devices which should be created when user says he wants X GPU to be added to a VM.

For (1) however, UI was consuming the same endpoint and passing it's return argument to system.advanced.update which was bound to fail. A new endpoint has been added system.advanced.get_isolate_gpu_pci_choices which basically does the parsing UI was already doing at the moment and gives values which UI should be passing on for each GPU which is selected to system.advanced.update_gpu_pci_ids along with unit tests to ensure consistent behavior.

Qubad786 avatar Feb 27 '24 22:02 Qubad786

Jira URL: https://ixsystems.atlassian.net/browse/NAS-127357

bugclerk avatar Feb 27 '24 22:02 bugclerk

Only to be merged after https://github.com/truenas/middleware/pull/13301

Qubad786 avatar Mar 11 '24 11:03 Qubad786

This PR has been merged and conversations have been locked. If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

bugclerk avatar Mar 20 '24 18:03 bugclerk