CUDA Debugging - VS on windows workstation, GPUs on Linux server? - cuda

Has anyone had any experience debugging CUDA code on a server while coding on a workstation?
My laptop (Thinkpad T400) doesn't support CUDA, but I have access to a server with pair of NVIDIA GTX 295 cards that runs Linux.
Can I use NVidia's Visual Studio tools to debug remotely on the server?
Failing that, I also have an Ubuntu VM running on my laptop. Is there a debugger that I can use under Linux to debug on the server?
I really don't want to have to buy another laptop with dual NVidia cards.

Developing in c on a remote linux machine (like your server) is quite common. You can ssh onto the server from any client (like your laptop) to compile and run the code just as you would if you were sitting at the machine, and you can use gdb to debug your code in a terminal. You can also use ddd as a graphical front end to gdb or a linux IDE such as eclipse by forwarding X11 over ssh.
You can use cuda-gdb to debug your CUDA code in a terminal in exactly the same way. Unfortunately, there is not a visual cuda debugger for linux yet. However, it appears you can use ddd with cuda-gdb [source], as you have two gpus. I'm not sure about using cuda-gdb in eclipse.

Yes you can but you need to buy the Parallel Nsight Studio from Nvidia
After installing on the remote machine the NsightDebugServer you can upload and debug programs from
your cuda-less laptop.
Update
Turns out This solution requires a WINDOWS server in order to run the NsightDebugServer.
To connect to the linux machine from your laptop, use a remote connection.
install putty and a Xserver for windows and just login with
ssh -X username#cudaserver.
The environment would not be fancy as Visual Studio but you can do the basic steps of debugging.
Eclipse "might" have some support for remote gdb servers. Never experimented that (Emacs + gdb is sufficient for me)

Related

Can I connect NVIDIA Nsight to a remote machine?

I don't have a graphics card which supports CUDA on my computer. Can I connect NVIDIA Nsight to a remote machine using ssh (or anything else)?
Yes, you can use Nsight Visual Studio Edition's remote debugging feature
Yes, you can use Nsight Eclipse Edition's remote debugging feature

Developing using CUDA on several computers, when only one has a GPU installed

I am a Java developer. To speed some of our algorithms, we have decided to try CUDA.
But the Issue is, currently we have only one server with GPU installed and 3 developers have to work on it (by transferring the file each time over ssh and compiling and running it over there). This obviously is a tedious process.
What I would like to know is: On my machine which does not have GPU, can I using NSight work on CUDA by compiling and generating files locally. This can automatically be transferred to server to get the result.
If we can at least work on algorithm locally using NSight (or any other IDE) and not pure vim and then compile it to remove compile time errors, this would save quite some time.
On Linux you can do remote debugging using Nsight Eclipse Edition as documented here. This requires 5.5 or later. On Windows you need to start the Nsight monitor on the server and then just configure Nsight Visual Studio Edition to use the remote machine.

How to do remote debugging with Nsight 5.5 on Linux?

Disclaimer: I know that this question has been asked numerous times, but before Nsight 5.5 the answer simply was "You can't."
I'm trying to debug a CUDA program with Nsight 5.5 on Ubuntu. The remote machine is also an Ubuntu with CUDA Toolkit 5.5.
I setup debugging in NSight using the "Debug an application on a remote system".
Whenever I try to run the application I get a "Could not start gdbserver on the remote host" error.
This is what I get on the console:
Last login: Thu Aug 1 16:09:26 2013 from host.whatever.edu
echo $PWD'>'
:2345 /tmp/nsight-debug/flow;exit
someuser#remotehost:~$ echo $PWD'>'
/home/someuser>
someuser#remotehost:~$ :2345 /tmp/nsight-debug/flow;exit
:2345: command not found
logout
Both gdbserver and cuda-gdbserver are installed on both machines.
If I ssh to the remote host, I can run /tmp/nsight-debug/flow manually.
What might be the problem here? Is there anything missing from the setup?
This looks like a bug in Nsight, we will take a look into this matter.
Please make sure that you have remote toolkit configured for your connection.
From the main menu, select Run -> Debug Configurations...
In the left-hand tree, select you debug configuration under C/C++ Remote Application
Make sure that Remote toolkit combo has proper toolkit selected. If you don't have any toolkit configured, click Manage... and setup the toolkit.
Usually you will only have to setup the toolkit once per your connection - e.g. you will not have to setup it if you want to debug another application on the same remote system.

NVIDIA Nsight Debugging on GTX 480

I have one machine with GeForce GTX 480 but I can't debug or run analysis activity on it.
This error appears when I debug or run analysis activity:
The remote system is logged in through Remote Desktop. CUDA debugging
does not support Remote Desktop unless a TCC adapter is installed.
My Nsight version is 2.2. Whats wrong?
You would need a TCC capable card (Quadro or Tesla series) if you want to use the GPU from inside a RPD session.
When you do not have a TCC capable GPU, you can for example install VNC Server as a service and use that to access the machine.
Alternatively you can configure windows autologin to log you in automatically and have have the Nsight Monitor in the startup group (but to access the desktop remotely you would still need some kind of remote access software like VNC).
after some test and try ,I found that this problem is because of RDC and if you connect to the target machine from one computer with remote desktop connection even if you disconnect all remote desktop and try to debug with Nsight remotely or locally you get this error .
I were connected to the target machine with remote desktop and configure and run Nsight monitor and then close the RDC . and then I tried to debug the project remotely from host on the target and because of it I get this error
I found that one solution will be restart the target machine and configure the Monitor physically at front of the target machine and then DO NOT remote to the target from anywhere, now I can debug my project from host machine on the target machine .

Parallel NSight for Visual studio 2010 supports to debug on the server?

I have installed Parallel Nsight for Visual Studio 2010. Due to my research, it is not able to debugging on machines which dont have NVIDIA graphic card.
Therefore, I would like to debug it on the server (connecting to the server), would it be possible?
Thanks in advance.
Yes. You can install Visual Studio and Parallel Nsight on your developer machine, and install Parallel Nsight on the remote machine with the GPU. Then you simply configure Parallel Nsight to execute on the remote machine.
Behind the scenes, when you "start CUDA debugging", Nsight will copy the executable (and any specified data files) to the remote machine and launch the task.
See the Parallel Nsight website for more details and to check system requirements, as well as the documentation that is installed.