4
votes

How do I programmatically launch a CUDA command line app under the CUDA profiler and access the generated profiling information stored as .csv files by the profiler?

Background:

I'm writing a program that automates performance comparisons between CPU and GPU versions of equivalent codes. The program takes the paths to two executable files as arguments, one for the CPU and one for the GPU. The program then profiles the GPU version by running it under the CUDA command line profiler and analyses the results.

I'm using Windows 7.

I would like to launch the profiler by using the system() or ShellExecute() call.

I have to tried to run it like this: system("nvvp + filepath")

I have read the Compute Command Line Profiler User guide, but have not found the required information there.

1
i just want to get some data on how efficient is application written under GPU compared to CPU. Any tips are welcome. - Emil Smęt
I won't post this as an answer, but... For expert users (which I don't think the OP is), the CUDA Profiling Tools Interface (CUPTI) library can be used to build advanced profiling behavior into applications. See the CUPTI User's guide included with the CUDA Toolkit. - harrism

1 Answers

1
votes

Welcome to Stack Overflow.

To sum up the comments, the answer is basically that you shouldn't launch the profiler programmatically. You would end up with invalid comparison results and the profiler does not provide metrics such as memory usage.

Instead, keep track of memory usage within the applications, launch them with regular system calls and time them with Windows timers.