0

I installed cuda 5 on my Ubuntu 12.10 64 bits. I have a GTX 675M, so I'm using bumblebee to run apps on my cuda device. I'm running nsight through bumblebee (optirun):

frederico@zeus:~$ optirun /usr/local/cuda/libnsight/nsight

And it works just fine, I can compile and execute applications. The problem is when I try to use cuda-gdb in nsight, I got the following error when click on debug button:

No source available for "main() at 0x403c6f" 

But if I try to use cuda-gdb on console it works:

frederico@zeus:~/Dropbox/coisas/projetos/delta_cuda$ optirun cuda-gdb bin/linux/release/gpu_md5 
NVIDIA (R) CUDA Debugger
5.0 release
Portions Copyright (C) 2007-2012 NVIDIA Corporation
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/frederico/Dropbox/coisas/projetos/delta_cuda/bin/linux/release/gpu_md5...done.
(cuda-gdb) run
Starting program: /home/frederico/Dropbox/coisas/projetos/delta_cuda/bin/linux/release/gpu_md5 
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff1dfe700 (LWP 10437)]
[New Thread 0x7ffff07f7700 (LWP 10438)]
[New Thread 0x7fffb07f6700 (LWP 10439)]
[New Thread 0x7fff6bfff700 (LWP 10440)]
[New Thread 0x7fff23fff700 (LWP 10441)]
[New Thread 0x7ffedbfff700 (LWP 10442)]
[New Thread 0x7ffe93fff700 (LWP 10443)]
[New Thread 0x7ffe4bfff700 (LWP 10444)]
[New Thread 0x7ffe03fff700 (LWP 10445)]
[Thread 0x7ffe03fff700 (LWP 10445) exited]
[Thread 0x7fffb07f6700 (LWP 10439) exited]
[Thread 0x7ffe4bfff700 (LWP 10444) exited]
[Thread 0x7fff23fff700 (LWP 10441) exited]
[Thread 0x7ffe93fff700 (LWP 10443) exited]
[Thread 0x7ffedbfff700 (LWP 10442) exited]
[Thread 0x7ffff07f7700 (LWP 10438) exited]
[Thread 0x7fff6bfff700 (LWP 10440) exited]
[Thread 0x7ffff1dfe700 (LWP 10437) exited]

Program exited with code 030.
(cuda-gdb) 

Any idea of what can be going on?

Frederico Schardong
  • 1,946
  • 6
  • 38
  • 62

1 Answers1

1

That message gets printed when your application suspends. It means your application was not compiled with debug information - in this case debugger is not able to map your instructions to the source lines.

To reproduce this message in the command-line cuda-gdb you need to suspend on a breakpoint, e.g. do "break main" before doing "run"

Update - for people who have similar problem sometime in the future

Application was built as follows:

  1. CUDA kernel code was compiled with NVCC and included debug information. E.g. NVCC call was: nvcc -g -G -c mykernel.cu -o mykernel.o
  2. This object file was linked with other object files that were compiled by GCC without generating the debug information - g++ mycpp1.cpp mycpp2.cpp mykernel.cu -o mycudaapplication. This resulted in some partial debug information that was not enough for cuda-gdb to properly resolve the path.

Nsight Eclipse Edition by default is relying on cuda-gdb source path resolution to find a file to open in an editor when debugging CUDA application.

Eugene
  • 9,242
  • 2
  • 30
  • 29
  • I'm passing "-g -G" to nvcc, here is the result of manual cuda-gdb: http://pastebin.com/npfnWGGk – Frederico Schardong Oct 22 '12 at 22:47
  • I just retested - I see that message only when I use "Release" build from Nsight. It does not show this message for "Debug" build... – Eugene Oct 22 '12 at 23:56
  • Note that your command-line debugger does not print your source line (this again hints that your executable does not have debug information. See line 22 on this example - http://pastebin.com/8SgvmXhn – Eugene Oct 23 '12 at 00:00
  • Ok, I take my comment back - looks like you do have debug information in your executable (GDB would print when there's no debug info). What might've happened is if your make moved the executable after the build - so GDB and Nsight can't find the source files any more. I'm investigating right now to find out more information. – Eugene Oct 23 '12 at 00:08
  • I don't know how but you can set up a chat room so I can send you more information quickly – Frederico Schardong Oct 23 '12 at 00:16
  • I created one here - http://chat.stackoverflow.com/rooms/18437/troubleshooting-nsight-eclipse-edition – Eugene Oct 23 '12 at 00:21
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/18438/discussion-between-eugene-and-frederico-schardong) – Eugene Oct 23 '12 at 00:24
  • I tried to add a breakpoint inside a kernel, it works in cuda-gdb (http://pastebin.com/WyPTWQSu) but in nsight it jumps to the last bracket of the kernel and shows no cuda kernel running. – Frederico Schardong Oct 23 '12 at 04:13
  • The breakpoint doesn't work likely simply because the device code is not executed. We have not tested our tools in Bumblebee environment so it is not supported. What you could try is either creating device nodes with the script from our toolkit release notes or create a shell script for starting cuda-gdb with optirun and using that script as debugger executable when setting up your debug configuration. – Eugene Oct 23 '12 at 16:09
  • Shell script failed, with optirun or without it (http://pastebin.com/xUtb3BNu). The error I got on nsight is time out from the debugger. Also, I created a new project from the samples and still getting the same errors when trying to get inside a kernel (http://pastebin.com/Yhb4dacK). Is there a way to debug without optirun? cuda-gdb documentation says that only without X server for who only has one GPU, which means that is impossible to debug on nsight without optirun. – Frederico Schardong Oct 23 '12 at 23:22
  • @FredericoSchardong This discussion becomes too unwieldy for the StackOverflow comments. Please contact us on cudatools@nvidia.com. Note that your shellscript is not passing the arguments to cuda-gdb - you need to add $@ at the end of cuda-gdb invocation. I would appreciate if you accepted my answer as it was true for the original issue so this question went away from the unanswered list. – Eugene Oct 25 '12 at 16:34