taskflow / taskflow

A General-purpose Parallel and Heterogeneous Task Programming System

Home Page:https://taskflow.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[cuda toolkit v.12.3] Cuda Capturer causes "InvalidResourceHandle" due to "cudaEventDestroy" called on NULL

doocman opened this issue · comments

Describe the bug
When using cudaCapturer, the events created during this stage is sometimes moved-from, causing the native handle to become null. This is then passed to "cudaEventDestroy", which triggers an "InvalidResourceHandle". A simple "if(event==nullptr)" in cudaEventDeleter.

To Reproduce
Steps to reproduce the behavior:

  1. Create a c++ project.
  2. Capture an arbitrary kernel.
  3. Call "cudaGetLastError()": this returns "CudaInvalidResourceHandle" for me. Using "compute-sanitizer" does lead me to the cudaEventDestroy-call. Making the aforementioned quickfix solves the issue for me.

Desktop (please complete the following information):

  • OS: Alma Linux 9
  • Version 3.6

@doocman Thank you for the issue! I have merged your pull request.