Merge amd-staging into amd-master 20240808

Change-Id: I15b180364b79de72a74ae52fbce7009122a01415
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
This commit is contained in:
Galantsev, Dmitrii
2024-08-08 16:37:58 -05:00
melakukan ee3caa23ed
3 mengubah file dengan 27 tambahan dan 6 penghapusan
+21 -4
Melihat File
@@ -24,7 +24,24 @@ import trace
from io import StringIO
from time import ctime
from subprocess import check_output
from rsmiBindings import *
from typing import TYPE_CHECKING
# only used for type checking
# pyright trips up and cannot find rsmiBindings without it
if TYPE_CHECKING:
from rsmiBindings import *
try:
from rsmiBindings import *
except ImportError:
current_path = os.path.dirname(os.path.abspath(__file__))
additional_path = f"{current_path}/../libexec/rocm_smi"
sys.path.append(additional_path)
try:
from rsmiBindings import *
except ImportError:
print(f"Still couldn't import 'rsmiBindings'. Make sure it's installed in {additional_path}")
sys.exit(1)
# rocmSmiLib_cli version. Increment this as needed.
# Major version - Increment when backwards-compatibility breaks
@@ -33,7 +50,7 @@ from rsmiBindings import *
# Hash version - Shortened commit hash. Print here and not with lib for consistency with amd-smi
SMI_MAJ = 2
SMI_MIN = 3
SMI_PAT = 0
SMI_PAT = 1
# SMI_HASH is provided by rsmiBindings
__version__ = '%s.%s.%s+%s' % (SMI_MAJ, SMI_MIN, SMI_PAT, SMI_HASH)
@@ -196,7 +213,7 @@ def getBus(device, silent=False):
# BDFID = ((DOMAIN & 0xFFFFFFFF) << 32) | ((PARTITION_ID & 0xF) << 28) | ((BUS & 0xFF) << 8) |
# ((DEVICE & 0x1F) <<3 ) | (FUNCTION & 0x7)
# bits [63:32] = domain
# bits [31:28] or bits [2:0] = partition id
# bits [31:28] or bits [2:0] = partition id
# bits [27:16] = reserved
# bits [15:8] = Bus
# bits [7:3] = Device
@@ -223,7 +240,7 @@ def getPartitionId(device, silent=False):
# BDFID = ((DOMAIN & 0xFFFFFFFF) << 32) | ((PARTITION_ID & 0xF) << 28) | ((BUS & 0xFF) << 8) |
# ((DEVICE & 0x1F) <<3 ) | (FUNCTION & 0x7)
# bits [63:32] = domain
# bits [31:28] or bits [2:0] = partition id
# bits [31:28] or bits [2:0] = partition id
# bits [27:16] = reserved
# bits [15:8] = Bus
# bits [7:3] = Device