Repository navigation
Description
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
In our project, one of the custom object holds a reference to the cuda.core.experimental.Event and the following occurred during resource cleanup stage, e.,g
[2025-07-31T06:01:25.076Z] Traceback (most recent call last):
[2025-07-31T06:01:25.076Z] File "cuda/core/experimental/_event.pyx", line 114, in cuda.core.experimental._event.Event.close
[2025-07-31T06:01:25.076Z] AttributeError: 'NoneType' object has no attribute 'cuEventDestroy'
[2025-07-31T06:01:25.076Z] Exception ignored in: 'cuda.core.experimental._event.Event.del'
[2025-07-31T06:01:25.076Z] Traceback (most recent call last):
[2025-07-31T06:01:25.076Z] File "cuda/core/experimental/_event.pyx", line 114, in cuda.core.experimental._event.Event.close
[2025-07-31T06:01:25.076Z] AttributeError: 'NoneType' object has no attribute 'cuEventDestroy'
[2025-07-31T06:01:25.076Z] Traceback (most recent call last):
[2025-07-31T06:01:25.076Z] File "cuda/core/experimental/_event.pyx", line 114, in cuda.core.experimental._event.Event.close
[2025-07-31T06:01:25.076Z] AttributeError: 'NoneType' object has no attribute 'cuEventDestroy'
[2025-07-31T06:01:25.076Z] Exception ignored in: 'cuda.core.experimental._event.Event.del'
[2025-07-31T06:01:25.076Z] Traceback (most recent call last):
[2025-07-31T06:01:25.076Z] File "cuda/core/experimental/_event.pyx", line 114, in cuda.core.experimental._event.Event.close
[2025-07-31T06:01:25.076Z] AttributeError: 'NoneType' object has no attribute 'cuEventDestroy'
On our side, we had to explicitly release the reference to the Event object and then the issue was resolved, e.g,
def free(self):
self.event = None # without this, the error occurred in an MPI simulationHow to Reproduce
This is part of an integrated example and we don't have a minimal reproducer.
Expected behavior
del should properly execute to free the Event.
Operating System
No response
nvidia-smi output
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
brandon-b-miller commentedon Sep 15, 2025
I'm able to reproduce this with a
Streamobject with the following code:rwgk commentedon Sep 15, 2025
We have only three
__del__in cuda_core:An easy approach could be to inspect the three
close()implementations, and checkis not Nonefor all variables used.I took a quick look, it seems very straightforward in all three cases.
rwgk commentedon Sep 15, 2025
I forgot to mention: I'm assuming, if the interpreter is shutting down, "complete cleanup" isn't critical.
leofang commentedon Oct 4, 2025
xref: #1063 (comment)