-
-
Notifications
You must be signed in to change notification settings - Fork 788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
__del__
behavior on interpreter shutdown
#2806
Comments
__del__
behavior on __del__
behavior on interpreter shutdown
Maybe |
I think I tried registering the stream’s destructor with I think I also tried letting each stream instance hold a reference to the runtime module and it failed too. It seems the shutdown procedure doesn’t care about reference counting... |
As pointed out at #2658 (comment), the problem does not seem explained by Python's expected behavior?
|
Maybe is because of Cython? |
Probably not Cython itself (as I tested several older and latest versions and the problem persists), but its bad interplay with Python. I also wondered if this could be a bug in Anaconda/conda-forge’s Python packaging, which I always use in production. Finally, it could just be a coincidence, but both bug reports (#2658, #2777) used CUDA 10.0. |
I use CUDA 10.0 too. |
We just found that if we install python with pyenv, then it breaks just with |
Your pyenv is provided by the Linux distribution (apt-get, etc)? |
Installed manually Conda flags
Pyenv python 3.7.3 flags (python3-config --cflags)
|
When finishing program execution, python does not guarantee the order in which objects are destroyed.
Calls inside a
__del__
method calling other objects or modules are not guaranteed to be correctly executed.https://github.com/cupy/cupy/blob/master/cupy/cuda/stream.pyx#L185
It is known to fail because
runtime
module is already unloaded when__del__
is called.https://docs.python.org/3/reference/datamodel.html#object.__del__
This can affect behavior on RAII pattern.
The text was updated successfully, but these errors were encountered: