"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cyborg/accelerator/drivers/gpu/utils.py" between
openstack-cyborg-8.0.0.tar.gz and openstack-cyborg-9.0.0.tar.gz

About: OpenStack Cyborg provides a general purpose management framework for acceleration resources.
The "Zed" series (latest release).

utils.py  (openstack-cyborg-8.0.0):utils.py  (openstack-cyborg-9.0.0)
skipping to change at line 104 skipping to change at line 104
traits = get_traits(gpu_dict["vendor_id"], gpu_dict["product_id"]) traits = get_traits(gpu_dict["vendor_id"], gpu_dict["product_id"])
gpu_dict["rc"] = constants.RESOURCES["PGPU"] gpu_dict["rc"] = constants.RESOURCES["PGPU"]
gpu_dict.update(traits) gpu_dict.update(traits)
gpu_list.append(_generate_driver_device(gpu_dict)) gpu_list.append(_generate_driver_device(gpu_dict))
return gpu_list return gpu_list
def _generate_driver_device(gpu): def _generate_driver_device(gpu):
driver_device_obj = driver_device.DriverDevice() driver_device_obj = driver_device.DriverDevice()
driver_device_obj.vendor = gpu["vendor_id"] driver_device_obj.vendor = gpu["vendor_id"]
driver_device_obj.model = gpu.get('model', 'miss model info') driver_device_obj.model = gpu.get('model', 'miss model info')
std_board_info = {'product_id': gpu.get('product_id', None), std_board_info = {'product_id': gpu.get('product_id'),
'controller': gpu.get('controller', None)} 'controller': gpu.get('controller')}
vendor_board_info = {'vendor_info': gpu.get('vendor_info', 'gpu_vb_info')} vendor_board_info = {'vendor_info': gpu.get('vendor_info', 'gpu_vb_info')}
driver_device_obj.std_board_info = jsonutils.dumps(std_board_info) driver_device_obj.std_board_info = jsonutils.dumps(std_board_info)
driver_device_obj.vendor_board_info = jsonutils.dumps(vendor_board_info) driver_device_obj.vendor_board_info = jsonutils.dumps(vendor_board_info)
driver_device_obj.type = constants.DEVICE_GPU driver_device_obj.type = constants.DEVICE_GPU
driver_device_obj.stub = gpu.get('stub', False) driver_device_obj.stub = gpu.get('stub', False)
driver_device_obj.controlpath_id = _generate_controlpath_id(gpu) driver_device_obj.controlpath_id = _generate_controlpath_id(gpu)
driver_device_obj.deployable_list = _generate_dep_list(gpu) driver_device_obj.deployable_list = _generate_dep_list(gpu)
return driver_device_obj return driver_device_obj
def _generate_controlpath_id(gpu): def _generate_controlpath_id(gpu):
skipping to change at line 128 skipping to change at line 128
# their cpid_type, while attach_handle_type of them are different. # their cpid_type, while attach_handle_type of them are different.
driver_cpid.cpid_type = "PCI" driver_cpid.cpid_type = "PCI"
driver_cpid.cpid_info = utils.pci_str_to_json(gpu["devices"]) driver_cpid.cpid_info = utils.pci_str_to_json(gpu["devices"])
return driver_cpid return driver_cpid
def _generate_dep_list(gpu): def _generate_dep_list(gpu):
dep_list = [] dep_list = []
driver_dep = driver_deployable.DriverDeployable() driver_dep = driver_deployable.DriverDeployable()
driver_dep.attribute_list = _generate_attribute_list(gpu) driver_dep.attribute_list = _generate_attribute_list(gpu)
driver_dep.attach_handle_list = [] driver_dep.attach_handle_list = []
# NOTE(wangzhh): The name of deployable should be unique, its format is
# under disscussion, may looks like
# <ComputeNodeName>_<NumaNodeName>_<CyborgName>_<NumInHost>
# NOTE(yumeng) Now simply named as <Compute_hostname>_<Device_address> # NOTE(yumeng) Now simply named as <Compute_hostname>_<Device_address>
# once cyborg needs to support GPU devices discovered from a baremetal # once cyborg needs to support GPU devices discovered from a baremetal
# node, we might need to support more formats. # node, we might need to support more formats.
driver_dep.name = gpu.get('hostname', '') + '_' + gpu["devices"] driver_dep.name = gpu.get('hostname', '') + '_' + gpu["devices"]
driver_dep.driver_name = VENDOR_MAPS.get(gpu["vendor_id"]).upper() driver_dep.driver_name = VENDOR_MAPS.get(gpu["vendor_id"], '').upper()
# driver_dep.num_accelerators for PGPU is 1, for VGPU should be the # driver_dep.num_accelerators for PGPU is 1, for VGPU should be the
# sriov_numvfs of the vGPU device. # available_instances of the vGPU device.
# TODO(yumeng) support VGPU num report soon # TODO(yumeng) support VGPU num report soon
driver_dep.num_accelerators = 1 driver_dep.num_accelerators = 1
driver_dep.attach_handle_list = \ driver_dep.attach_handle_list = \
[_generate_attach_handle(gpu)] [_generate_attach_handle(gpu)]
dep_list.append(driver_dep) dep_list.append(driver_dep)
return dep_list return dep_list
def _generate_attach_handle(gpu): def _generate_attach_handle(gpu):
driver_ah = driver_attach_handle.DriverAttachHandle() driver_ah = driver_attach_handle.DriverAttachHandle()
if gpu["rc"] == "PGPU": if gpu["rc"] == "PGPU":
 End of changes. 4 change blocks. 
7 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)