Ejemplo n.º 1
0
 def get_gpus(self):
     gpus = get_gpus()
     to_isolate_gpus = self.middleware.call_sync(
         'system.advanced.config')['isolated_gpu_pci_ids']
     for gpu in gpus:
         gpu['available_to_host'] = gpu['addr'][
             'pci_slot'] not in to_isolate_gpus
     return gpus
Ejemplo n.º 2
0
def get_current_gpu_pci_ids(root):
    adv_config = query_config_table("system_advanced", os.path.join(root, FREENAS_DATABASE[1:]), "adv_")
    to_isolate = [gpu for gpu in get_gpus() if gpu["addr"]["pci_slot"] in adv_config.get("isolated_gpu_pci_ids", [])]
    return [dev["pci_id"] for gpu in to_isolate for dev in gpu["devices"]]