[BUG]: ProcessInfo.used_gpu_memory returns the NVML_VALUE_NOT_AVAILABLE sentinel as a byte count
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 80/100
Rechercherichtung
Beginne bei cuda_core/cuda/core/system/_process.pxi Zeilen 21-26, wo used_gpu_memory aus NVML gelesen und unverändert zurückgegeben wird. Lies den Feld-Docstring von cuda.bindings.nvml für NVML_VALUE_NOT_AVAILABLE und vergleiche dann, wie gpu_instance_id im selben Modul NotSupportedError auslöst. Erledigt bedeutet, dass der Sentinel zu None oder NotSupportedError übersetzt wird und ein Test den WDDM/N-A-Pfad abdeckt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Cython
- Sterne
- 3.4k
- Forks
- 353
- Ø Merge
- 2 T. 3 Std.
- Gemergte PRs (30 T.)
- 163
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NVIDIA/cuda-python
-
[BUG]: the `__cuda_stream__` deprecation warning points to `Stream(obj)`, which always raisesEvtl. vergeben @Iamsohungrynow hat das vor 5 Tagen übernommen. Offenbug cuda.core P1
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
NVIDIA/cuda-python#3505 · 3 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
NVIDIA/cuda-python#3409 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRsEvtl. wieder frei @rwgk hat das vor 48 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
NVIDIA/cuda-python#2952 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookupEvtl. vergeben @rwgk hat das vor 62 Tagen übernommen. Offentriage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NVIDIA/cuda-python#2646 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
NVIDIA/cuda-python#3617 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in NVIDIA/cuda-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
vllm-project/vllm#70030 ·
Maintainer antworten meist innerhalb von 1 Tag
-
help wanted small extra
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
t: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 3 Tagen
-
Retry an empty final answer when Gemini reports MALFORMED_RESPONSE (gemini-4-hydrogen)Evtl. vergeben @waleedkadous hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
iaser-ai/ansari#444 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag