AhmadO
AhmadO

Reputation: 9

Cuda/output of nsight different from the command line (nvcc ) output

I run code using nvcc command and it gave correct output but when I run the same code on the nsight eclipse it gave wrong output. Any one have any idea why is this behavior.


Finally I found there is problem in one of the array allocation.While the command line doesn't make any problem the nsight does.

Upvotes: 0

Views: 590

Answers (1)

Eugene
Eugene

Reputation: 9474

Nsight EE builds the projects by generating make files based on the project settings and by invoking the OS make utility to build the project. It is using nvcc compiler found in the PATH but it relies on some newer options introduced in NVCC compiler 5.0 (that is a part of the same toolkit distribution).

Please do a clean rebuild in Nsight Eclipse - it will print out the command lines used to build your application. Then you can compare that command line with the one you use outside. Possible differences are:

  1. Nsight specifies debug flags and optimization flag when building in debug and release modes.
  2. By default, Nsight sets the new project to build for the hardware detected on your system. NVCC default is SM 1.0.
  3. Make sure the compiler used by Nsight and from the command line are one and the same. It is possible that you have different compilers (e.g. 4.x and 5.0) installed on your system that may generate a slightly different code.

In any case, it is likely your code has some bug that manifests itself under different compilation settings. I would recommend running CUDA memcheck on you program to ensure there is no hidden bugs.

Upvotes: 1

Related Questions