7

I would like to display the completion time of a script, in terms of GPU time (not CPU).

For the CPU, I can simply use time:

francky@gimmek80s:~$ time ls -l
total 8
drwxrwxr-x 3 francky francky 4096 Dec 16 22:19 codes
drwxrwxr-x 2 francky francky 4096 Jun 20 00:06 CUDA_practice
drwxrwxr-x 3 francky francky 4096 Dec 16 22:44 data

real    0m0.001s
user    0m0.000s
sys     0m0.000s

What is the equivalent for GPUs?

(I use the CUDA toolkit to perform some computations on my Nvidia GPUs.)

  • 2
    See also: Measuring running time of CUDA program – don_crissti Dec 17 '15 at 15:38
  • What do you mean by "script"? Do you mean a script that calls a program that runs on the GPU? – nehcsivart Jan 17 '16 at 5:45
  • @tchen yes script or program that uses the GPU. In my case I am currently interested in timing a Python script. – Franck Dernoncourt Jan 17 '16 at 5:47
  • @FranckDernoncourt I'm not sure if this will work, but you can try doing nvprof python $script_name. Typically, timing in CUDA is done within the code itself. – nehcsivart Jan 17 '16 at 5:55
1

GPUs aren't yet "native" to the kernels... actually, they are quite "foreign" to the linux kernels, as they are (especially the CUDA, perhaps less so the OpenCL related stuff) relying on proprietary drivers etc. to make the stuff run inside the GPUs.

So no, don't expect a "simple" time/timex to show those counters, until somebody writes that, but what I've seem thus far based on the coding needed, I don't expect that to be available soon unless you code it into the applications you are calling that does the CUDA/OpenCL stuff for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.