# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
from typing import Any, Optional

from pynvml.nvml import *

NVSMI_ALL: int
NVSMI_TIMESTAMP: int
NVSMI_DRIVER_VERSION: int
NVSMI_COUNT: int
NVSMI_NAME: int
NVSMI_SERIALNUMBER: int
NVSMI_UUID: int
NVSMI_PCI_BUS_ID: int
NVSMI_PCI_DOMAIN: int
NVSMI_PCI_BUS: int
NVSMI_PCI_DEVICE: int
NVSMI_PCI_DEVICE_ID: int
NVSMI_PCI_SUBDEVICE_ID: int
NVSMI_PCI_LINK_GEN_CUR: int
NVSMI_PCI_LINK_GEN_MAX: int
NVSMI_PCI_LINK_WIDTH_CUR: int
NVSMI_PCI_LINK_WIDTH_MAX: int
NVSMI_INDEX: int
NVSMI_DISPLAY_MODE: int
NVSMI_DISPLAY_ACTIVE: int
NVSMI_PERSISTENCE_MODE: int
NVSMI_ACCT_MODE: int
NVSMI_ACCT_BUFFER_SIZE: int
NVSMI_DRIVER_MODEL_CUR: int
NVSMI_DRIVER_MODEL_PENDING: int
NVSMI_VBIOS_VER: int
NVSMI_BOARD_ID: int
NVSMI_INFOROM_IMG: int
NVSMI_INFOROM_OEM: int
NVSMI_INFOROM_ECC: int
NVSMI_INFOROM_PWR: int
NVSMI_GOM_CUR: int
NVSMI_GOM_PENDING: int
NVSMI_FAN_SPEED: int
NVSMI_PSTATE: int
NVSMI_MEMORY_TOTAL: int
NVSMI_MEMORY_FREE: int
NVSMI_MEMORY_USED: int
NVSMI_COMPUTE_MODE: int
NVSMI_MEMORY_BAR1: int
NVSMI_UTILIZATION_GPU: int
NVSMI_UTILIZATION_MEM: int
NVSMI_UTILIZATION_ENCODER: int
NVSMI_UTILIZATION_DECODER: int
NVSMI_ENCODER_STATS_SESSIONCOUNT: int
NVSMI_ENCODER_STATS_AVG_EPS: int
NVSMI_ENCODER_STATS_AVG_LATENCY: int
NVSMI_ECC_MODE_CUR: int
NVSMI_ECC_MODE_PENDING: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_DEV_MEM: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_REGFILE: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_L1CACHE: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_L2CACHE: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_TEXTURE: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_TOTAL: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_DRAM: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_SRAM: int
NVSMI_ECC_ERROR_CORRECTED_VOLATILE_CBU: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_DEV_MEM: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_REGFILE: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_L1CACHE: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_L2CACHE: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_TEXTURE: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_TOTAL: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_DRAM: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_CBU: int
NVSMI_ECC_ERROR_CORRECTED_AGGREGATE_SRAM: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_DEV_MEM: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_REGFILE: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_L1CACHE: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_L2CACHE: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_TEXTURE: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_TOTAL: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_DRAM: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_CBU: int
NVSMI_ECC_ERROR_UNCORRECTED_VOLATILE_SRAM: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_DEV_MEM: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_REGFILE: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_L1CACHE: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_L2CACHE: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_TEXTURE: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_TOTAL: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_DRAM: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_CBU: int
NVSMI_ECC_ERROR_UNCORRECTED_AGGREGATE_SRAM: int
NVSMI_RETIREDPAGES_SINGLE_BIT_ECC_COUNT: int
NVSMI_RETIREDPAGES_DOUBLE_BIT_ECC_COUNT: int
NVSMI_RETIREDPAGES_PENDING: int
NVSMI_CLOCK_THROTTLE_REASONS_SUPPORTED: int
NVSMI_CLOCK_THROTTLE_REASONS_ACTIVE: int
NVSMI_CLOCK_THROTTLE_REASONS_IDLE: int
NVSMI_CLOCK_THROTTLE_REASONS_APP_SETTING: int
NVSMI_CLOCK_THROTTLE_REASONS_SW_PWR_CAP: int
NVSMI_CLOCK_THROTTLE_REASONS_HW_SLOWDOWN: int
NVSMI_CLOCK_THROTTLE_REASONS_HW_THERMAL_SLOWDOWN: int
NVSMI_CLOCK_THROTTLE_REASONS_HW_PWR_BRAKE_SLOWDOWN: int
NVSMI_CLOCK_THROTTLE_REASONS_SW_THERMAL_SLOWDOWN: int
NVSMI_CLOCK_THROTTLE_REASONS_SYNC_BOOST: int
NVSMI_TEMPERATURE_GPU: int
NVSMI_TEMPERATURE_MEMORY: int
NVSMI_POWER_MGMT: int
NVSMI_POWER_DRAW: int
NVSMI_POWER_LIMIT: int
NVSMI_POWER_LIMIT_ENFORCED: int
NVSMI_POWER_LIMIT_DEFAULT: int
NVSMI_POWER_LIMIT_MIN: int
NVSMI_POWER_LIMIT_MAX: int
NVSMI_CLOCKS_GRAPHICS_CUR: int
NVSMI_CLOCKS_SM_CUR: int
NVSMI_CLOCKS_MEMORY_CUR: int
NVSMI_CLOCKS_VIDEO_CUR: int
NVSMI_CLOCKS_APPL_GRAPHICS: int
NVSMI_CLOCKS_APPL_MEMORY: int
NVSMI_CLOCKS_APPL_GRAPHICS_DEFAULT: int
NVSMI_CLOCKS_APPL_MEMORY_DEFAULT: int
NVSMI_CLOCKS_GRAPHICS_MAX: int
NVSMI_CLOCKS_SM_MAX: int
NVSMI_CLOCKS_MEMORY_MAX: int
NVSMI_COMPUTE_APPS: int
NVSMI_ACCOUNTED_APPS: int
NVSMI_CLOCKS_POLICY: int
NVSMI_CLOCKS_SUPPORTED: int
NVSMI_MIG_MODE_CURRENT: int
NVSMI_MIG_MODE_PENDING: int
NVSMI_QUERY_GPU: Any
NVSMI_BRAND_NAMES: Any

class nvidia_smi:
    class loop_async:
        def __init__(
            self,
            time_in_milliseconds: int = ...,
            filter: Optional[Any] = ...,
            callback: Optional[Any] = ...,
        ) -> None: ...
        def __del__(self) -> None: ...
        def cancel(self) -> None: ...
        def is_aborted(self): ...
        def result(self): ...

    @staticmethod
    def getInstance(): ...
    @staticmethod
    def loop(
        time_in_milliseconds: int = ...,
        filter: Optional[Any] = ...,
        callback: Optional[Any] = ...,
    ): ...
    def __init__(self) -> None: ...
    def __del__(self) -> None: ...
    @classmethod
    def XmlDeviceQuery(self, filter: Optional[Any] = ...): ...
    @classmethod
    def DeviceQuery(self, filter: Optional[Any] = ...): ...
    def format(self, results): ...
