-1

I am profiling a CUDA application and dumping the logs to a file say target.prof

My application uses multiple threads to dispatch kernels and I want to observe the api calls from just one of those threads. I tried using nvprof -i target.prof --print-api-trace but this does not print the thread_id.

When I open this file with the visual profiler, I can see which API calls were launched from which thread. How can I access the same information using the command line profiler?

Edit: View in the visual profiler

Visual Profiler showing multiple threads

Tapan Chugh
  • 354
  • 2
  • 4

1 Answers1

-2

Are GPU threads launching those kernels or CPU threads? if cpu threads then use the option --cpu-thread-tracing on.

Pradeep Kumar
  • 143
  • 12
  • CPU threads. I tried using `nvprof -i target.prof --cpu-thread-tracing on --print-api-trace` This still does not show output the thread information. I also tried using this option while recording the logs and that still does not work. – Tapan Chugh Sep 12 '18 at 06:39
  • I tried `nvprof --cpu-profiling on --cpu-profiling-thread-mode separated ./a.out`. I am getting the cpu threadIDs. I used `std::async` to launch the kernels – Pradeep Kumar Sep 12 '18 at 08:27
  • I tried profiling my application with these options and it just seems to hang. I have also attached a screenshot of the visual profiler screen. It shows api calls from 2 threads. However, when I just use `nvprof --print-api-trace` it only shows me 3 colums - time, duration and the call name – Tapan Chugh Sep 12 '18 at 08:43
  • Have you tried this command `nvprof --cpu-profiling on --cpu-profiling-thread-mode separated ./a.out` – Pradeep Kumar Sep 12 '18 at 08:48
  • Yes, when I run my program with that, it hangs – Tapan Chugh Sep 12 '18 at 10:19
  • Try this one `nvprof --cpu-profiling on --cpu-profiling-thread-mode separated --cpu-profiling-scope function -i target.prof`. – Pradeep Kumar Sep 12 '18 at 10:26
  • This again prints the same results as before – Tapan Chugh Sep 12 '18 at 10:49
  • could you show me the output dump. to be clear are you looking for cpu thread Ids? – Pradeep Kumar Sep 12 '18 at 11:14