Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pynvml>=11.5 in WSL #8962

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion distributed/diagnostics/nvml.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ def _in_wsl():
return "microsoft-standard" in uname().release


def _maybe_decode(value):
"""Decode if bytes instance"""
return value.decode() if isinstance(value, bytes) else value


rjzamora marked this conversation as resolved.
Show resolved Hide resolved
def init_once():
"""Idempotent (per-process) initialization of PyNVML

Expand Down Expand Up @@ -105,7 +110,7 @@ def init_once():
return

if _in_wsl() and parse_version(
pynvml.nvmlSystemGetDriverVersion().decode()
_maybe_decode(pynvml.nvmlSystemGetDriverVersion())
rjzamora marked this conversation as resolved.
Show resolved Hide resolved
) < parse_version(MINIMUM_WSL_VERSION):
NVML_STATE = NVMLState.DISABLED_WSL_INSUFFICIENT_DRIVER
return
Expand Down
Loading