clbr / radeontop

GNU General Public License v3.0
804 stars 70 forks source link

Radeontop dumping data very slowly #62

Closed grische closed 6 years ago

grische commented 6 years ago

When running radeontop with radeontop -l 1 -d - to print statistics, it takes about 2 seconds before it returns something.

Running this for all GPUs serially, it takes 2s * #GPUs, which is a very long time for gather performance information.

Is there any way to speed this up?

$ time radeontop -d - -l 1
Dumping to -, line limit 1.
1529693401.317127: gpu 0.00%, ee 0.00%, vgt 0.00%, ta 0.00%, sx 0.00%, sh 0.00%, spi 0.00%, sc 0.00%, pa 0.00%, db 0.00%, cb 0.00%, vram 0.04% 2.06mb, gtt 0.04% 2.56mb

real    0m2.052s
user    0m0.000s
sys     0m0.010s
clbr commented 6 years ago

The first second is due to the collecting, which can't be avoided; it was a design decision to have more stable and usable values, as a direct data point may have massive jumps. The second second could be removed, just pushed a commit doing so.

If you need fast, continuous values, you could run radeontop in the background (one for each gpu), and pipe the lines to a script like https://github.com/clbr/radeontop/issues/21#issuecomment-112720413 . But instead of echoing to the screen, the script would echo to some file, /tmp/gpu0-state or similar.

grische commented 6 years ago

Thanks, reducing the time by 50% is already a lot! That probably fixes the issue here.

I know how to workaround dumping data of all GPUs in parallel processes and writing the output to temp files. Maybe one day radeontop can also print information for all buses for easier monitoring.