Profiling application with CUPTI in a separate process?

Like to know if it is possible to profile an application with CUPTI in a separate process?
Say, the source code of the application to be profiled is not available, can we still use CUPTI to collect the events, metrics of it?

If yes, is there any restriction on that?
And how nvprof itself deal with this challenge?

Thanks,
talksmall

nvprof has various options to capture events and metrics from another process

Take a look at the command line help for nvprof or else read the documentation:

http://docs.nvidia.com/cuda/profiler-users-guide/index.html#multiprocess-profiling

one option is to use --profile-child-processes

for completely independent process activity you can run nvprof in the background, the “profile all processes” mode

Thanks for the answer, what about CUPTI? Does it collect events/metrics from all processes by default?
From the CUPTI sample code, the profiling and kernel launching are in the same host process. Can they run in separate processes?