@@ -34,6 +34,7 @@ include "_inforom.pxi"
3434include " _memory.pxi"
3535include " _pci_info.pxi"
3636include " _performance.pxi"
37+ include " _process.pxi"
3738include " _repair_status.pxi"
3839include " _temperature.pxi"
3940
@@ -716,6 +717,33 @@ cdef class Device:
716717 """
717718 return [Pstates(x) for x in nvml.device_get_supported_performance_states(self._handle)]
718719
720+ ##########################################################################
721+ # PROCESS
722+ # See external class definitions in _process.pxi
723+
724+ @property
725+ def compute_running_processes(self) -> list[ProcessInfo]:
726+ """
727+ Get information about processes with a compute context on a device
728+
729+ For Fermi™ or newer fully supported devices.
730+
731+ This function returns information only about compute running processes
732+ (e.g. CUDA application which have active context). Any graphics
733+ applications (e.g. using OpenGL, DirectX) won' t be listed by this
734+ function.
735+
736+ Keep in mind that information returned by this call is dynamic and the
737+ number of elements might change in time.
738+
739+ In MIG mode, if device handle is provided, the API returns aggregate
740+ information, only if the caller has appropriate privileges. Per- instance
741+ information can be queried by using specific MIG device handles.
742+ Querying per- instance information using MIG device handles is not
743+ supported if the device is in vGPU Host virtualization mode.
744+ """
745+ return [ProcessInfo(proc) for proc in nvml.device_get_compute_running_processes_v3(self._handle)]
746+
719747 ##########################################################################
720748 # REPAIR STATUS
721749 # See external class definitions in _repair_status.pxi
@@ -855,6 +883,7 @@ __all__ = [
855883 "MemoryInfo",
856884 "PcieUtilCounter",
857885 "PciInfo",
886+ "ProcessInfo",
858887 "Pstates",
859888 "RepairStatus",
860889 "Temperature",
0 commit comments