Bash – How to get the GPU execution time of a script in the shell

bashgpuperformanceprofiling

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.)

Best Answer

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.

Related Question