Cuda-gdb report error using vscode for debugging under wsl2

I am trying to use cuda-dbg under wsl2, my driver version is 536.40 and cuda version is 12.2, V12.2.91. GPU card is RTX 3060.
when I use cuda-gdb to debug my program, It reports “Error: Failed to read the ELF image (dev=0, handle=93825003156928, relocated=1), error=CUDBG_ERROR_INVALID_ARGS(0x4), error message=.” after excuting the first cuda function,and also after starting new threads.

Log as follows:
1491 CUDA_SAFE_CALL(cudaMalloc((void**)&pmid_data, sizeof(uint32_t) * n_particle * DIM));
[New Thread 0x7fffccebb000 (LWP 3132)]
[Detaching after fork from child process 3133]
[New Thread 0x7fffc1fff000 (LWP 3139)]
Error: Failed to read the ELF image (dev=0, handle=93825003156928, relocated=1), error=CUDBG_ERROR_INVALID_ARGS(0x4), error message=.

Hi @hai_john
Thank you for your report! To help us investigate the issue, could you please collect additional logs:

  • Add NVLOG_CONFIG_FILE variable pointing the nvlog.config file (attached). E.g.: NVLOG_CONFIG_FILE=${HOME}/nvlog.config
  • Run the debugging session.
  • You should see the /tmp/debugger.log file created - could you share it with us?

debugger.log (68.4 KB)
Please check the file

Thank you for the file @hai_john, in the meantime could you report the value of the following regkey: HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\GPUDebugger\EnableInterface ?

sure
Show as below

Im running into the same issue. Can you provide more details or how to resolve it??

Hi, @kmkacpermajor

Sorry for the issue you met.
We recently have CUDA12.5 released
Can you use the latest cuda and driver to have a try ?

Also please make sure the debug capability is enabled via the registry key HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\GPUDebugger\EnableInterface set to (DWORD) 1.