Fix amd-smi sets attribute error & memory partition sets

* Changes:
- Fix for any set without CPU loaded (ex.):
sudo /opt/rocm/bin/amd-smi set -o 250
AttributeError: 'Namespace' object has no attribute 'core_boost_limit'

- Fix for recent changes to memory partition sets
  Needed to account for permission denied -> to display not supported.
  EACCESS == *_STATUS_PERMISSION, but in this case need to show
  NOT_SUPPORTED

Change-Id: Ie00bbb34d01adfe38300f1ac4c1620d78885b9b7
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: e7964cda49]
Bu işleme şunda yer alıyor:
Charis Poag
2025-08-07 10:39:55 -05:00
işlemeyi yapan: Arif, Maisam
ebeveyn 05ee73d6de
işleme 79ce271d1f
2 değiştirilmiş dosya ile 12 ekleme ve 8 silme
+11 -7
Dosyayı Görüntüle
@@ -5001,6 +5001,9 @@ class AMDSMICommands():
# Error if no subcommand args are passed
if self.helpers.is_baremetal():
is_gpu_set = False
is_cpu_set = False
is_core_set = False
try:
is_gpu_set = any([
args.gpu is not None,
@@ -5019,7 +5022,7 @@ class AMDSMICommands():
])
except AttributeError:
# If attribute error for gpu, then we could be another subcommand
is_gpu_set = False
pass
try:
is_cpu_set = any([
@@ -5037,12 +5040,13 @@ class AMDSMICommands():
])
except AttributeError:
# If attribute error for cpu, then we could be another subcommand
is_cpu_set = False
if args.core_boost_limit:
is_core_set = True
else:
is_core_set = False
pass
try:
if args.core_boost_limit:
is_core_set = True
except AttributeError:
# If attribute error for core, then we could be another subcommand
pass
if not (is_gpu_set or is_cpu_set or is_core_set):
# if neither GPU / CPU / or Core args are provided, then raise error message
+1 -1
Dosyayı Görüntüle
@@ -6661,7 +6661,7 @@ rsmi_dev_memory_partition_set(uint32_t dv_ind,
rsmi_status_t status = amd::smi::ErrnoToRsmiStatus(ret);
if (status != RSMI_STATUS_SUCCESS) {
if (status == EACCES) {
if (status == RSMI_STATUS_PERMISSION) {
status = RSMI_STATUS_NOT_SUPPORTED; // already verified permissions
}
ss << __PRETTY_FUNCTION__