[BUG]: ProcessInfo.used_gpu_memory returns the NVML_VALUE_NOT_AVAILABLE sentinel as a byte count
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 cuda_core/cuda/core/system/_process.pxi 第 21-26 行開始,其中 used_gpu_memory 會從 NVML 讀取並原樣傳回。閱讀 cuda.bindings.nvml 中針對 NVML_VALUE_NOT_AVAILABLE 的欄位 docstring,然後比較同一模組中 gpu_instance_id 如何拋出 NotSupportedError。完成代表要將該哨兵值轉換成 None 或 NotSupportedError,並且有一個測試涵蓋 WDDM/N-A 路徑。
由索引模型根據 Issue 內容生成。
描述
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Silent Failure
Component
cuda.core
Describe the bug
ProcessInfo.used_gpu_memory is documented as "the amount of GPU memory (in bytes) used by the process", but it returns NVML's NVML_VALUE_NOT_AVAILABLE sentinel unchanged when the driver can't report it. Under WDDM, which includes WSL2, that is always the case. The caller gets 18446744073709551615 (2**64 - 1) and can't tell it apart from a real byte count. nvidia-smi shows [N/A] for the same process.
The cuda.bindings.nvml docstring for the underlying field does mention the sentinel ("Under WDDM, NVML_VALUE_NOT_AVAILABLE is always reported"). The cuda.core wrapper doesn't translate it or document it. Summing or comparing used_gpu_memory across processes gives nonsense values.
How to Reproduce
On a WDDM / WSL2 system:
import cuda.core
from cuda.core import system
cuda.core.Device(0).set_current() # make this process a compute process
dev = system.Device(index=0)
for p in dev.compute_running_processes:
print(p.pid, p.used_gpu_memory)
Output:
1397 18446744073709551615
1120 18446744073709551615
nvidia-smi --query-compute-apps=pid,used_memory --format=csv on the same machine:
pid, used_gpu_memory [MiB]
1120, [N/A]
Expected behavior
When NVML reports NVML_VALUE_NOT_AVAILABLE, used_gpu_memory should say so, for example by returning None or raising NotSupportedError (the way gpu_instance_id does for non-MIG devices). It shouldn't return the raw sentinel as a byte count.
Operating System
Linux container (python:3.12-slim) on Windows 11 / WSL2 with the NVIDIA container runtime.
nvidia-smi output
| NVIDIA-SMI 610.59 KMD Version: 610.91 CUDA UMD Version: 13.3 |
| 0 NVIDIA GeForce RTX 3050 ... On | 00000000:01:00.0 Off | N/A |
Python 3.12.16. Packages:
cuda-bindings 13.5.0
cuda-core 1.3.0
cuda-pathfinder 1.9.0
cuda-toolkit 13.5.0
cupy-cuda13x 14.2.0
numpy 2.5.4
nvidia-cuda-nvrtc 13.5.37
nvidia-cufile 1.20.0.107
nvidia-nvfatbin 13.5.37
nvidia-nvjitlink 13.5.37
nvidia-nvvm 13.5.37
_process.pxi is unchanged between cuda-core-v1.3.0 and current main (ba7dcd0).
Happy to send a fix if that helps.
- 主要語言
- Cython
- 星號
- 3.4k
- 分支
- 353
- 平均合併
- 2 天 3 小時
- 30 天內合併 PR
- 163
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
NVIDIA/cuda-python 的其他 Issue
-
[BUG]: the `__cuda_stream__` deprecation warning points to `Stream(obj)`, which always raises可能已有人在做 @Iamsohungrynow 於 5 天前認領。 未關閉bug cuda.core P1
難度 1/5 1 小時以內 新手友好度 86/100
NVIDIA/cuda-python#3505 · 3 則留言 · 1 個 reaction · 已指派 1 人 ·
維護者通常 1 天內回覆
-
triage
難度 2/5 1-3 小時 新手友好度 68/100
NVIDIA/cuda-python#3409 ·
維護者通常 1 天內回覆
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRs可能重新可做 @rwgk 於 48 天前認領,目前沒有進行中的 PR。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
NVIDIA/cuda-python#2952 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookup可能已有人在做 @rwgk 於 62 天前認領。 未關閉triage
難度 2/5 1-3 小時 新手友好度 82/100
NVIDIA/cuda-python#2646 · 1 個 reaction ·
維護者通常 1 天內回覆
-
documentation
難度 4/5 3-5 天 新手友好度 35/100
NVIDIA/cuda-python#3617 ·
維護者通常 1 天內回覆
查看 NVIDIA/cuda-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 66/100
維護者通常 1 天內回覆
-
aws-documentation-mcp-server: empty spanning headers shift table column labels可能已有人在做 @pradeep-ramola 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 2 天內回覆
-
bug untriaged
難度 2/5 1-3 小時 新手友好度 78/100
opensearch-project/sql#5990 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 72/100
GustavoBaranda/chatflow-agent#238 ·
維護者通常 1 天內回覆