Unable to debug CUDA code

Hi,

I am completely unable to debug any CUDA code. Each time I try to “Start CUDA Debugging,” I get the following message: “A CUDA context was created on a GPU that is not currently debuggable. Breakpoints will be disabled.” It does appear to correctly identify my GPU, as it says GeForce GTX 970 at the end of the message. This happens even when I try to run the sample in this tutorial (note that i upgraded the project to use VS 2013 runtime):

http://docs.nvidia.com/nsight-visual-studio-edition/4.7/Nsight_Visual_Studio_Edition_User_Guide.htm#Debugging_CUDA_Application.htm%3FTocPath%3DCUDA%2520Debugger|_____1

I am trying to debug on a single machine with a single NVidia GPU. I am only trying to debug CUDA code.

I am on a desktop computer that is using the following:
Windows 10
Visual Studio 2013 Version 12.0.40629.00 Update 5
NVIDIA Graphics Driver 368.81
NVIDIA CUDA Toolkit 7.5 with Visual Studio Integration
NVIDIA Nsight Visual Studio Edition 4.7.0.15181
GeForce GTX 970

Some things I tried: updating the drivers, ensuring I meet the hardware requirements (according to Nsight 4.7 documentation my GPU is compatible), ensuring I am indeed compiling the debug version of the application.

Nothing I have searched has given me any insight on this problem. Can anyone help?

Thanks!

Hi stevesmith3,

This situation always happens when the Nsight doesn’t match the driver as your driver is pretty new, please try the Nsight 5.1 at https://developer.nvidia.com/nvidia-nsight-visual-studio-edition , please tell me if 5.1 also doesn’t work on your computer.

Best Regards
Harry

Hi Harry,

This seems to have resolved my issue. I mistakenly believed that NSight version 5 was tied to CUDA 8 and I was using the version that came with CUDA 7.5. I didn’t realize that the driver version mattered more for compatibility.

So for anyone else who gets this error:

  • Make sure you are building a configuration that generates debugging info
  • Update your video card drivers to latest version
  • Install latest version of NSight
  • CUDA version seems not to matter
  • Thanks for your help!

    Also, your link has a trailing comma in it that shouldn’t be there, in case anyone thinks it’s an invalid link: https://developer.nvidia.com/nvidia-nsight-visual-studio-edition

    Hello stevesmith3,

    Thank you for your replay, I’ve corrected the link, one more “,” makes the link invalid, Nsight 5 should support both CUDA 7.5 and 8.0, but sometimes it cannot match the driver as the driver is too new, sorry for the inconvience.

    Best Regards
    Harry

    I am having the exact same problem on a fresh CUDA 8.0 install on a newly set up machine with the following parameters:

    • Windows Server 2016
    • Visual Studio Enterprise 2015 Version 14.0.25431.01 Update 3
    • Nvidia Graphics Drivers 376.51 (as installed by CUDA 8.0.61) or 377.35 (latest at the time of writing), TCC mode
    • NVIDIA CUDA Toolkit 8.0.61 with Visual Studio Integration (cuda_8.0.61_win10 local installer)
    • NVIDIA Nsight Visual Studio Edition 5.2.0.16321
    • Tesla P100

    As you see I’ve tried both the driver that comes with the CUDA 8.0.61 download, as well as the latest one.
    It all works fine with CUDA 8.0 on an older Windows 7 machine with a Tesla K20.

    From the Nsight, Visual Studio Edition forum:

    Hmm.