Skip to content

Commit 0c15432

Browse files
committed
Check for NVML disable before initialization
1 parent a2e26b6 commit 0c15432

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

distributed/diagnostics/nvml.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
def init_once():
1717
global nvmlEnabled, nvmlInitialized, nvmlLibraryNotFound, nvmlOwnerPID
18-
if pynvml is None or (nvmlInitialized is True and nvmlOwnerPID == os.getpid()):
19-
return
2018

2119
nvmlEnabled = dask.config.get("distributed.diagnostics.nvml")
2220
if nvmlEnabled is False:
21+
nvmlInitialized = False
22+
return
23+
24+
if pynvml is None or (nvmlInitialized is True and nvmlOwnerPID == os.getpid()):
2325
return
2426

2527
nvmlInitialized = True

0 commit comments

Comments
 (0)