[BUG]: system.Device.bar1_memory_info.reserved raises AttributeError on None
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 62/100
Direção de pesquisa
Start by reading cuda_core/cuda/core/system/_memory.pxi around lines 36-51, where MemoryInfo._memory_info and its reserved getter live, then look at BAR1MemoryInfo in the same file to see the shadowing slot. Reproduce with the snippet in the issue to confirm bar1.reserved raises while total/free/used work. The fix is one of the two options the reporter lists (drop the inheritance or override reserved with a clear error) plus removing the duplicate slot; done means the repro prints or raises a documented exception and existing memory-info tests still pass.
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
Runtime Error
Component
cuda.core
Describe the bug
BAR1MemoryInfo subclasses MemoryInfo but declares its own cdef object _memory_info. The subclass methods use the new slot. The reserved property it inherits from MemoryInfo reads the base class's slot, which is never set. So Device.bar1_memory_info.reserved exists (it's in dir(), and isinstance(bar1, MemoryInfo) is true) but raises an internal AttributeError on None:
Code that handles a MemoryInfo generically (for example, logging total/used/free/reserved for both memory_info and bar1_memory_info) crashes on the BAR1 object.
How to Reproduce
from cuda.core import system
dev = system.Device(index=0)
bar1 = dev.bar1_memory_info
print(type(bar1).__mro__)
print("total:", bar1.total, "free:", bar1.free, "used:", bar1.used)
print("reserved:", bar1.reserved)
Output:
(<class 'cuda.core.system._device.BAR1MemoryInfo'>, <class 'cuda.core.system._device.MemoryInfo'>, <class 'object'>)
total: 8589934592 free: 8589934592 used: 0
Traceback (most recent call last):
File "repro.py", line 7, in <module>
print("reserved:", bar1.reserved)
^^^^^^^^^^^^^
File "cuda/core/system/_memory.pxi", line 41, in cuda.core.system._device.MemoryInfo.reserved.__get__
AttributeError: 'NoneType' object has no attribute 'reserved'
Expected behavior
BAR1MemoryInfo shouldn't expose a reserved attribute that can only crash. nvmlBAR1Memory_t has no reserved field, so either BAR1MemoryInfo stops inheriting from MemoryInfo, or it overrides reserved with a clear NotSupportedError/AttributeError. Either way, the shadowed _memory_info slot should go.
Operating System
Linux container (python:3.12-slim) on Windows 11 / WSL2 with the NVIDIA container runtime. The bug is in the Cython class layout, so the OS shouldn't matter.
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
The file 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
-
[BUG]: ProcessInfo.used_gpu_memory returns the NVML_VALUE_NOT_AVAILABLE sentinel as a byte countAbertatriage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
NVIDIA/cuda-python#3468 · 3 comentários ·
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
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