cudaGraphAddKernelNode() fails cuModuleGetFunction() function

Hello.

I’m trying to build a graph using kernels compiled with NVRTC.
Kernel functions are loaded using cuModuleGetFunction() and represented as CUfunction.
During graph build I pass CUfunction object as cudaKernelNodeParams::func argument.
But cudaGraphAddKernelNode() call fails with “invalid device function” error.

What is correct way to use module api with cuda graphs api?

UPD cuGraphAddKernelNode() works :-[ ]

see cuLibraryGetKernel

cudaKernel_t is the type that is interchangeable with runtime device entry functions.