AMD SMI examples#

AMD SMI includes matching topic examples in Python and Go. Each how-to describes one workflow. Pages that have been converted show Python and Go side by side in language tabs.

  • Python examples live in py/examples/<example>/amdsmi_<example>.py. Build and run instructions are in Python library usage.

  • Go examples live in go/examples/<example>/amdsmi_<example>.go. Setup and run instructions are in Go library usage.

Choose an example#

Get started#

  • Library lifecycle initializes and shuts down AMD SMI, displays the library version, and decodes status codes.

  • Processor discovery identifies GPU processor handles and optionally discovers nodes, VFs, and NICs.

  • Static identity displays GPU and optional NIC hardware and driver identity information.

Monitor hardware and firmware#

  • Telemetry uses metrics-table telemetry when supported, focused compatibility APIs otherwise, and optionally samples NIC counters.

  • Event monitoring subscribes to GPU events and reads event details with a timeout.

  • Firmware displays GPU VBIOS and firmware inventories, plus optional VF and NIC firmware information.

  • RAS health inspects ECC, RAS policy and bad pages.

Inspect topology and platform settings#

  • Topology displays GPU, NIC, NUMA, XGMI, and fabric topology information.

  • Node power reads node power management status and limits.

Configure GPUs and virtualization#

Safety#

The lifecycle, discovery, static identity, telemetry, event monitoring, firmware, RAS health, and node power examples are read-only. The topology example is read-only when displaying information, but its XGMI operations change configuration.

The partitioning, power and performance, SR-IOV VF, and reset examples can modify GPU or virtualization state. Read each example’s prerequisites and operation-specific warnings before selecting a setter or reset operation. Stop or migrate affected workloads when required, and do not assume a setting is restored if an API request reports an error.