[SWDEV-504146] Fix Device Name
Changes: - Fixed Device Name (market name) - Added new API rsmi_dev_market_name_get() - Updated tests - Updated amdgpu_drm.h to match latest mainline kernel - Fixed subsystem ID to only show hex value (not subsystem name) - rocm_smi_lib now has a recommended requirement for libdrm Change-Id: Ic438529e16c8c3dbbdd620da664918148c40c997
Этот коммит содержится в:
@@ -346,13 +346,13 @@ def getSubsystemId(device, silent=False):
|
||||
:param silent: Turn on to silence error output
|
||||
(you plan to handle manually). Default is off.
|
||||
"""
|
||||
model = create_string_buffer(MAX_BUFF_SIZE)
|
||||
ret = rocmsmi.rsmi_dev_subsystem_name_get(device, model, MAX_BUFF_SIZE)
|
||||
model = c_short()
|
||||
ret = rocmsmi.rsmi_dev_subsystem_id_get(device, byref(model))
|
||||
device_model = "N/A"
|
||||
if rsmi_ret_ok(ret, device, 'get_subsystem_name', silent=silent):
|
||||
device_model = model.value.decode()
|
||||
device_model = model.value
|
||||
# padHexValue is used for applications that expect 4-digit card models
|
||||
device_model = padHexValue(device_model, 4)
|
||||
device_model = padHexValue(hex(device_model), 4)
|
||||
return device_model
|
||||
|
||||
def getVendor(device, silent=False):
|
||||
@@ -418,8 +418,8 @@ def getNodeId(device, silent=False):
|
||||
return node_id_ret
|
||||
|
||||
def getDeviceName(device, silent=False):
|
||||
""" Return the uint64 value of device's target
|
||||
graphics version as reported by KFD
|
||||
""" Return the uint64 value of device's name
|
||||
reported by KFD
|
||||
|
||||
:param device: DRM device identifier
|
||||
:param silent: Turn on to silence error output
|
||||
@@ -428,7 +428,7 @@ def getDeviceName(device, silent=False):
|
||||
# Retrieve the device series
|
||||
series = create_string_buffer(MAX_BUFF_SIZE)
|
||||
device_name_ret = "N/A"
|
||||
ret = rocmsmi.rsmi_dev_name_get(device, series, MAX_BUFF_SIZE)
|
||||
ret = rocmsmi.rsmi_dev_market_name_get(device, series, MAX_BUFF_SIZE)
|
||||
if rsmi_ret_ok(ret, device, 'get_name', silent=silent):
|
||||
device_name_ret = series.value.decode()
|
||||
return device_name_ret
|
||||
|
||||
@@ -54,6 +54,7 @@ class rsmi_status_t(c_int):
|
||||
RSMI_STATUS_REFCOUNT_OVERFLOW = 0x11
|
||||
RSMI_STATUS_SETTING_UNAVAILABLE = 0x12
|
||||
RSMI_STATUS_AMDGPU_RESTART_ERR = 0x13
|
||||
RSMI_STATUS_DRM_ERROR = 0x14
|
||||
RSMI_STATUS_UNKNOWN_ERROR = 0xFFFFFFFF
|
||||
|
||||
|
||||
@@ -79,6 +80,7 @@ rsmi_status_verbose_err_out = {
|
||||
rsmi_status_t.RSMI_STATUS_REFCOUNT_OVERFLOW: 'Data overflow - data exceeded INT32_MAX',
|
||||
rsmi_status_t.RSMI_STATUS_SETTING_UNAVAILABLE: 'Requested setting is unavailable for current device',
|
||||
rsmi_status_t.RSMI_STATUS_AMDGPU_RESTART_ERR: 'Could not successfully restart the amdgpu driver',
|
||||
rsmi_status_t.RSMI_STATUS_DRM_ERROR: 'Error when calling libdrm',
|
||||
rsmi_status_t.RSMI_STATUS_UNKNOWN_ERROR: 'Unknown error occured'
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user