Skip to content

Commit

Permalink
nvidia-ml-py 12.535.133
Browse files Browse the repository at this point in the history
  • Loading branch information
NVIDIA Corporation authored and github-actions[bot] committed Nov 2, 2023
1 parent 3d13d7c commit beb1ef8
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
42 changes: 39 additions & 3 deletions pynvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@
_nvmlEncoderQueryType_t = c_uint
NVML_ENCODER_QUERY_H264 = 0
NVML_ENCODER_QUERY_HEVC = 1
NVML_ENCODER_QUERY_AV1 = 2
NVML_ENCODER_QUERY_UNKNOWN = 255

_nvmlFBCSessionType_t = c_uint
NVML_FBC_SESSION_TYPE_UNKNOWN = 0
Expand Down Expand Up @@ -1193,7 +1195,7 @@ class c_nvmlProcessDetailList_v1_t(_PrintableStructure):

c_nvmlProcessDetailList_t = c_nvmlProcessDetailList_v1_t

nvmlProcessDetailList_v1 = 0x1000010
nvmlProcessDetailList_v1 = 0x1000018

class c_nvmlBridgeChipInfo_t(_PrintableStructure):
_fields_ = [
Expand Down Expand Up @@ -2315,6 +2317,14 @@ def nvmlDeviceValidateInforom(handle):
_nvmlCheckReturn(ret)
return None

def nvmlDeviceGetLastBBXFlushTime(handle):
c_timestamp = c_ulonglong()
c_durationUs = c_ulong()
fn = _nvmlGetFunctionPointer("nvmlDeviceGetLastBBXFlushTime")
ret = fn(handle, byref(c_timestamp), byref(c_durationUs))
_nvmlCheckReturn(ret)
return [c_timestamp.value, c_durationUs.value]

def nvmlDeviceGetDisplayMode(handle):
c_mode = _nvmlEnableState_t()
fn = _nvmlGetFunctionPointer("nvmlDeviceGetDisplayMode")
Expand Down Expand Up @@ -2883,8 +2893,34 @@ def nvmlDeviceGetRunningProcessDetailList(handle, version, mode):
c_processDetailList.mode = mode

fn = _nvmlGetFunctionPointer("nvmlDeviceGetRunningProcessDetailList")
ret = fn(handle, c_processDetailList)
return ret

# first call to get the size
ret = fn(handle, byref(c_processDetailList))
if (ret == NVML_SUCCESS):
# special case, no running processes
return []
elif (ret == NVML_ERROR_INSUFFICIENT_SIZE):
c_procs = c_nvmlProcessDetail_v1_t * c_processDetailList.numProcArrayEntries
c_processDetailList.procArray = cast((c_procs)(), POINTER(c_nvmlProcessDetail_v1_t))

# make the call again
ret = fn(handle, byref(c_processDetailList))
_nvmlCheckReturn(ret)

procs = []
for i in range(c_processDetailList.numProcArrayEntries):
# use an alternative struct for this object
obj = c_processDetailList.procArray[i]
if (obj.usedGpuMemory == NVML_VALUE_NOT_AVAILABLE_ulonglong.value):
obj.usedGpuMemory = None
if (obj.usedGpuCcProtectedMemory == NVML_VALUE_NOT_AVAILABLE_ulonglong.value):
obj.usedGpuCcProtectedMemory = None
procs.append(obj)

return procs
else:
# error case
raise NVMLError(ret)

def nvmlDeviceGetAutoBoostedClocksEnabled(handle):
c_isEnabled = _nvmlEnableState_t()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


setup(name=_package_name,
version='12.535.108',
version='12.535.133',
description='Python Bindings for the NVIDIA Management Library',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit beb1ef8

Please sign in to comment.