[BUG]: ProcessInfo.used_gpu_memory returns the NVML_VALUE_NOT_AVAILABLE sentinel as a byte count
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 80/100
Direção de pesquisa
Comece em cuda_core/cuda/core/system/_process.pxi linhas 21-26, onde used_gpu_memory é lido do NVML e retornado sem alterações. Leia a docstring de campo de cuda.bindings.nvml para NVML_VALUE_NOT_AVAILABLE, depois compare como gpu_instance_id lança NotSupportedError no mesmo módulo. Concluído significa que o sentinel é traduzido para None ou NotSupportedError e um teste cobre o caminho WDDM/N-A.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Cython
- Estrelas
- 3.4k
- Forks
- 353
- Merge médio
- 2d 3h
- PRs com merge (30d)
- 163
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NVIDIA/cuda-python
-
[BUG]: the `__cuda_stream__` deprecation warning points to `Stream(obj)`, which always raisesTalvez já em andamento @Iamsohungrynow assumiu há 5 dias. Abertabug cuda.core P1
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
NVIDIA/cuda-python#3505 · 3 comentários · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
NVIDIA/cuda-python#3409 ·
Mantenedores costumam responder em até 1 dia
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRsTalvez livre de novo @rwgk assumiu há 48 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
NVIDIA/cuda-python#2952 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookupTalvez já em andamento @rwgk assumiu há 62 dias. Abertatriage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NVIDIA/cuda-python#2646 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
documentation
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
NVIDIA/cuda-python#3617 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de NVIDIA/cuda-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
vllm-project/vllm#70030 ·
Mantenedores costumam responder em até 1 dia
-
help wanted small extra
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
t: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 3 dias
-
Retry an empty final answer when Gemini reports MALFORMED_RESPONSE (gemini-4-hydrogen)Talvez já em andamento @waleedkadous assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
iaser-ai/ansari#444 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia