[BUG]: system.Device.bar1_memory_info.reserved raises AttributeError on None
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 62/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Cython
- Stelle
- 3.4k
- Fork
- 353
- Merge medio
- 2g 3h
- PR unite (30g)
- 163
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/cuda-python
-
[BUG]: the `__cuda_stream__` deprecation warning points to `Stream(obj)`, which always raisesForse già presa @Iamsohungrynow l’ha presa 5 giorni fa. Apertabug cuda.core P1
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
NVIDIA/cuda-python#3505 · 3 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: ProcessInfo.used_gpu_memory returns the NVML_VALUE_NOT_AVAILABLE sentinel as a byte countApertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
NVIDIA/cuda-python#3468 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NVIDIA/cuda-python#3409 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRsForse di nuovo libera @rwgk l’ha presa 48 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
NVIDIA/cuda-python#2952 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookupForse già presa @rwgk l’ha presa 62 giorni fa. Apertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA/cuda-python#2646 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NVIDIA/cuda-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
aws-documentation-mcp-server: empty spanning headers shift table column labelsForse già presa @pradeep-ramola l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opensearch-project/sql#5990 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
GustavoBaranda/chatflow-agent#238 ·
I maintainer di solito rispondono entro 1 giorno