mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 21:12:07 -07:00
upd pynvml.py
This commit is contained in:
parent
406ef91851
commit
41601f50b8
1 changed files with 12 additions and 5 deletions
|
@ -636,9 +636,16 @@ def _LoadNvmlLibrary():
|
|||
if (nvmlLib == None):
|
||||
try:
|
||||
if (sys.platform[:3] == "win"):
|
||||
# cdecl calling convention
|
||||
# load nvml.dll from %ProgramFiles%/NVIDIA Corporation/NVSMI/nvml.dll
|
||||
nvmlLib = CDLL(os.path.join(os.getenv("ProgramFiles", "C:/Program Files"), "NVIDIA Corporation/NVSMI/nvml.dll"))
|
||||
searchPaths = [
|
||||
os.path.join(os.getenv("ProgramFiles", r"C:\Program Files"), r"NVIDIA Corporation\NVSMI\nvml.dll"),
|
||||
os.path.join(os.getenv("WinDir", r"C:\Windows"), r"System32\nvml.dll"),
|
||||
]
|
||||
nvmlPath = next((x for x in searchPaths if os.path.isfile(x)), None)
|
||||
if (nvmlPath == None):
|
||||
_nvmlCheckReturn(NVML_ERROR_LIBRARY_NOT_FOUND)
|
||||
else:
|
||||
# cdecl calling convention
|
||||
nvmlLib = CDLL(nvmlPath)
|
||||
else:
|
||||
# assume linux
|
||||
nvmlLib = CDLL("libnvidia-ml.so.1")
|
||||
|
@ -1668,7 +1675,7 @@ def nvmlSystemGetTopologyGpuSet(cpuNumber):
|
|||
|
||||
if ret != NVML_SUCCESS:
|
||||
raise NVMLError(ret)
|
||||
print ("c_count.value")
|
||||
print(c_count.value)
|
||||
# call again with a buffer
|
||||
device_array = c_nvmlDevice_t * c_count.value
|
||||
c_devices = device_array()
|
||||
|
@ -1717,4 +1724,4 @@ def nvmlDeviceGetCudaComputeCapability(device):
|
|||
if (ret != NVML_SUCCESS):
|
||||
raise NVMLError(ret)
|
||||
|
||||
return c_major.value, c_minor.value
|
||||
return c_major.value, c_minor.value
|
Loading…
Add table
Add a link
Reference in a new issue