Skip to content

[BUG]: cuda.core Event failed to complete cleanup properly #803

@yangcal

Description

@yangcal

Is this a duplicate?

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 simulation

How 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

Labels

P0High priority - Must do!bugSomething isn't workingcuda.coreEverything related to the cuda.core module

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions