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=.
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 ?
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.