1

I have a CentOS 6.0 x64 server with 2 Geforce 480GTX cards equipped and I am using it to debug my cuda programs. Today I tried to use cuda-gdb on my notebook to remote debug my program. So I tried like this:

  1. I opened my bash shell and use ssh to connect to the server, then enter the directory where the program resides.

  2. I start the cuda-gdbserver by typing this: cuda-gdbserver :9999 ./a.out

  3. After that I got this on the bash:

    Process ./a.out created; pid = 4356

    Listening on port 9999

    It seems the cuda-gdbserver works well.

  4. So I opened a new bash shell, and decide to debug the program using cuda-gdb. First I opened the cuda-gdb, now the shell is like this: (cuda-gdb)

  5. Then I tried to connect the remote server: target remote 192.168.2.105:9999

    where 192.168.2.105 is my server's ip address

  6. But, however, to my disappointment, I got error information from shell, which says: 192.168.2.105:9999: No route to host.

What's wrong? I googled for some time, someone told me that I should stop the iptables service on the server, so I did as they said(service iptables stop), but it still doesn't work. By the way, I have also tried the target extended-remote command in cuda-gdb, no good.

In addition, both the server and my notebook(running ubuntu 12.10 x64) installed the same subversion of cuda toolkit 5.5, and I can debug locally on my server well.

So, is there anybody know what I need to do? It really puzzled me for a long time(Actually I encountered this problem long long ago). I'd like to thank anybody answering my question in advance!

Xiangyu.Guo
  • 151
  • 1
  • 8

2 Answers2

1

Can you ping/ssh the remote host?

In our testing, we noticed that the CentOS and Fedora have a firewall enabled by default. Please consult your OS documentation on how to open the ports.

Eugene
  • 9,242
  • 2
  • 30
  • 29
  • You mean the iptables, right? I have already stopped it, and I think the firewall is not running when I was doing the testing. The remote host is accessible, yes, as I described above, I used the ssh to login to the remote host first, then closed the fireware and start the cuda-gdbserver process. The ping command is also tested and it had received data from the remote host. I'll try your suggestion, yet I'am not expecting it works for me, can you find some other reason why this problem comes up? Anyway, thanks for your help! – Xiangyu.Guo Sep 18 '13 at 23:23
  • I am not sure if it is firewall - I don't remember the exact error message (I see "Operation timed out" if I try to connect to non-existing debug server). The "No root to host" error most often means typo in IP address or some network issues... – Eugene Sep 18 '13 at 23:35
  • 1
    To justify my guess, I typed this command on the terminal: **netstat -tulpn | less**, and I found this line on the console: **tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 7146/cuda-gdbserver**, So it makes me think the port was already open(right?). I was really puzzled~ – Xiangyu.Guo Sep 18 '13 at 23:36
  • Agreed~ But why I can ssh or ping to my remote host but I can't target remote it? I googled and searched in stackoverflow, it seems no one else has encountered this problem. Is there a posibility that the error is from my ubuntu in stead of the remote host? But my ubuntu has no iptables installed, how coud it happen? – Xiangyu.Guo Sep 18 '13 at 23:47
0

It could be that cuda-gdbserver only listens on the loopback interface by default.

Try cuda-gdbserver 0.0.0.0:9999 ./a.out

Roger Dahl
  • 15,132
  • 8
  • 62
  • 82
  • I have tried this method, however, the problem still exists: No route to host – Xiangyu.Guo Sep 18 '13 at 15:44
  • And I suppose this is also the root reason why I can't use remote debugging in Nsight Eclipse edition~ Very upset, please help me!~ – Xiangyu.Guo Sep 18 '13 at 15:47
  • Did you try this at the same time as you had the firewall turned off? – Roger Dahl Sep 18 '13 at 16:25
  • Yes, Roger, When the first time I sshed on the remote host, I stopped the iptables service, It was not running when I was testing your suggestion, may there be some other things on centos that do analogous things just like iptables? I am not familiar with linux system management. Can you find some other causes? Thanks~ – Xiangyu.Guo Sep 18 '13 at 23:29