Is `cupy.cuda.runtime` set to None too early during interpreter shutdown?
See original GitHub issue- Conditions (you can just paste the output of
python -c 'import cupy; cupy.show_config()'
)
$ python -c 'import cupy; cupy.show_config()'
CuPy Version : 7.0.0rc1
CUDA Root : /usr/local/cuda
CUDA Build Version : 10000
CUDA Driver Version : 10000
CUDA Runtime Version : 10000
cuDNN Build Version : 7604
cuDNN Version : 7604
NCCL Build Version : None
NCCL Runtime Version : None
Tested with a fresh build on the latest master in a fresh conda environment.
- Code to reproduce
>>> import cupy as cp
>>> stream = cp.cuda.Stream()
>>> # ...then exit the interpreter
>>>
Exception ignored in: <bound method Stream.__del__ of <cupy.cuda.stream.Stream object at 0x7f75830870b8>>
Traceback (most recent call last):
File "cupy/cuda/stream.pyx", line 186, in cupy.cuda.stream.Stream.__del__
AttributeError: 'NoneType' object has no attribute 'streamDestroy'
I don’t think I’ve seen this error before. Looks like runtime
is set to None
when stream.__del__()
is invoked, but this is unexpected because, according to PEP 442, starting at Python 3.4 the modules unloaded during interpreter shutdown are no longer set to None
, and I’m on Python 3.6.7.
Can this be reproduced? Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
CuPy Documentation - Read the Docs
CuPy is a NumPy/SciPy-compatible array library for GPU-accelerated computing with Python. CuPy acts as a drop-in.
Read more >Performance Best Practices — CuPy 11.4.0 documentation
It is utterly important to first identify the performance bottleneck before making any attempt to optimize your code. To help set up a...
Read more >python - CuPy CUDA - Failed to Import CuPy - Stack Overflow
I have installed the correct version of CuPy with pip install cupy-cuda117 on pyCharms as my CUDA is version 11.7. My Python version...
Read more >NVIDIA Deep Learning TensorRT Documentation
Input and output tensors must be named, so that at runtime, ... to create and configure the CUDA context yourself before the first...
Read more >CUDA Array Interface (Version 2) - Numba
Numba does not currently support working with masked CUDA arrays and will raise a NotImplementedError exception if one is passed to a GPU...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Couldn’t reproduce with python 3.7.3
@emcastillo I confirm that #2809 fixed the error. Thanks!