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

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.

Related

Installing CUDA as a non-root user with no GPU

I have a desktop without a GPU, on which I would like to develop code; and a machine on some cluster which has a GPU, and CUDA installed, but where I really can't "touch" anything and on which I won't run an IDE etc. I don't have root on any of the machines, woe is me.
So, essentially, I want to be able to compile and build my CUDA code on my own GPU-less desktop machine, then just copy it and test it on the other machine.
Can this be done despite the two hindering factors: I seem to recall the CUDA installer requiring the presence of a GPU; playing with the kernel; and doing other root-y stuff.
Notes:
I'll be using the standalone installer, not a package.
I'm on Fedora 22 with an x86_64 CPU.
Assuming you want to develop codes that use the CUDA runtime API, you can install the cuda toolkit on a system that does not have a GPU. Using the runfile installer method, simply answer no when prompted to install the driver.
If you want to compile codes (successfully) that use the CUDA driver API, that process will require a libcuda.so on your machine. This file is installed by the driver installer. There are various methods to "force" the driver installer to run on a machine without a GPU. You can get started by extracting the driver runfile installer (or downloading it separately) and passing the --help command line switch to the installer to learn about some of the options.
These methods will not allow you to run those codes on a machine with no GPU of course. Furthermore, the process of moving a compiled binary from one machine to another, and expecting it to run correctly, is troublesome in my opinion. Therefore my suggestion would be to re-compile the code on a target machine. Otherwise getting a compiled binary to run from one machine to the next is a question that is not unique to CUDA, and is outside the scope of my answer.
If you have no intention of running the codes on the non-GPU machine, and are willing to recompile on the target machine, then you can probably develop driver API codes even without libcuda.so (or there is a libcuda.so stub that you could try linking against just for compilation-test purposes, which is installed by the CUDA installer, if you search for it: /usr/local/cuda/lib64/stubs). If you don't link your driver API code against -lcuda, then you'll get a link error of course, but it should not matter, given the previously stated caveats.
Fedora 22 is not officially supported by CUDA 7.5 or prior. YMMV.
If you don't run the driver installer, you don't need to be a root user for any of this. Of course the install locations you pass to the installer must be those that your user privilege allows access to.

CUDA samples cause machine to crash

I was planning on starting to use CUDA on a machine with Kubuntu 12.04 LTS and a Quadro card. I installed CUDA 5.5 using the .deb from here, and the installation seems to have gone fine. Then I built the CUDA samples, again everything went fine.
When I run the samples in sequence, however, some of them botch my display, and others simply crash my computer.
What causes the crash? How can I fix it?
I'll mention that my NVidia card is the only display adapter the machine has, but that shouldn't make CUDA crash and burn.
The problem was due to the X server using the FOSS nouveau drivers. These are known to conflict with NVidia's way of accessing the card. When I restarted X (actually, I restarted the machine), the samples did run and work properly.
Not all the samples are runnable if you just installed CUDA on a clean ubuntu system. Some of them require additional libraries, and some of them require particular CC versions.
You could read the CUDA sample document of those crashed samples for more information.
http://docs.nvidia.com/cuda/cuda-samples/index.html

CUDA on Windows and Linux

I'm trying to set up a cuda development environment under windows, and lurked many cuda-tagged posts, but few things are still unclear:
Can I debug cuda applications under windows without the need of a second video card, using nsight and VS2010 express?
Can I debug cuda applications under linux without the need of a second video card, AND without shut down the graphical interface?
Answered thousands of times, but perhaps something has changed, so I ask again just to be sure: Can I develop under windows without installing a cuda-enabled video card? There is some kind of emeulator? (Ocelot for windows is practically inexistent).
Thanks.
Can I debug cuda applications under windows without the need of a second video card, using nsight and VS2010 express?
You can apparently debug with a single video card, but nsight requires vs2010 professional (not express edition)
https://developer.nvidia.com/nsight-visual-studio-edition-requirements
Can I debug cuda applications under linux without the need of a second video card, AND without shut down the graphical interface?
I don't think so, from the eclipse nsight docs (http://docs.nvidia.com/cuda/nsight-eclipse-edition-getting-started-guide/index.html#linux-requirements):
"A GPU that is running X11 (on Linux) or Aqua (on Mac) cannot be used to debug a CUDA application and will be hidden from the application ran in the debugger. Such GPU can still be used for profiling GPU applications."
Answered thousands of times, but perhaps something has changed, so I ask again just to be sure: Can I develop under windows without installing a cuda-enabled video card? There is some kind of emeulator? (Ocelot for windows is practically inexistent).
no, if you want to use cuda, you'd be best off just getting a cheap cuda-enabled card (e.g. a GTX 650 is ~$100 and is the most recent (kepler) architecture)

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.

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

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)