[SWDEV-462952] Options enabled for GPU passthrough scenarios

Added Dynamic Passthrough detection

Signed-off-by: Pham, Gabriel <Gabriel.Pham@amd.com>
Signed-off-by: Arif, Maisam <Maisam.Arif@amd.com>
Co-authored-by: Arif, Maisam <Maisam.Arif@amd.com>
Bu işleme şunda yer alıyor:
Pham, Gabriel
2025-01-30 19:12:03 -05:00
işlemeyi yapan: GitHub
ebeveyn 5b2c271eff
işleme 0f79efac78
6 değiştirilmiş dosya ile 137 ekleme ve 11 silme
+29
Dosyayı Görüntüle
@@ -438,6 +438,13 @@ class AmdSmiRegType(IntEnum):
USR1 = amdsmi_wrapper.AMDSMI_REG_USR1
class AmdSmiPassthroughInfoFlags(IntEnum):
MASK = 0x300
SHIFT = 0x8
PF = 0x0
VT = 0x1
PT = 0x2
class AmdSmiEventReader:
def __init__(
self, processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
@@ -4458,3 +4465,25 @@ def amdsmi_get_link_topology_nearest(
return {
'processor_list': device_list
}
def amdsmi_get_gpu_passthrough_info(
processor_handle: amdsmi_wrapper.amdsmi_processor_handle
) -> Dict[str, int]:
# make info struct here
info = amdsmi_wrapper.amdsmi_passthrough_info_t()
# call lib function here
_check_res(
amdsmi_wrapper.amdsmi_get_gpu_passthrough_info(
processor_handle,
ctypes.byref(info)
)
)
return {
"device_id": info.device_id,
"rev_id": info.rev_id,
"vendor_id": info.vendor_id,
"ids_flags": info.ids_flags
}