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

nvmlSystemGetProcessName fails for WSL #49

Open
fostiropoulos opened this issue Aug 24, 2023 · 0 comments
Open

nvmlSystemGetProcessName fails for WSL #49

fostiropoulos opened this issue Aug 24, 2023 · 0 comments

Comments

@fostiropoulos
Copy link

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"

return res.decode()

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"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant