nvmlSystemGetProcessName https://docs.nvidia.com/deploy/nvml-api/group__nvmlSystemQueries.html#group__nvmlSystemQueries_1gf37b04cea12ef2fcf6a463fed1b983b2
Based on the documentation returns the a string encoded in ANSI.
However it is automatically decoded in "utf-8"
For this reason the function fails in WSL where the returned process name is in ANSI. ANSI encoding is not well-supported in Linux though.
A proposed solution would be to have a special case for windows (it already exists in other parts of the library) or set errors="ignore" for this specific function call (as it appears to be the only encoded in ANSI from the documentation)
Minimal Example
from pynvml.smi import nvidia_smi as smi
import torch
torch.randn(1000).to("cuda")
_instance = smi.getInstance()
# fails here
device = _instance.DeviceQuery()
device["gpu"][0]["processes"]
nvmlSystemGetProcessNamehttps://docs.nvidia.com/deploy/nvml-api/group__nvmlSystemQueries.html#group__nvmlSystemQueries_1gf37b04cea12ef2fcf6a463fed1b983b2Based on the documentation returns the a string encoded in ANSI.
However it is automatically decoded in "utf-8"
pynvml/pynvml/nvml.py
Line 1744 in 43a7803
For this reason the function fails in WSL where the returned process name is in ANSI. ANSI encoding is not well-supported in Linux though.
A proposed solution would be to have a special case for windows (it already exists in other parts of the library) or set
errors="ignore"for this specific function call (as it appears to be the only encoded in ANSI from the documentation)Minimal Example