5
votes

I am running my program using nvprof to get profile information using the command:

nvprof -o profileOutput -s ./exe args

I wanted information about warp divergence, coalesced read/write, occupancy etc. But when I open the file profileOutput, its in some other format altogether and have weird symbols like @^@^.....

I am opening the file in vim. What is the correct way to see profile information of a CUDA program. Please help.

2
There is a user's guide for the profiler. Click on nvprof. The normal output file is not human readable, but you can output to excel style CSV if you like. nvvp the visual profiler, is a better option if you have an X session available.Robert Crovella
From the user guide Robert mentioned: For each profiling mode, option --output-profile can be used to generate a result file. This file is not human-readable, but can be imported to nvprof using the option --import-profile, or into the Visual Profiler.Yu Zhou

2 Answers

5
votes

You don't need -s because it is the default situation by itself.

-o specifies the output file which can be imported later or open by Nvidia visual profiler, which is not human readable.

If you need to compute occupancy you can use this occupancy calculator provided by Nvidia. There's an article about it.

If you need to trace branches you can use profiling in trace mode and trace branches.

5
votes

You can open your output file in Nvidia Visual Profiler (usually included in CUDA SDK).

There's also one more possibility to produce human-readable files: you can specify --log-file human-readable-output.log option for nvprof (of course human-readable-output.log is your output file name).
You can enable some other nvprof options for your log output:

  • --print-gpu-trace for GPU trace;
  • --events for collecting events (for example branch, number of launched warps etc.);
  • --metrics for some custom metrics (like shared load transactions, dram utilization etc - full list of metrics you can view by typing nvprof --query-metrics in your command line).

Full list of options you can find in NVIDIA nvprof documentation.