[GH-ISSUE #49] [BUG] Cannot gather infomation of the /XWayland process in WSLg #36

Open
opened 2026-05-05 03:22:48 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @XuehaiPan on GitHub (Dec 11, 2022).
Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/49

Originally assigned to: @XuehaiPan on GitHub.

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.

Originally created by @XuehaiPan on GitHub (Dec 11, 2022). Original GitHub issue: https://github.com/XuehaiPan/nvitop/issues/49 Originally assigned to: @XuehaiPan on GitHub. ### Required prerequisites - [X] I have read the documentation <https://nvitop.readthedocs.io>. - [X] I have searched the [Issue Tracker](https://github.com/XuehaiPan/nvitop/issues) that this hasn't already been reported. (comment there if it has.) - [X] 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 ```text 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 ```console $ 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: ```pwsh $ wsl.exe --shutdown $ wsl.exe --update $ wsl.exe user@WSL $ nvitop ``` ### Traceback _No response_ ### Logs ```text $ 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](https://user-images.githubusercontent.com/16078332/220835874-b94243d3-3306-4b53-9166-dc7ec31fd5e9.png) ### 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. - microsoft/wslg#919
gitea-mirror added the
cli / tui
api
bug
upstream
labels 2026-05-05 03:22:48 -06:00
Author
Owner

@pomeloyou commented on GitHub (Jun 17, 2023):

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

<!-- gh-comment-id:1595666243 --> @pomeloyou commented on GitHub (Jun 17, 2023): I have the same problem, do you resolve it ? ![Pasted image 20230616112558](https://github.com/XuehaiPan/nvitop/assets/50685812/603ff6f6-8791-4188-9c31-0acfef799fd1)
Author
Owner

@XuehaiPan commented on GitHub (Jun 17, 2023):

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 ...
<!-- gh-comment-id:1595740525 --> @XuehaiPan commented on GitHub (Jun 17, 2023): > 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. ```bash docker run --pid=host ... ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/nvitop#36
No description provided.