@@ -32,10 +32,12 @@ include "_fan.pxi"
3232include " _field_values.pxi"
3333include " _inforom.pxi"
3434include " _memory.pxi"
35+ include " _nvlink.pxi"
3536include " _pci_info.pxi"
3637include " _performance.pxi"
3738include " _repair_status.pxi"
3839include " _temperature.pxi"
40+ include " _utilization.pxi"
3941
4042
4143cdef class Device:
@@ -674,6 +676,18 @@ cdef class Device:
674676 """
675677 return MemoryInfo(nvml.device_get_memory_info_v2(self._handle))
676678
679+ ##########################################################################
680+ # NVLINK
681+ # See external class definitions in _nvlink.pxi
682+
683+ def nvlink(self, link: int) -> NvlinkInfo:
684+ """
685+ Get :obj:`~ NvlinkInfo` about this device.
686+
687+ For devices with NVLink support.
688+ """
689+ return NvlinkInfo(self, link)
690+
677691 ##########################################################################
678692 # PCI INFO
679693 # See external class definitions in _pci_info.pxi
@@ -765,6 +779,31 @@ cdef class Device:
765779 device._handle = handle
766780 yield device
767781
782+ #######################################################################
783+ # UTILIZATION
784+
785+ @property
786+ def utilization(self) -> Utilization:
787+ """
788+ Retrieves the current :obj:`~ Utilization` rates for the device' s major
789+ subsystems.
790+
791+ For Fermi™ or newer fully supported devices.
792+
793+ Note: During driver initialization when ECC is enabled one can see high
794+ GPU and Memory Utilization readings. This is caused by ECC Memory
795+ Scrubbing mechanism that is performed during driver initialization.
796+
797+ Note: On MIG- enabled GPUs, querying device utilization rates is not
798+ currently supported.
799+
800+ Returns
801+ -------
802+ Utilization
803+ An object containing the current utilization rates for the device.
804+ """
805+ return Utilization(nvml.device_get_utilization_rates(self._handle))
806+
768807
769808def get_topology_common_ancestor(device1: Device, device2: Device) -> GpuTopologyLevel:
770809 """
@@ -853,6 +892,8 @@ __all__ = [
853892 "InforomInfo",
854893 "InforomObject",
855894 "MemoryInfo",
895+ "NvlinkInfo",
896+ "NvlinkVersion",
856897 "PcieUtilCounter",
857898 "PciInfo",
858899 "Pstates",
@@ -864,4 +905,5 @@ __all__ = [
864905 "ThermalSensor",
865906 "ThermalSettings",
866907 "ThermalTarget",
908+ "Utilization",
867909]
0 commit comments