or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

examples

edge-cases.mdreal-world-scenarios.md
index.md
tile.json

types.mddocs/reference/

Type Reference

Complete reference for all types, enums, and constants in the AMDSMI library.

Initialization and Configuration Types

class AmdSmiInitFlags(IntEnum):
    """Library initialization flags."""
    INIT_ALL_PROCESSORS = ...  # Initialize all processor types
    INIT_AMD_CPUS = ...         # Initialize AMD CPUs only
    INIT_AMD_GPUS = ...         # Initialize AMD GPUs only
    INIT_AMD_APUS = ...         # Initialize AMD APUs only
    INIT_NON_AMD_CPUS = ...     # Initialize non-AMD CPUs
    INIT_NON_AMD_GPUS = ...     # Initialize non-AMD GPUs

class AmdSmiProcessorType(IntEnum):
    """Processor type identifiers."""
    UNKNOWN_DEVICE = ...
    AMD_GPU_DEVICE = ...
    AMD_CPU_DEVICE = ...
    NON_AMD_GPU_DEVICE = ...
    NON_AMD_CPU_DEVICE = ...

class AmdSmiDeviceType(IntEnum):
    """Device type identifiers (processor types)."""
    UNKNOWN_DEVICE = 0           # Unknown device type
    AMD_GPU_DEVICE = 1           # AMD GPU device
    AMD_CPU_DEVICE = 2           # AMD CPU device
    NON_AMD_GPU_DEVICE = 3       # Non-AMD GPU device
    NON_AMD_CPU_DEVICE = 4       # Non-AMD CPU device

Temperature and Voltage Types

class AmdSmiTemperatureType(IntEnum):
    """Temperature sensor types."""
    EDGE = ...           # Edge temperature
    HOTSPOT = ...        # Hotspot temperature
    JUNCTION = ...       # Junction temperature
    VRAM = ...           # VRAM temperature
    HBM_0 = ...          # HBM stack 0
    HBM_1 = ...          # HBM stack 1
    HBM_2 = ...          # HBM stack 2
    HBM_3 = ...          # HBM stack 3
    PLX = ...            # PLX temperature

class AmdSmiTemperatureMetric(IntEnum):
    """Temperature metric types."""
    CURRENT = ...           # Current temperature
    MAX = ...               # Maximum temperature
    MIN = ...               # Minimum temperature
    CRITICAL = ...          # Critical temperature threshold
    EMERGENCY = ...         # Emergency temperature threshold
    CRIT_MIN = ...          # Critical minimum
    OFFSET = ...            # Temperature offset
    LOWEST = ...            # Lowest recorded
    HIGHEST = ...           # Highest recorded

class AmdSmiVoltageType(IntEnum):
    """Voltage rail types."""
    VDDGFX = ...     # GFX voltage
    VDDBOARD = ...   # Board voltage
    INVALID = ...    # Invalid

class AmdSmiVoltageMetric(IntEnum):
    """Voltage metric types."""
    CURRENT = ...    # Current voltage
    MAX = ...        # Maximum voltage
    MIN = ...        # Minimum voltage
    AVERAGE = ...    # Average voltage
    LOWEST = ...     # Lowest recorded
    HIGHEST = ...    # Highest recorded

Clock and Performance Types

class AmdSmiClkType(IntEnum):
    """Clock types."""
    SYS = ...      # System clock
    GFX = ...      # Graphics clock
    DF = ...       # Data fabric clock
    DCEF = ...     # Display controller engine clock
    SOC = ...      # SoC clock
    MEM = ...      # Memory clock
    PCIE = ...     # PCIe clock
    VCLK0 = ...    # Video clock 0
    VCLK1 = ...    # Video clock 1
    DCLK0 = ...    # Display clock 0
    DCLK1 = ...    # Display clock 1

class AmdSmiDevPerfLevel(IntEnum):
    """Performance level settings."""
    AUTO = ...              # Automatic
    LOW = ...               # Low performance
    HIGH = ...              # High performance
    MANUAL = ...            # Manual control
    STABLE_STD = ...        # Stable standard
    STABLE_PEAK = ...        # Stable peak
    STABLE_MIN_MCLK = ...   # Stable minimum memory clock
    STABLE_MIN_SCLK = ...   # Stable minimum system clock
    DETERMINISM = ...       # Deterministic performance
    UNKNOWN = ...           # Unknown performance level

Memory Types

class AmdSmiMemoryType(IntEnum):
    """Memory types."""
    VRAM = ...          # Video RAM
    VIS_VRAM = ...      # Visible VRAM
    GTT = ...           # Graphics translation table

class AmdSmiVramType(IntEnum):
    """VRAM types for different memory technologies."""
    UNKNOWN = 0      # Unknown VRAM type
    HBM = 1          # High Bandwidth Memory
    HBM2 = 2         # High Bandwidth Memory 2
    HBM2E = 3        # High Bandwidth Memory 2E
    HBM3 = 4         # High Bandwidth Memory 3
    DDR2 = 5         # DDR2 SDRAM
    DDR3 = 6         # DDR3 SDRAM
    DDR4 = 7         # DDR4 SDRAM
    GDDR1 = 8        # GDDR1 graphics memory
    GDDR2 = 9        # GDDR2 graphics memory
    GDDR3 = 10       # GDDR3 graphics memory
    GDDR4 = 11       # GDDR4 graphics memory
    GDDR5 = 12       # GDDR5 graphics memory
    GDDR6 = 13       # GDDR6 graphics memory
    GDDR7 = 14       # GDDR7 graphics memory
    MAX = 15         # Maximum VRAM type value

GPU Block and Error Types

class AmdSmiGpuBlock(IntEnum):
    """GPU block identifiers for error reporting."""
    UMC = ...           # Unified Memory Controller
    SDMA = ...          # System DMA
    GFX = ...           # Graphics engine
    MMHUB = ...         # Multimedia hub
    ATHUB = ...         # Address translation hub
    PCIE_BIF = ...      # PCIe bus interface
    HDP = ...           # Host data path
    XGMI_WAFL = ...     # XGMI/WAFL
    DF = ...            # Data fabric
    SMN = ...           # System management network

class AmdSmiRasErrState(IntEnum):
    """RAS error states."""
    NONE = ...       # No RAS error state
    DISABLED = ...   # RAS is disabled
    PARITY = ...     # Parity error
    SING_C = ...     # Single correctable error
    MULT_UC = ...    # Multiple uncorrectable errors
    POISON = ...     # Poison error
    ENABLED = ...    # RAS is enabled
    INVALID = ...    # Invalid RAS error state

Partition Types

class AmdSmiComputePartitionType(IntEnum):
    """Compute partition types."""
    SPX = ...       # Single Partition Compute
    DPX = ...       # Dual Partition Compute
    TPX = ...       # Triple Partition Compute
    QPX = ...       # Quad Partition Compute
    CPX = ...       # Compute Partition Compute
    INVALID = ...   # Invalid partition type

class AmdSmiMemoryPartitionType(IntEnum):
    """Memory partition types."""
    NPS1 = ...    # 1 partition
    NPS2 = ...    # 2 partitions
    NPS4 = ...    # 4 partitions
    NPS8 = ...    # 8 partitions

class AmdSmiAcceleratorPartitionType(IntEnum):
    """Accelerator partition types."""
    SPX = ...       # Single Partition Compute
    DPX = ...       # Dual Partition Compute
    TPX = ...       # Triple Partition Compute
    QPX = ...       # Quad Partition Compute
    CPX = ...       # Compute Partition Compute
    INVALID = ...   # Invalid partition type

Event Types

class AmdSmiEvtNotificationType(IntEnum):
    """GPU event notification types."""
    NONE = ...                 # No event notification
    VMFAULT = ...              # VM page fault
    THERMAL_THROTTLE = ...     # Thermal throttling
    GPU_PRE_RESET = ...        # GPU pre-reset event
    GPU_POST_RESET = ...       # GPU post-reset event
    MIGRATE_START = ...        # Migration start event
    MIGRATE_END = ...          # Migration end event
    PAGE_FAULT_START = ...     # Page fault start event
    PAGE_FAULT_END = ...       # Page fault end event
    QUEUE_EVICTION = ...       # Queue eviction event
    QUEUE_RESTORE = ...        # Queue restore event
    UNMAP_FROM_GPU = ...       # Unmap from GPU event
    PROCESS_START = ...        # Process start event
    PROCESS_END = ...          # Process end event

Exception Classes

class AmdSmiException(Exception):
    """Base exception class for all AMDSMI exceptions."""

class AmdSmiLibraryException(AmdSmiException):
    """
    Library-level errors with error code mapping to AMDSMI status codes.

    Attributes:
    - err_code (int): Numeric error code from the AMDSMI C library
    - err_info (str): Human-readable error description

    Methods:
    - get_error_info(detailed=True) -> str: Get error message (detailed or short)
    - get_error_code() -> int: Get the numeric error code
    """

class AmdSmiRetryException(AmdSmiLibraryException):
    """
    Retry-specific exception indicating operation should be retried.
    Inherits error code AMDSMI_STATUS_RETRY.
    """

class AmdSmiTimeoutException(AmdSmiLibraryException):
    """
    Timeout-specific exception indicating operation exceeded time limit.
    Inherits error code AMDSMI_STATUS_TIMEOUT.
    """

class AmdSmiParameterException(AmdSmiException):
    """
    Invalid parameter exception raised when function receives wrong parameter type.

    Attributes:
    - actualType (type): The actual type received
    - expectedType (type): The expected type
    - err_msg (str): Detailed error message
    """

class AmdSmiKeyException(AmdSmiException):
    """
    Missing dictionary key exception raised when expected key is not found.

    Attributes:
    - key (str): The missing dictionary key
    - err_msg (str): Error message describing the missing key
    """

class AmdSmiBdfFormatException(AmdSmiException):
    """
    Invalid BDF (Bus:Device.Function) format exception.
    Raised when BDF string doesn't match expected format:
    <domain>:<bus>:<device>.<function> or <bus>:<device>.<function>

    Attributes:
    - bdf (str): The invalid BDF string that was provided
    """

Constants

# Module version
__version__ = "7.0.2"

# Maximum values
MAX_NUM_PROCESSES = 1024
AMDSMI_MAX_DEVICES = 32
AMDSMI_MAX_STRING_LENGTH = 256
AMDSMI_MAX_FAN_SPEED = 255
AMDSMI_GPU_UUID_SIZE = 38

# Hardware limits
AMDSMI_NUM_HBM_INSTANCES = 4
AMDSMI_MAX_NUM_VCN = 4
AMDSMI_MAX_NUM_CLKS = 4
AMDSMI_MAX_NUM_XGMI_LINKS = 8
AMDSMI_MAX_NUM_GFX_CLKS = 8
AMDSMI_MAX_NUM_XCC = 8
AMDSMI_MAX_NUM_XCP = 8
AMDSMI_MAX_NUM_JPEG = 32
AMDSMI_MAX_CACHE_TYPES = 10
AMDSMI_NUM_VOLTAGE_CURVE_POINTS = 3
AMDSMI_MAX_NUM_PM_POLICIES = 32
AMDSMI_MAX_NUM_FREQUENCIES = 33

Handle Type

# Type alias for processor handle (opaque pointer)
processor_handle = c_void_p

For detailed information about specific types and their usage, refer to the relevant reference documentation sections.