Nsight 5.2/VS2012 C++/CUDA 7.5 Crash
Newbie here, so please be gentle. I am using Nsight 5.2 with CUDA 7.5 and VS2012 C++ on a Win10 64 bit machine with a GTX760. I am trying to write a custom kernel. Using the VS debugger, so far, so good. Everything, including the CUDA code works with no problem. Now, I want to add breakpoints to the CUDA code. In order to do that, I believe I need to use Nsight and select "Start CUDA debugging" (putting a breakpoint in the CUDA code of course). Doing that, work fine for all the native C++ code that runs on the CPU. Once the CUDA code is invoked however, I get an immediate crash that is reported as "unhandled .NET Framework exception" Again, the exact same code runs fine using the VS debugger. What am I doing wrong/how can I get Nsight to work here? Any help appreciated.
Newbie here, so please be gentle.

I am using Nsight 5.2 with CUDA 7.5 and VS2012 C++ on a Win10 64 bit machine with a GTX760.

I am trying to write a custom kernel.

Using the VS debugger, so far, so good. Everything, including the CUDA code works with no problem.

Now, I want to add breakpoints to the CUDA code.

In order to do that, I believe I need to use Nsight and select "Start CUDA debugging" (putting a breakpoint in the CUDA code of course).

Doing that, work fine for all the native C++ code that runs on the CPU.

Once the CUDA code is invoked however, I get an immediate crash that is reported as "unhandled .NET Framework exception"

Again, the exact same code runs fine using the VS debugger.

What am I doing wrong/how can I get Nsight to work here?

Any help appreciated.

#1
Posted 03/17/2017 12:27 AM   
Looks like the nsight is failed to be launched, can you try to launch the "C:\Program Files (x86)\NVIDIA Corporation\Nsight Visual Studio Edition 5.2\Monitor\Common\Nsight.Monitor.exe" manually?
Looks like the nsight is failed to be launched, can you try to launch the "C:\Program Files (x86)\NVIDIA Corporation\Nsight Visual Studio Edition 5.2\Monitor\Common\Nsight.Monitor.exe" manually?

#2
Posted 03/17/2017 03:49 AM   
Because the native C++ code is running when I invoke the NSight CUDA debugger from within VS2012, it would seem that NSight must be running. No?
Because the native C++ code is running when I invoke the NSight CUDA debugger from within VS2012, it would seem that NSight must be running. No?

#3
Posted 03/17/2017 03:56 AM   
Hi, I have no idea what you are talking about, could you please tell me the detailed steps? Best Regards Harry
Hi,

I have no idea what you are talking about, could you please tell me the detailed steps?

Best Regards
Harry

#4
Posted 03/20/2017 02:54 AM   
Sorry for being less than clear. My code base includes a bunch of C++ code using OpenCV. OpenCV itself includes some GPU accelerated function based on CUDA. I can compile all of this just fine. Further, I can run this just fine by selecting "Debug", "Start debugging." I call this "native C++ code." In addition, I have written my own CUDA kernel for some functions that I can invoke by making program selections. I call this "CUDA code." Using the method above, I can run all the code, including the CUDA code, and it all works. Now, I want to put some breakpoints in the CUDA code. If you do that and invoke the VS debugger as above, the breakpoints are ignored but the code still runs fine. In order for the breakpoints in the CUDA code to work, I believe I have to use the NSIght debugger. If I pick "NSight", "Start CUDA debugging" from within VS, the "native C++ code" runs and runs fine. Now, I select a program option that causes my CUDA code to be invoked (i.e., the same code that ran fine using the VS debugger). At this point, the program crashes and I get a message saying "[program] stopped working." So, I am trying to figure out why that happens and get CUDA breakpoints to work.
Sorry for being less than clear.

My code base includes a bunch of C++ code using OpenCV. OpenCV itself includes some GPU accelerated function based on CUDA. I can compile all of this just fine. Further, I can run this just fine by selecting "Debug", "Start debugging." I call this "native C++ code."

In addition, I have written my own CUDA kernel for some functions that I can invoke by making program selections. I call this "CUDA code." Using the method above, I can run all the code, including the CUDA code, and it all works.

Now, I want to put some breakpoints in the CUDA code. If you do that and invoke the VS debugger as above, the breakpoints are ignored but the code still runs fine.

In order for the breakpoints in the CUDA code to work, I believe I have to use the NSIght debugger. If I pick "NSight", "Start CUDA debugging" from within VS, the "native C++ code" runs and runs fine. Now, I select a program option that causes my CUDA code to be invoked (i.e., the same code that ran fine using the VS debugger). At this point, the program crashes and I get a message saying "[program] stopped working."

So, I am trying to figure out why that happens and get CUDA breakpoints to work.

#5
Posted 03/20/2017 04:02 AM   
Oh, I got it, could you try to disable the TDR in nsight monitor? If it doesn't help, could you tell me you computer info like GPU, CPU, memory and send me your compiled app, pdb and cuda kernel source to me, than I can try to repo it on my computer.
Oh, I got it, could you try to disable the TDR in nsight monitor?

If it doesn't help, could you tell me you computer info like GPU, CPU, memory and send me your compiled app, pdb and cuda kernel source to me, than I can try to repo it on my computer.

#6
Posted 03/21/2017 03:08 AM   
TDR is already disabled. As I indicated above, I am using Nsight 5.2 with CUDA 7.5 and VS2012 C++/CLI on a Win10 64 bit machine with a GTX760. The underlying machine has an Intel i7 with 16GB. How would I send you those files? Also, the underlying code is way too big and has too many librury, data file, and hardware dependencies to send and for anyone else to compile/run.
TDR is already disabled.

As I indicated above, I am using Nsight 5.2 with CUDA 7.5 and VS2012 C++/CLI on a Win10 64 bit machine with a GTX760. The underlying machine has an Intel i7 with 16GB.

How would I send you those files? Also, the underlying code is way too big and has too many librury, data file, and hardware dependencies to send and for anyone else to compile/run.

#7
Posted 03/21/2017 03:40 AM   
That sounds bad, I just found that the nsight 5.2 download link points to an old version, could you try the latest nsight in cuda 8.0 package and latest 378.92 driver, you don't need to install the cuda 8.0, just the visual studio integration in it.
That sounds bad, I just found that the nsight 5.2 download link points to an old version, could you try the latest nsight in cuda 8.0 package and latest 378.92 driver, you don't need to install the cuda 8.0, just the visual studio integration in it.

#8
Posted 03/21/2017 05:29 AM   
Naturally, I will do anything. That said, when I look at the NSight "About" dialog, it does say version 5.2.0.16268. Also, I know that the driver is 378.78.
Naturally, I will do anything. That said, when I look at the NSight "About" dialog, it does say version 5.2.0.16268. Also, I know that the driver is 378.78.

#9
Posted 03/21/2017 05:39 AM   
5.2.0.16268 is old version, someone putted a wrong version on the web site, could you please download the cuda 8.0 package and install the nsight in it, the latest version should be 5.2.0.16321
5.2.0.16268 is old version, someone putted a wrong version on the web site, could you please download the cuda 8.0 package and install the nsight in it, the latest version should be 5.2.0.16321

#10
Posted 03/21/2017 06:26 AM   
Ok. Did that. No change in the behavior. One thing is that the CUDA samples seem to work with NSight (i.e., I can set breakpoints which work). That makes me think it is something about how this project is setup.
Ok. Did that. No change in the behavior. One thing is that the CUDA samples seem to work with NSight (i.e., I can set breakpoints which work). That makes me think it is something about how this project is setup.

#11
Posted 03/21/2017 07:03 AM   
maybe we should check the log on your computer. Quit NSight monitor if it’s running Set NVLOG_CONFIG_FILE= Path Of Attached NvLogConfigCustomer.txt Edit the attach NvLogConfigCustomer.txt of the first line, path to NVLOG.txt Relaunch NSight monitor Start debugging to repro the issue Quit debugging Sent us the NVLOG.txt NvLogConfigCustomer.txt is attached.
maybe we should check the log on your computer.

Quit NSight monitor if it’s running
Set NVLOG_CONFIG_FILE= Path Of Attached NvLogConfigCustomer.txt
Edit the attach NvLogConfigCustomer.txt of the first line, path to NVLOG.txt
Relaunch NSight monitor
Start debugging to repro the issue
Quit debugging
Sent us the NVLOG.txt
NvLogConfigCustomer.txt is attached.

#12
Posted 03/21/2017 07:38 AM   
Sorry to be dumb, but do you mean to create an environment variable called "NVLOG_CONGIF_FILE"? There is not one currently.
Sorry to be dumb, but do you mean to create an environment variable called "NVLOG_CONGIF_FILE"?
There is not one currently.

#13
Posted 03/21/2017 03:29 PM   
Yeah, an environment variable called "NVLOG_CONGIF_FILE" which points to the location of your NvLogConfigCustomer.txt, then launch the nsight monitor with this env var.
Yeah, an environment variable called "NVLOG_CONGIF_FILE" which points to the location of your NvLogConfigCustomer.txt, then launch the nsight monitor with this env var.

#14
Posted 03/22/2017 02:34 AM   
Should there already be a file called NVLOG.txt somewhere? I am not finding one.
Should there already be a file called NVLOG.txt somewhere?
I am not finding one.

#15
Posted 03/22/2017 03:11 AM   
Scroll To Top

Add Reply