[SWDEV-525336] Filter out amd-smi process itself from detection (#638)
* Filter out amd-smi from process detection
* Fixed N/A stripping N/ incorrectly from running elevated processes
Signed-off-by: adapryor <Adam.pryor@amd.com>
[ROCm/amdsmi commit: ad29de4238]
Этот коммит содержится в:
@@ -239,9 +239,10 @@ class AMDSMILogger():
|
||||
string_process_value = str(process_value)
|
||||
if process_key == "name":
|
||||
# Truncate name if too long
|
||||
process_name = string_process_value.split('/')[-1][:17]
|
||||
if process_name == "":
|
||||
if string_process_value == "" or string_process_value == "N/A":
|
||||
process_name = "N/A"
|
||||
else:
|
||||
process_name = string_process_value.split('/')[-1][:17]
|
||||
table_values += process_name.rjust(17)
|
||||
elif process_key == "pid":
|
||||
table_values += string_process_value.rjust(9)
|
||||
|
||||
@@ -327,6 +327,12 @@ int GetProcessGPUs(uint32_t pid, std::unordered_set<uint64_t> *gpu_set) {
|
||||
if (gpu_set == nullptr) {
|
||||
return RSMI_STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
// Skip amd-smi process itself
|
||||
if (pid == static_cast<uint32_t>(getpid())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
|
||||
std::string queues_dir = kKFDProcPathRoot;
|
||||
|
||||
Ссылка в новой задаче
Block a user