Debug Information not available at current location when using NSIGHT VS Next-Gen Debugger

Hello there!

When setting a conditional breakpoint on a device (gpu) kernel and using the Extensions->Nsight-> Start CUDA Debugging (Next-Gen) in Visual Studio 2022 on Windows 10, I get an error saying: Debug Information not available at current location ‘i==1’.

Specifically, I tried setting the conditional breakpoint to break on a specific iteration of a kernel for loop. However, then I tried to also set a breakpoint (condition: @blockIdx(0,1,0)) as referenced in the developer manual (here), which resulted in the same error.

I am using CUDA 12.1 with a Driver Version 531.14 and Nsight Visual Studio Edition 2023.1.0 (compatible with driver version 531.05 or later).

For simplicity, I tried to create a hello-world style CUDA kernel an apply conditional breakpoints, which all failed with the same error. Code:

__global__ void cuda_hello(){
    printf("Hello World from GPU!\n");
    for (int i = 0; i < 5; i++) {
        // set conditional breakpoint in the above line, condition: i == 1
    }
}

int main() {
    cuda_hello<<<1,1>>>(); 
    return 0;
}

You need to compile with “Generate GPU Debug information” = “Yes (-G)
See Build and Run :: NVIDIA Nsight VSE Documentation, under the ‘Device’ heading. The nvcc -G option generates GPU debug and line information for your debugging sessions. Be sure to compile without the -G (and --lineinfo) in your release/production builds to get the best optimization and performance.

Let us know if you’re already doing this.
Hope that helps!

Thank you! After reinstalling CUDA and Nvidia Nsight Visual Studio, this problem no longer persisted, I noted that the option Generate GPU Debug information came enabled (Yes (-G)) immediatelly upon installation.

However, this spawned an another, albeit less pleasant error: Nsight version 2023.1 for Visual Studio 2022 hits breakpoints incorrectly

Thank you for the help!

the code is compiled with debugging information, you can check the project properties in Visual Studio. Under “Configuration Properties” → “CUDA C/C++” → “Debugging”, make sure that the “Generate GPU Debug Information” option is set to “Yes (-g)”.

Another thing to check is that the Nsight debugger is able to find the debug information for your code. Make sure that the “Nsight->Options->CUDA->Generate Debug Information” option is set to “Yes” and that the “Nsight->Options->CUDA->Debug Information Search Path” option points to the correct directory where the debug information files are located.