'How to set up cuda debugging with vscode, nsight code edition, cmake on ubuntu 20.04, nvidia rtx 2080 max q, cuda 11.5

I have tried using both the default build configuration as well as normal cmake with the -G flag.

I then made a cuda-gdb launch configuration.

But I cannot break on breakpoints inside the kernel. It always jumps to the closing bracket of the kernel function.

I do not want to use Makefiles provided in Nvidia cuda samples.

Please help me understand how can I setup a project for debugging using vscode, cmake in Linux Ubuntu 20.04.

I have a rtx2080 max q card, cuda 11.5, driver 470.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source