cuda-gdb not working in nsight on linux

2.5k views Asked by At

I installed cuda 5 in my Ubuntu 12.10 and it is working well, I can compile and debug through cuda-gdb in terminal as well. I'm trying to use nsight, it compiles and executes my code with no issues, but when I try to debug I got the following error

Error in final launch sequence
Failed to execute MI command:
-gdb-set cuda api_failures ignore
Error message from debugger back end:
Undefined set cuda command: "api_failures ignore".  Try "help set cuda".
Undefined set cuda command: "api_failures ignore".  Try "help set cuda".

I'm using ubuntu 12.10 64 bits and launching cuda executables and nsight with optirun (bumblebee) because I have a GTX 675M (optimus). I installed cuda-gdb throught apt-get, I got version 4.2:

frederico@zeus:~/Dropbox/coisas/projetos/delta_cuda$ cuda-gdb --version
NVIDIA (R) CUDA Debugger
4.2 release
Portions Copyright (C) 2007-2012 NVIDIA Corporation
GNU gdb (GDB) 7.2

I think this is not a problem since I can use it alone (without nsight). I changed nsight to launch cuda-gdb with optirun as well, keep receiving the same error.

3

There are 3 answers

2
Frederico Schardong On BEST ANSWER

The problem was the version of cuda-gdb, I had to use cuda-gdb version 5. It comes with the toolkit version 5, just did a symbolic lick to /usr/bin and it's working.

0
trueno On

It is possible to debug CUDA programs with nsight and bumblebee. (nsight v.5.0.0, bumblebee 3.2.1, Debian sid)

You just have to replace the debugger command line (CUDA GDB Executable) in: Project Explorer -> right click on your project -> select "Debug as" -> click on "Debug configurations..." -> select "Debugger" tab

CUDA GDB Executable: optirun --no-xorg cuda-gdb (another possibility is to make a small shell script like the one that follows: /usr/bin/opti-cuda-gdb)

#!/bin/bash
optirun --no-xorg /usr/bin/cuda-gdb $*

This way optirun does not start a virtual screen for gdb, the GPU is not accepting graphics and debug is possible.

Hope that helps!

2
jopasserat On

There's no need to create this link.

You can select the cuda-gdb executable used by nsight in the Run/Debug Configurations... Menu. In this menu, click on your application under C/C++ Application, then choose the Debugger tab where you can browse your filesystem and set the path to the cuda-gdb-5.0 executable.