1

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.

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

3 Answers3

3

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.

Frederico Schardong
  • 1,946
  • 6
  • 38
  • 62
  • You got this message because Nsight tried to run one of the newer cuda-gdb commands that was only introduced in CUDA 5.0. – Eugene Oct 22 '12 at 17:19
  • Your solution works but is difficult to set up on a multi-user system where you're not administrator. Most of the times, sysadmins will be reluctant to add links to `/opt` in `/usr/bin`... – jopasserat Dec 18 '12 at 10:00
2

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!

trueno
  • 21
  • 1
1

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.

jopasserat
  • 5,721
  • 4
  • 31
  • 50
  • That will work. However set this to all users, for me, is a bigger problem than explain the situation to the administrator – Frederico Schardong Dec 23 '12 at 05:44
  • Again I don't agree. Because if every user uses cuda-gdb-5.0, then it should be installed in a default location, or the user `PATH` should be updated accordingly to the location. Still, enjoy `cuda-gdb` :) – jopasserat Dec 24 '12 at 10:51