Hi,
I’m developing a CUDA application on Windows 11 using WSL2 with Ubuntu 22.04, and debugging with VS Code.
My current setup allows me to:
- Successfully run CUDA programs (
nvccandcuda-gdbare working), - Launch and attach the debugger from VS Code,
- Set breakpoints in both host code and device (kernel) code.
However, although breakpoints can be set in the kernel code, when I try to step into a kernel function (e.g., at a cudaMalloc or kernel launch like myKernel<<<>>>), the debugger immediately skips over the kernel and does not enter or step through the device code. It just resumes execution on the host side.
I have already:
- Verified that
/usr/local/cuda-12.6is installed correctly in WSL2, - Added
cuda-gdbto my environment path, - Enabled the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\GPUDebugger\EnableInterfacewith DWORD1on the Windows side, - Ensured the GPU is visible to WSL2 with
nvidia-smi.
Still, stepping into the kernel doesn’t work.
How can I get CUDA-GDB (via VSCode or otherwise) to properly debug inside kernel code?
Thanks in advance!
