Use Cuda Profiler solely with linux shell

I’m trying to use cuda profiler on linux. Since I can only ssh to the machine equipped with CUDA, there is no X window support. When I type in the shell I get the following error:

./cudaprof &
[1] 23520
~/cuda_sdk/CudaVisualProfiler/bin$ cudaprof: cannot connect to X server

However, I cannot find any documentation about how to use the profiler solely with the shell. Can anyone help me out?

Thanks!

Check the doc directory of the toolkit install. There are one or two env. var. you have to set to run the profiler (non-visual)

You can probably use some kind of SSH tunnel to run the GUI part of the profiler on your local X11 installation.

However, may I recommend you install the extremely nice remote desktop software NX /Nomachine server on the remote machine and NX into the server?

It’s extremely fast and convenient. IMO it’s actually nicer and faster to NX in and run multiple bash sessions in the remote window, than to text-only SSH in.

http://www.nomachine.com/

Thanks a lot to your hints! I got it! and yes it is as easy as setting CUDA_PROFILE to 1 and run the program as is.

Could you describe in greater detail how you accomplished this? I too need to run the profiler, but my kernel takes longer than the watchdog timer (due to one of my CUDA cards being connected to my monitors) and it errors out.

I get around this by running it in a text terminal (CTRL + ALT + F1), where it runs fine. I’ve tried setting

>> export CUDA_PROFILE=1

>> ./myProgram

>> export CUDA_PROFILE=0

But the file generated was quite small, and I could not open it in the Visual Profiler. I also tried generating a .csv file but this too did not open correctly. It said that there was an invalid argument for one of the columns.

Is there a sample configuration file that I may need to copy from but set it up for my particular run?

I’ve also tried running the profiler on the example programs that come with the SDK but they would error out (I’m assuming due to the need for an ENTER to exit the program).

Thanks :)

Did you solved this problem I am running a fedora 10 system

I am also accessing the system using ssh and there is no X window support i guess

I have tried setting the environment variable for the profiler CUDA_PROFILE=1

and also checked by running

env

command it gives the same error cudaprof : cannot connect to X server

There are two ways to do profiling in CUDA. One way is to run “cudaprof”, the Visual Profiler. This requires X window. You can use X forwarding in ssh, or VNC/NX/Remote Desktop to run cudaprof remotely.

The second way is to set CUDA_PROFILE=1 in the environment variable. This doesn’t require X, but the profiling capability is quite limited. The output file is a text file, and cannot be read by the Visual Profiler. Here is a simple introduction:

http://www.drdobbs.com/architecture-and-design/209601096

Hi,

I have a problem profiling my CUDA program from the command line. I am unable to generate the CUDA_PROFILE_LOG file. However when i profile cuda programs that come with SDK, then it works completely fine.

I guess there’s some problem with my program in CUDA.

Please help!