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

[BUG] Cannot gather infomation of the /XWayland process in WSLg #49

Open
3 tasks done
XuehaiPan opened this issue Dec 11, 2022 · 2 comments
Open
3 tasks done

[BUG] Cannot gather infomation of the /XWayland process in WSLg #49

XuehaiPan opened this issue Dec 11, 2022 · 2 comments
Assignees
Labels
api Something related to the core APIs bug Something isn't working cli / gui Something related to the CLI upstream Something upstream related

Comments

@XuehaiPan
Copy link
Owner

XuehaiPan commented Dec 11, 2022

Required prerequisites

  • I have read the documentation https://nvitop.readthedocs.io.
  • I have searched the Issue Tracker that this hasn't already been reported. (comment there if it has.)
  • I have tried the latest version of nvitop in an new isolated virtual environment.

What version of nvitop are you using?

0.11.0

Operating system and version

Windows 10 build 10.0.19045.0

NVIDIA driver version

526.98

NVIDIA-SMI

Sat Dec 10 20:36:09 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.60.02    Driver Version: 526.98       CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:09:00.0  On |                  N/A |
|  0%   56C    P3    34W / 240W |   2880MiB /  8192MiB |      7%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A        23      G   /Xwayland                       N/A      |
+-----------------------------------------------------------------------------+

Python environment

$ python3 -m pip freeze | python3 -c 'import sys; print(sys.version, sys.platform); print("".join(filter(lambda s: any(word in s.lower() for word in ("nvi", "cuda", "nvml", "gpu")), sys.stdin)))'
3.10.8 (main, Oct 11 2022, 11:35:05) [GCC 11.2.0] linux
nvidia-ml-py==11.515.75
nvitop==0.11.0

Problem description

The XWayland process in WSLg uses the NVIDIA GPU in the WSL instance. However, WSL does not expose the process in the /proc directory. So the psutil fails to gather process information by reading the files under /proc/23.

Steps to Reproduce

Command lines:

$ wsl.exe --shutdown
$ wsl.exe --update
$ wsl.exe
user@WSL $ nvitop

Traceback

No response

Logs

$ nvitop -1
Sat Dec 10 12:35:33 2022
╒═════════════════════════════════════════════════════════════════════════════╕
│ NVITOP 0.11.0        Driver Version: 526.98       CUDA Driver Version: 12.0 │
├───────────────────────────────┬──────────────────────┬──────────────────────┤
│ GPU  Name        Persistence-M│ Bus-Id        Disp.A │ Volatile Uncorr. ECC │
│ Fan  Temp  Perf  Pwr:Usage/Cap│         Memory-Usage │ GPU-Util  Compute M. │
╞═══════════════════════════════╪══════════════════════╪══════════════════════╪════════════════════╕
│   0  GeForce RTX 3070    On   │ 00000000:09:00.0  On │                  N/A │ MEM: ███▏ 34.7%    │
│  0%   55C    P3    30W / 240W │    2844MiB / 8192MiB │     49%      Default │ UTL: ████▍ 49%     │
╘═══════════════════════════════╧══════════════════════╧══════════════════════╧════════════════════╛
[ CPU: █▌ 3.1%                                                ]  ( Load Average:  0.08  0.02  0.01 )
[ MEM: ██▎ 4.5%                                               ]  [ SWP: ▏ 0.0%                     ]

╒══════════════════════════════════════════════════════════════════════════════════════════════════╕
│ Processes:                                                       PanXuehai@BIGAI-PanXuehai (WSL) │
│ GPU     PID      USER  GPU-MEM %SM  %CPU  %MEM  TIME  COMMAND                                    │
╞══════════════════════════════════════════════════════════════════════════════════════════════════╡
│   0      23 G     N/A WDDM:N/A N/A   N/A   N/A   N/A  No Such Process                            │
╘══════════════════════════════════════════════════════════════════════════════════════════════════╛

Screenshot:

image

Expected behavior

Show the process information rather than N/A and No Such Process.

Additional context

I have raised an issue in microsoft/wslg#919.

@XuehaiPan XuehaiPan added the bug Something isn't working label Dec 11, 2022
@XuehaiPan XuehaiPan self-assigned this Dec 11, 2022
@XuehaiPan XuehaiPan added upstream Something upstream related api Something related to the core APIs cli / gui Something related to the CLI labels Dec 11, 2022
@pomeloyou
Copy link

I have the same problem, do you resolve it ?
Pasted image 20230616112558

@XuehaiPan
Copy link
Owner Author

I have the same problem, do you resolve it?

@pomeloyou Seems that you are using docker containers rather than WSLg. You need to pass --pid=host when running the container.

docker run --pid=host ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Something related to the core APIs bug Something isn't working cli / gui Something related to the CLI upstream Something upstream related
Projects
None yet
Development

No branches or pull requests

2 participants