NVlabs / NVBit

199 stars 18 forks source link

nvbit_get_line_info returning 0 even when code compiled with -lineinfo #70

Open nayakajay opened 2 years ago

nayakajay commented 2 years ago

----Setup---- GPU - 3090 NVBit - 1.5.3, NVCC: 11.2 Compile flag: -arch=compute_86 -std=c++11 -lineinfo

I am trying to run ScoR programs (particularly reduction benchmark) using an nvbit tool. On a high level the tool does the following:

.....
char *file_name, *dir_name;
uint32_t line;
bool avail = nvbit_get_line_info(ctx, f, instr->getOffset(), &file_name, &dir_name, &line);
std::string output;
if(avail)
      output = std::string(file_name) + " - Kernel " + std::string(nvbit_get_func_name(ctx, f)) + ": Line " + std::to_string(line) + "\t" + instr->getSass();
else
      output = std::string(instr->getSass()) + " - Kernel " + std::string(nvbit_get_func_name(ctx, f)) + ": Sass offset " + std::to_string(instr->getOffset());
std::cout << output2 << std::endl;
.....

Most of the time, the else case is getting printed, even when the code is compiled with -lineinfo. When I am compiling some other program, it takes ifpath always. There are also some programs where some instructions took the if path and some else path.

I have tried the same tool with a different NvBit version (1.4), on a different GPU (-arch=compute_75), where, I have not observed else case getting hit. Am I doing something different?

ovilla commented 2 years ago

Thanks for reporting this, we never had this issue but we will double check at the first opportunity (not sure when yet).

yechen3 commented 2 years ago

Same issue here when testing vectorAdd with Unified Memory. I added the code written by @nayakajay above to mem_print tool and compiled with -lineinfo The dir_name gets "nvbit_at_cuda_event" returned and line_number gets a consistent number. But nvbit_get_line_info always returns 0.

x-y-z commented 2 years ago

Same issue here when testing vectorAdd with Unified Memory. I added the code written by @nayakajay above to mem_print tool and compiled with -lineinfo The dir_name gets "nvbit_at_cuda_event" returned and line_number gets a consistent number. But nvbit_get_line_info always returns 0.

You need to add -lineinfo when compile vectorAdd instead of the tools.

x-y-z commented 2 years ago

The original issue is confirmed. But it will take some time to resolve it. Not sure when it will be ready. The fix is unlikely to come in the next release.

nayakajay commented 2 years ago

I tried the latest version (1.5.5) and the issue still persists. Will it be fixed in the next or an upcoming release?