Skip to content

Commit

Permalink
move decode into try block
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed Dec 11, 2024
1 parent 6eabc90 commit 9d72fe7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions distributed/diagnostics/nvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ def init_once():
NVML_STATE = NVMLState.DISABLED_LIBRARY_NOT_FOUND
return

if _in_wsl() and parse_version(
pynvml.nvmlSystemGetDriverVersion().decode()
) < parse_version(MINIMUM_WSL_VERSION):
try:
driver_vsn = pynvml.nvmlSystemGetDriverVersion().decode()
except AttributeError:
driver_vsn = pynvml.nvmlSystemGetDriverVersion()
if _in_wsl() and parse_version(driver_vsn) < parse_version(MINIMUM_WSL_VERSION):
NVML_STATE = NVMLState.DISABLED_WSL_INSUFFICIENT_DRIVER
return
else:
Expand Down

0 comments on commit 9d72fe7

Please sign in to comment.