question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
emcastillocommented, Nov 20, 2019

Couldn’t reproduce with python 3.7.3

0reactions
leofangcommented, Dec 13, 2019

@emcastillo I confirm that #2809 fixed the error. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found