cuda-gdb not working in nsight on linux
Asked Answered
B

3

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.

Behalf answered 20/10, 2012 at 18:9 Comment(0)
B
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.

Behalf answered 21/10, 2012 at 0:16 Comment(2)
You got this message because Nsight tried to run one of the newer cuda-gdb commands that was only introduced in CUDA 5.0.Funereal
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...Embolic
A
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!

Aciniform answered 26/10, 2013 at 8:8 Comment(0)
E
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.

Embolic answered 18/12, 2012 at 9:58 Comment(2)
That will work. However set this to all users, for me, is a bigger problem than explain the situation to the administratorBehalf
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 :)Embolic

© 2022 - 2024 — McMap. All rights reserved.