.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0

.. default-role:: cpp:any
.. module:: cuda.bindings.nvml

nvml
====

The ``cuda.bindings.nvml`` Python module wraps the
`NVIDIA Management Library (NVML) APIs <https://developer.nvidia.com/management-library-nvml>`_.

Functions
---------

.. autosummary::
   :toctree: generated/

   compute_instance_destroy
   compute_instance_get_info_v2
   device_clear_accounting_pids
   device_clear_cpu_affinity
   device_clear_ecc_error_counts
   device_clear_field_values
   device_create_gpu_instance
   device_create_gpu_instance_with_placement
   device_discover_gpus
   device_get_accounting_buffer_size
   device_get_accounting_mode
   device_get_accounting_pids
   device_get_accounting_stats
   device_get_active_vgpus
   device_get_adaptive_clock_info_status
   device_get_addressing_mode
   device_get_api_restriction
   device_get_architecture
   device_get_attributes_v2
   device_get_auto_boosted_clocks_enabled
   device_get_bar1_memory_info
   device_get_board_id
   device_get_board_part_number
   device_get_brand
   device_get_bridge_chip_info
   device_get_bus_type
   device_get_c2c_mode_info_v
   device_get_capabilities
   device_get_clk_mon_status
   device_get_clock
   device_get_clock_info
   device_get_clock_offsets
   device_get_compute_instance_id
   device_get_compute_mode
   device_get_compute_running_processes_v3
   device_get_conf_compute_gpu_attestation_report
   device_get_conf_compute_gpu_certificate
   device_get_conf_compute_mem_size_info
   device_get_conf_compute_protected_memory_usage
   device_get_cooler_info
   device_get_count_v2
   device_get_cpu_affinity
   device_get_cpu_affinity_within_scope
   device_get_creatable_vgpus
   device_get_cuda_compute_capability
   device_get_curr_pcie_link_generation
   device_get_curr_pcie_link_width
   device_get_current_clock_freqs
   device_get_current_clocks_event_reasons
   device_get_decoder_utilization
   device_get_default_ecc_mode
   device_get_device_handle_from_mig_device_handle
   device_get_display_active
   device_get_display_mode
   device_get_dram_encryption_mode
   device_get_driver_model_v2
   device_get_dynamic_pstates_info
   device_get_ecc_mode
   device_get_encoder_capacity
   device_get_encoder_sessions
   device_get_encoder_stats
   device_get_encoder_utilization
   device_get_enforced_power_limit
   device_get_fan_control_policy_v2
   device_get_fan_speed
   device_get_fan_speed_rpm
   device_get_fan_speed_v2
   device_get_fbc_sessions
   device_get_fbc_stats
   device_get_field_values
   device_get_gpc_clk_min_max_vf_offset
   device_get_gpc_clk_vf_offset
   device_get_gpu_fabric_info_v
   device_get_gpu_instance_by_id
   device_get_gpu_instance_id
   device_get_gpu_instance_possible_placements_v2
   device_get_gpu_instance_profile_info_by_id_v
   device_get_gpu_instance_profile_info_v
   device_get_gpu_instance_remaining_capacity
   device_get_gpu_instances
   device_get_gpu_max_pcie_link_generation
   device_get_gpu_operation_mode
   device_get_grid_licensable_features_v4
   device_get_gsp_firmware_mode
   device_get_gsp_firmware_version
   device_get_handle_by_index_v2
   device_get_handle_by_pci_bus_id_v2
   device_get_handle_by_serial
   device_get_handle_by_uuid
   device_get_handle_by_uuidv
   device_get_host_vgpu_mode
   device_get_hostname_v1
   device_get_index
   device_get_inforom_configuration_checksum
   device_get_inforom_image_version
   device_get_inforom_version
   device_get_irq_num
   device_get_jpg_utilization
   device_get_last_bbx_flush_time
   device_get_margin_temperature
   device_get_max_clock_info
   device_get_max_customer_boost_clock
   device_get_max_mig_device_count
   device_get_max_pcie_link_generation
   device_get_max_pcie_link_width
   device_get_mem_clk_min_max_vf_offset
   device_get_mem_clk_vf_offset
   device_get_memory_affinity
   device_get_memory_bus_width
   device_get_memory_error_counter
   device_get_memory_info_v2
   device_get_mig_device_handle_by_index
   device_get_mig_mode
   device_get_min_max_clock_of_p_state
   device_get_min_max_fan_speed
   device_get_minor_number
   device_get_module_id
   device_get_mps_compute_running_processes_v3
   device_get_multi_gpu_board
   device_get_name
   device_get_num_fans
   device_get_num_gpu_cores
   device_get_numa_node_id
   device_get_nvlink_bw_mode
   device_get_nvlink_capability
   device_get_nvlink_error_counter
   device_get_nvlink_info
   device_get_nvlink_remote_device_type
   device_get_nvlink_remote_pci_info_v2
   device_get_nvlink_state
   device_get_nvlink_supported_bw_modes
   device_get_nvlink_version
   device_get_ofa_utilization
   device_get_p2p_status
   device_get_pci_info_ext
   device_get_pci_info_v3
   device_get_pcie_link_max_speed
   device_get_pcie_replay_counter
   device_get_pcie_speed
   device_get_pcie_throughput
   device_get_pdi
   device_get_performance_modes
   device_get_performance_state
   device_get_persistence_mode
   device_get_pgpu_metadata_string
   device_get_platform_info
   device_get_power_management_default_limit
   device_get_power_management_limit
   device_get_power_management_limit_constraints
   device_get_power_mizer_mode_v1
   device_get_power_source
   device_get_power_state
   device_get_power_usage
   device_get_process_utilization
   device_get_processes_utilization_info
   device_get_remapped_rows
   device_get_repair_status
   device_get_retired_pages
   device_get_retired_pages_pending_status
   device_get_retired_pages_v2
   device_get_row_remapper_histogram
   device_get_running_process_detail_list
   device_get_samples
   device_get_serial
   device_get_sram_ecc_error_status
   device_get_sram_unique_uncorrected_ecc_error_counts
   device_get_supported_clocks_event_reasons
   device_get_supported_event_types
   device_get_supported_graphics_clocks
   device_get_supported_memory_clocks
   device_get_supported_performance_states
   device_get_supported_vgpus
   device_get_target_fan_speed
   device_get_temperature_threshold
   device_get_temperature_v
   device_get_thermal_settings
   device_get_topology_common_ancestor
   device_get_topology_nearest_gpus
   device_get_total_ecc_errors
   device_get_total_energy_consumption
   device_get_unrepairable_memory_flag_v1
   device_get_utilization_rates
   device_get_uuid
   device_get_vbios_version
   device_get_vgpu_capabilities
   device_get_vgpu_heterogeneous_mode
   device_get_vgpu_instances_utilization_info
   device_get_vgpu_metadata
   device_get_vgpu_process_utilization
   device_get_vgpu_processes_utilization_info
   device_get_vgpu_scheduler_capabilities
   device_get_vgpu_scheduler_log
   device_get_vgpu_scheduler_state
   device_get_vgpu_type_creatable_placements
   device_get_vgpu_type_supported_placements
   device_get_vgpu_utilization
   device_get_virtualization_mode
   device_is_mig_device_handle
   device_modify_drain_state
   device_on_same_board
   device_power_smoothing_activate_preset_profile
   device_power_smoothing_set_state
   device_power_smoothing_update_preset_profile_param
   device_query_drain_state
   device_read_prm_counters_v1
   device_read_write_prm_v1
   device_register_events
   device_remove_gpu_v2
   device_reset_gpu_locked_clocks
   device_reset_memory_locked_clocks
   device_reset_nvlink_error_counters
   device_set_accounting_mode
   device_set_api_restriction
   device_set_auto_boosted_clocks_enabled
   device_set_clock_offsets
   device_set_compute_mode
   device_set_conf_compute_unprotected_mem_size
   device_set_cpu_affinity
   device_set_default_auto_boosted_clocks_enabled
   device_set_default_fan_speed_v2
   device_set_dram_encryption_mode
   device_set_driver_model
   device_set_ecc_mode
   device_set_fan_control_policy
   device_set_fan_speed_v2
   device_set_gpu_locked_clocks
   device_set_gpu_operation_mode
   device_set_hostname_v1
   device_set_memory_locked_clocks
   device_set_mig_mode
   device_set_nvlink_bw_mode
   device_set_nvlink_device_low_power_threshold
   device_set_persistence_mode
   device_set_power_management_limit_v2
   device_set_power_mizer_mode_v1
   device_set_rusd_settings_v1
   device_set_temperature_threshold
   device_set_vgpu_capabilities
   device_set_vgpu_heterogeneous_mode
   device_set_vgpu_scheduler_state
   device_set_virtualization_mode
   device_validate_inforom
   error_string
   event_set_create
   event_set_free
   event_set_wait_v2
   get_excluded_device_count
   get_excluded_device_info_by_index
   get_vgpu_compatibility
   get_vgpu_driver_capabilities
   get_vgpu_version
   gpu_instance_create_compute_instance
   gpu_instance_create_compute_instance_with_placement
   gpu_instance_destroy
   gpu_instance_get_active_vgpus
   gpu_instance_get_compute_instance_by_id
   gpu_instance_get_compute_instance_possible_placements
   gpu_instance_get_compute_instance_profile_info_v
   gpu_instance_get_compute_instance_remaining_capacity
   gpu_instance_get_compute_instances
   gpu_instance_get_creatable_vgpus
   gpu_instance_get_info
   gpu_instance_get_vgpu_heterogeneous_mode
   gpu_instance_get_vgpu_scheduler_log
   gpu_instance_get_vgpu_scheduler_state
   gpu_instance_get_vgpu_type_creatable_placements
   gpu_instance_set_vgpu_heterogeneous_mode
   gpu_instance_set_vgpu_scheduler_state
   init_v2
   init_with_flags
   set_vgpu_version
   shutdown
   system_event_set_create
   system_event_set_free
   system_event_set_wait
   system_get_conf_compute_capabilities
   system_get_conf_compute_gpus_ready_state
   system_get_conf_compute_key_rotation_threshold_info
   system_get_conf_compute_settings
   system_get_conf_compute_state
   system_get_cuda_driver_version
   system_get_cuda_driver_version_v2
   system_get_driver_branch
   system_get_driver_version
   system_get_hic_version
   system_get_nvlink_bw_mode
   system_get_nvml_version
   system_get_process_name
   system_get_topology_gpu_set
   system_register_events
   system_set_conf_compute_gpus_ready_state
   system_set_conf_compute_key_rotation_threshold_info
   system_set_nvlink_bw_mode
   unit_get_count
   unit_get_devices
   unit_get_fan_speed_info
   unit_get_handle_by_index
   unit_get_led_state
   unit_get_psu_info
   unit_get_temperature
   unit_get_unit_info
   unit_set_led_state
   vgpu_instance_clear_accounting_pids
   vgpu_instance_get_accounting_mode
   vgpu_instance_get_accounting_pids
   vgpu_instance_get_accounting_stats
   vgpu_instance_get_ecc_mode
   vgpu_instance_get_encoder_capacity
   vgpu_instance_get_encoder_sessions
   vgpu_instance_get_encoder_stats
   vgpu_instance_get_fb_usage
   vgpu_instance_get_fbc_sessions
   vgpu_instance_get_fbc_stats
   vgpu_instance_get_frame_rate_limit
   vgpu_instance_get_gpu_instance_id
   vgpu_instance_get_gpu_pci_id
   vgpu_instance_get_license_info_v2
   vgpu_instance_get_license_status
   vgpu_instance_get_mdev_uuid
   vgpu_instance_get_metadata
   vgpu_instance_get_placement_id
   vgpu_instance_get_runtime_state_size
   vgpu_instance_get_type
   vgpu_instance_get_uuid
   vgpu_instance_get_vm_driver_version
   vgpu_instance_get_vm_id
   vgpu_instance_set_encoder_capacity
   vgpu_type_get_bar1_info
   vgpu_type_get_capabilities
   vgpu_type_get_class
   vgpu_type_get_device_id
   vgpu_type_get_fb_reservation
   vgpu_type_get_frame_rate_limit
   vgpu_type_get_framebuffer_size
   vgpu_type_get_gpu_instance_profile_id
   vgpu_type_get_gsp_heap_size
   vgpu_type_get_license
   vgpu_type_get_max_instances
   vgpu_type_get_max_instances_per_gpu_instance
   vgpu_type_get_max_instances_per_vm
   vgpu_type_get_name         
   vgpu_type_get_num_display_heads
   vgpu_type_get_resolution

Enums
-----

.. autosummary::
   :toctree: generated/

   AdaptiveClockingInfoStatus
   AffinityScope
   BrandType
   BridgeChipType
   BusType
   C2CPowerState
   CCAcceptingClientRequests
   CCSystemCpuCaps
   CCSystemDevtoolsMode
   CCSystemEnvironment
   CCSystemFeature
   CCSystemGpus
   CCSystemMultiGpu
   ClockId
   ClockLimitId
   ClocksEventReasons
   ClockType
   ComputeInstanceEngineProfile
   ComputeInstanceProfile
   ComputeInstanceProfileCaps
   ComputeMode
   CoolerControl
   CoolerTarget
   DetachGpuState
   DeviceAddressingModeType
   DeviceArch
   DeviceGpuRecoveryAction
   DeviceMig
   DeviceVgpuCapability
   DriverModel
   EccCounterType
   EnableState
   EncoderQuery
   EncoderType
   EventType
   FanControlPolicy
   FanState
   FBCSessionType
   FieldId
   GpmMetricId
   GpuFabricHealthMaskAccessTimeout
   GpuFabricHealthMaskDegradedBw
   GpuFabricHealthMaskIncorrectConfiguration
   GpuFabricHealthMaskRouteRecovery
   GpuFabricHealthMaskRouteUnhealthy
   GpuFabricHealthSummary
   GpuFabricState
   GpuInstanceProfile
   GpuInstanceProfileCaps
   GpuOperationMode
   GpuP2PCapsIndex
   GpuP2PStatus
   GpuTopologyLevel
   GpuUtilizationDomainId
   GpuVirtualizationMode
   GridLicenseExpiryEnum
   GridLicenseFeatureCode
   GridLicenseState
   HostVgpuMode
   InforomObject
   InitFlag
   IntNvLinkDeviceType
   LedColor
   MemoryErrorType
   MemoryLocation
   NvFBCSessionFlag
   NvLinkCapability
   NvLinkErrorCounter
   NvlinkFirmwareUcodeType
   NvlinkLowPowerThreshold
   NvlinkLowPowerThresholdUnit
   NvlinkPowerState
   NvlinkState
   NvLinkUtilizationCountPktTypes
   NvLinkUtilizationCountUnits
   NvlinkVersion
   PageRetirementCause
   PcieAtomicsCap
   PcieLinkMaxSpeed
   PcieLinkState
   PcieUtilCounter
   PerfPolicyType
   PowerMizerMode
   PowerProfileOperation
   PowerProfileType
   PowerScope
   PowerSmoothingProfileParam
   PowerSource
   PRMCounterId
   Pstates
   RestrictedAPI
   Return
   RUSD
   SamplingType
   SystemEventType
   TemperatureSensors
   TemperatureThresholds
   ThermalController
   ThermalTarget
   UUIDType
   ValueType
   VgpuCapability
   VgpuDriverCapability
   VgpuGuestInfoState
   VgpuPgpu
   VgpuPgpuCompatibilityLimitCode
   VgpuPgpuVirtualizationCapMigration
   VgpuSchedulerArr
   VgpuSchedulerEngineType
   VgpuSchedulerPolicy
   VgpuVirtualizationCapMigration
   VgpuVmCompatibility
   VgpuVmIdType

Types
-----

.. autosummary::
   :toctree: generated/

   AccountingStats
   ActiveVgpuInstanceInfo_v1
   BAR1Memory
   BridgeChipHierarchy
   BridgeChipInfo
   C2cModeInfo_v1
   ClkMonFaultInfo
   ClkMonStatus
   ClockOffset_v1
   ComputeInstanceInfo
   ComputeInstancePlacement
   ComputeInstanceProfileInfo_v2
   ComputeInstanceProfileInfo_v3
   ConfComputeGpuAttestationReport
   ConfComputeGpuCertificate
   ConfComputeMemSizeInfo
   ConfComputeSystemCaps
   ConfComputeSystemState
   CoolerInfo_v1
   DeviceAddressingMode_v1
   DeviceAttributes
   DevicePowerMizerModes_v1
   EccSramErrorStatus_v1
   EccSramUniqueUncorrectedErrorCounts_v1
   EccSramUniqueUncorrectedErrorEntry_v1
   EncoderSessionInfo
   EventData
   ExcludedDeviceInfo
   FBCSessionInfo
   FBCStats
   FieldValue
   GpuDynamicPstatesInfo
   GpuFabricInfo_v2
   GpuFabricInfo_v3
   GpuInstanceInfo
   GpuInstancePlacement
   GpuInstanceProfileInfo_v3
   GpuThermalSettings
   GridLicensableFeature
   GridLicensableFeatures
   GridLicenseExpiry
   HwbcEntry
   LedState
   Memory
   Memory_v2
   NvlinkFirmwareInfo
   NvlinkFirmwareVersion
   NvlinkGetBwMode_v1
   NvLinkInfo_v1
   NvLinkInfo_v2   
   NvlinkSetBwMode_v1
   NvlinkSupportedBwModes_v1
   PciInfo
   PciInfoExt_v1
   PlatformInfo_v1
   PlatformInfo_v2
   PRMCounter_v1
   PRMCounterInput_v1
   PRMCounterValue_v1
   ProcessDetail_v1
   ProcessDetailList_v1
   ProcessesUtilizationInfo_v1
   ProcessInfo
   ProcessUtilizationInfo_v1
   ProcessUtilizationSample
   PSUInfo
   RepairStatus_v1
   RowRemapperHistogramValues
   Sample
   SystemConfComputeSettings_v1
   SystemEventData_v1
   UnitFanInfo
   UnitFanSpeeds
   UnitInfo
   Utilization
   Value
   VgpuCreatablePlacementInfo_v1
   VgpuInstancesUtilizationInfo_v1
   VgpuInstanceUtilizationInfo_v1
   VgpuInstanceUtilizationSample
   VgpuLicenseExpiry
   VgpuLicenseInfo
   VgpuMetadata
   VgpuPgpuCompatibility
   VgpuPgpuMetadata
   VgpuPlacementList_v2
   VgpuProcessesUtilizationInfo_v1
   VgpuProcessUtilizationInfo_v1
   VgpuSchedulerCapabilities
   VgpuSchedulerGetState
   VgpuSchedulerLog
   VgpuSchedulerLogEntry
   VgpuSchedulerLogInfo_v1
   VgpuSchedulerParams
   VgpuSchedulerSetParams
   VgpuSchedulerState_v1
   VgpuSchedulerStateInfo_v1
   VgpuTypeBar1Info_v1
   VgpuTypeIdInfo_v1
   VgpuVersion

Exceptions
----------

.. autosummary::
   :toctree: generated/

   NvmlError
   UninitializedError
   InvalidArgumentError
   NotSupportedError
   NoPermissionError
   AlreadyInitializedError
   NotFoundError
   InsufficientSizeError
   InsufficientPowerError
   DriverNotLoadedError
   TimeoutError
   IrqIssueError
   LibraryNotFoundError
   FunctionNotFoundError
   CorruptedInforomError
   GpuIsLostError
   ResetRequiredError
   OperatingSystemError
   LibRmVersionMismatchError
   InUseError
   MemoryError
   NoDataError
   VgpuEccNotSupportedError
   InsufficientResourcesError
   FreqNotSupportedError
   ArgumentVersionMismatchError
   DeprecatedError
   NotReadyError
   GpuNotFoundError
   InvalidStateError
   ResetTypeNotSupportedError
   UnknownError
