@@ -36,6 +36,7 @@ include "_mig.pxi"
3636include " _nvlink.pxi"
3737include " _pci_info.pxi"
3838include " _performance.pxi"
39+ include " _process.pxi"
3940include " _repair_status.pxi"
4041include " _temperature.pxi"
4142include " _utilization.pxi"
@@ -765,6 +766,33 @@ cdef class Device:
765766 """
766767 return [Pstates(x) for x in nvml.device_get_supported_performance_states(self._handle)]
767768
769+ ##########################################################################
770+ # PROCESS
771+ # See external class definitions in _process.pxi
772+
773+ @property
774+ def compute_running_processes(self) -> list[ProcessInfo]:
775+ """
776+ Get information about processes with a compute context on a device
777+
778+ For Fermi™ or newer fully supported devices.
779+
780+ This function returns information only about compute running processes
781+ (e.g. CUDA application which have active context). Any graphics
782+ applications (e.g. using OpenGL, DirectX) won' t be listed by this
783+ function.
784+
785+ Keep in mind that information returned by this call is dynamic and the
786+ number of elements might change in time.
787+
788+ In MIG mode, if device handle is provided, the API returns aggregate
789+ information, only if the caller has appropriate privileges. Per- instance
790+ information can be queried by using specific MIG device handles.
791+ Querying per- instance information using MIG device handles is not
792+ supported if the device is in vGPU Host virtualization mode.
793+ """
794+ return [ProcessInfo(self, proc) for proc in nvml.device_get_compute_running_processes_v3(self._handle)]
795+
768796 ##########################################################################
769797 # REPAIR STATUS
770798 # See external class definitions in _repair_status.pxi
0 commit comments