Nsight skips (ignores) fault points in VS10. Cuda works fine, nsight sequentially skips multiple breakpoints

I am using nsight 2.2, Toolkit 4.2, the latest nvidia driver, I am using a couple of gpu on my computer. Build the setting 4.2. I set "generate GPU output" in the properties of the CUDA project, the nsight monitor is on (everything looks great).

I set some breakpoints for my global kernel function. nsight stops when declaring a function, but skips multiple breakpoints. it just like nsight decides to hit the breakpoint or skip the breakpoint. The funny thing is that nsight stops on loops, but does not stop at simple assignment operations.

Another problem is that I cannot set focus or add variables to the watchlist. In this case (see the attached screenshot) I cannot resolve the value of the variable: "posss" or "testDetctoinRate1" which are registers in this case. on the other hand, the memory of the shared memory or block is automatically inserted into the local list.

Here is a screenshot of the kernel before debugging

Here is a screenshot during debugging

I call my kernel function with the following call:

checkCUDA<<<1, 32>>>(sumMat->rows,sumMat->cols , (UINT *)pGPUsumMat); cudaError = cudaGetLastError(); if(cudaError != cudaSuccess) { printf("CUDA error: %s\n", cudaGetErrorString(cudaError)); exit(-1); } 

kernel call works without errors.

Is there any option to force nsight to stop at all breakpoints? How to add thread registers to watchlist?

Any help would be appreciated. I can send my code upon request.

Greetings


Initially, my debug command line:

Runtime API (NVCC compilation type is a hybrid object or .c file)

install CUDAFE_FLAGS = - sdk_dir "c: \ Program Files \ Microsoft SDK \ Windows \ v7.0A \" "C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v4.2 \ bin \ nvcc.exe" --use- local-env -cl-version 2010 -ccbin "C: \ Program Files \ Microsoft Visual Studio 10.0 \ VC \ bin" -I "... \ opencv \ modules \ gpu \ src \ opencv2 \ gpu \ device" -I " ... \ opencv \ modules \ gpu \ include \ opencv2 \ gpu "-I" ... \ build \ include \ "-G -keep-dir" Debug "-maxrregcount = 0 --machine 32 --compile -g -Xcompiler "/ EHsc / nologo / Od / Zi / MDd" -o "Debug \% (file name)% (extension) .obj" "% (FullPath)"


I changed on the properties page -> cuda -> host -> generates debug hosting information -> No

Now my command line does not contain the letters -g and -O, my command line is as follows:

Runtime API (NVCC compilation type is a hybrid object or .c file)

install CUDAFE_FLAGS = - sdk_dir "c: \ Program Files \ Microsoft SDK \ Windows \ v7.0A \" "C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v4.2 \ bin \ nvcc.exe" --use- local-env -cl-version 2010 -ccbin "C: \ Program Files \ Microsoft Visual Studio 10.0 \ VC \ bin" -I "... \ opencv \ modules \ gpu \ src \ opencv2 \ gpu \ device" -I " ... \ opencv \ modules \ gpu \ include \ opencv2 \ gpu "-I" ... \ build \ include \ "-G --keep-dir" Debug "-maxrregcount = 0 --machine 32 --compile - Xcompiler "/ EHsc / nologo / Od / Zi / MDd" -o "Debug \% (Filename)% (Extension) .obj" "% (FullPath)"

although I am debugging with -o, does it matter? He does not make any changes

+4
source share
4 answers

Right-click the .cu file in Solution Explorer, then go to CUDA C/C++ | Device CUDA C/C++ | Device and set the Generate GPU Debug Information to Yes (-G0) .

+4
source

Check if the option β€œEnable CUDA memory check” is disabled under Nsight. This may allow NSight to stop the breakpoints of your CUDA kernel code in VS C ++ 2010 debugging mode. At least it works for me.

+2
source

In the debug build, do you pass the -O and -g options to nvcc? If so, try removing -O.

Background: this seems like a problem when trying to debug code optimized by the compiler. During optimization, the compiler changes the code so that some source lines no longer have any machine code commands associated with them, which makes it impossible for the debugger to set breakpoints on these lines.

0
source

I have the same problem. Nsight does not stop at any of the breakpoints. But completes the execution.

If I use -G0 as an option for debugging information. This gives an error.

I am using nvidia 2.2.0.1225 with the cuda 4.2 and cuda 5 toolkit. With the graphics driver 301.42.

0
source

Source: https://habr.com/ru/post/1415291/


All Articles