Change the clean shader API to clean local data
To be align with the unified API. Change-Id: I2819339fba6f528204cebd3e9605109e82cbc5b4
Цей коміт міститься в:
@@ -2084,17 +2084,16 @@ except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
|
||||
### amdsmi_set_gpu_run_cleaner_shader
|
||||
### amdsmi_clean_gpu_local_data
|
||||
Description: Clear the SRAM data of the given device. This can be called between user logins to prevent information leak.
|
||||
|
||||
Input parameters:
|
||||
|
||||
* `processor_handle` handle for the given device
|
||||
* `sclean` the clean flag. Only 1 will take effect and other number are reserved for future usage.
|
||||
|
||||
Output: None
|
||||
|
||||
Exceptions that can be thrown by `amdsmi_set_gpu_run_cleaner_shader` function:
|
||||
Exceptions that can be thrown by `amdsmi_clean_gpu_local_data` function:
|
||||
|
||||
* `AmdSmiLibraryException`
|
||||
* `AmdSmiRetryException`
|
||||
@@ -2109,7 +2108,7 @@ try:
|
||||
print("No GPUs on machine")
|
||||
else:
|
||||
for device in devices:
|
||||
amdsmi_set_gpu_run_cleaner_shader(device, 1)
|
||||
amdsmi_clean_gpu_local_data(device)
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
|
||||
@@ -136,7 +136,7 @@ from .amdsmi_interface import amdsmi_set_clk_freq
|
||||
from .amdsmi_interface import amdsmi_set_gpu_overdrive_level
|
||||
from .amdsmi_interface import amdsmi_set_soc_pstate
|
||||
from .amdsmi_interface import amdsmi_set_xgmi_plpd
|
||||
from .amdsmi_interface import amdsmi_set_gpu_run_cleaner_shader
|
||||
from .amdsmi_interface import amdsmi_clean_gpu_local_data
|
||||
from .amdsmi_interface import amdsmi_set_gpu_process_isolation
|
||||
|
||||
# # Physical State Queries
|
||||
|
||||
@@ -2831,17 +2831,16 @@ def amdsmi_set_gpu_process_isolation(
|
||||
)
|
||||
|
||||
|
||||
def amdsmi_set_gpu_run_cleaner_shader(
|
||||
def amdsmi_clean_gpu_local_data(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
|
||||
sclean: int,
|
||||
):
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
raise AmdSmiParameterException(
|
||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||
)
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_set_gpu_run_cleaner_shader(
|
||||
processor_handle, sclean
|
||||
amdsmi_wrapper.amdsmi_clean_gpu_local_data(
|
||||
processor_handle
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -2100,9 +2100,9 @@ amdsmi_get_gpu_process_isolation.argtypes = [amdsmi_processor_handle, ctypes.POI
|
||||
amdsmi_set_gpu_process_isolation = _libraries['libamd_smi.so'].amdsmi_set_gpu_process_isolation
|
||||
amdsmi_set_gpu_process_isolation.restype = amdsmi_status_t
|
||||
amdsmi_set_gpu_process_isolation.argtypes = [amdsmi_processor_handle, uint32_t]
|
||||
amdsmi_set_gpu_run_cleaner_shader = _libraries['libamd_smi.so'].amdsmi_set_gpu_run_cleaner_shader
|
||||
amdsmi_set_gpu_run_cleaner_shader.restype = amdsmi_status_t
|
||||
amdsmi_set_gpu_run_cleaner_shader.argtypes = [amdsmi_processor_handle, uint32_t]
|
||||
amdsmi_clean_gpu_local_data = _libraries['libamd_smi.so'].amdsmi_clean_gpu_local_data
|
||||
amdsmi_clean_gpu_local_data.restype = amdsmi_status_t
|
||||
amdsmi_clean_gpu_local_data.argtypes = [amdsmi_processor_handle]
|
||||
amdsmi_get_lib_version = _libraries['libamd_smi.so'].amdsmi_get_lib_version
|
||||
amdsmi_get_lib_version.restype = amdsmi_status_t
|
||||
amdsmi_get_lib_version.argtypes = [ctypes.POINTER(struct_amdsmi_version_t)]
|
||||
@@ -2711,7 +2711,7 @@ __all__ = \
|
||||
'amdsmi_set_gpu_perf_determinism_mode',
|
||||
'amdsmi_set_gpu_perf_level', 'amdsmi_set_gpu_power_profile',
|
||||
'amdsmi_set_gpu_process_isolation',
|
||||
'amdsmi_set_gpu_run_cleaner_shader', 'amdsmi_set_power_cap',
|
||||
'amdsmi_clean_gpu_local_data', 'amdsmi_set_power_cap',
|
||||
'amdsmi_set_soc_pstate', 'amdsmi_set_xgmi_plpd',
|
||||
'amdsmi_shut_down', 'amdsmi_smu_fw_version_t',
|
||||
'amdsmi_socket_handle', 'amdsmi_status_code_to_string',
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача