Skip to content

[BUG]: Event timing error misleading #556

Closed
@carterbox

Description

@carterbox

Is this a duplicate?

Type of Bug

Something else

Component

cuda.core

Describe the bug

cuEventElapsedTime() has multiple possibilities for not returning success.

If cuEventRecord() has not been called on either event then CUDA_ERROR_INVALID_HANDLE is returned. If cuEventRecord() has been called on both events but one or both of them has not yet been completed (that is, cuEventQuery() would return CUDA_ERROR_NOT_READY on at least one of the events), CUDA_ERROR_NOT_READY is returned. If either event was created with the CU_EVENT_DISABLE_TIMING flag, then this function will return CUDA_ERROR_INVALID_HANDLE.

However only the last of these explanations is mentioned in the Python error message which replaces these error codes: "Timing capability must be enabled in order to subtract two Events; timing is disabled by default."

The underlying error code should be unsupressed and the user should be directed to the CUDA documentation or we should make the error message more inclusive.

Upstream docs: https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1gdfb1178807353bbcaa9e245da497cf97

How to Reproduce

n/a

Expected behavior

n/a

Operating System

No response

nvidia-smi output

No response

Metadata

Metadata

Assignees

Labels

P1Medium priority - Should dobugSomething isn't workingcuda.coreEverything related to the cuda.core module

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions