elogy
Posts: 1
Joined: Wed Dec 18, 2019 11:17 am

Methods to measure GPU load?

Thu Dec 26, 2019 7:11 pm

Hi (and a belated merry Christmas) to everyone,

I hope I chose the right subforum for this - if not: @mods please feel free to move it to the approprate location ;)

For my master's thesis, I'm using the Pi 4 as a video encoder to repackage MP4 files into HLS fragments. In some quick experiments, I found out that a Pi 4 with 4GB RAM can handle at least 4 FHD MP4 files at 60 FPS with the software I'm using. Apparently, this is done entirely on the GPU, at least there is no significant rise in CPU load (I just brought up htop to check). However, there doesn't seem to be a way to "measure" how much load such an encoding process actually produces on the GPU.
This brings me to my main question: Is there a way to find out how much load there is on the GPU and/or the encoder? I am aware of vcgencmd, but some human-readable info like what htop does for CPU load doesn't seem to be available for the VC6.

Cheers!
Tim

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Methods to measure GPU load?

Fri Dec 27, 2019 5:22 pm

GPU is too loose a term as the VideoCore multimedia acceleration is split over multiple blocks. See https://www.raspberrypi.org/forums/view ... 3&t=180172

Video encode will use the codec block only (possibly the ISP for format conversion on the input), so the JPEG hardware and 3D are all still idle. Each block will have their own design spec. In the case of the codec block it was originally 1080p30 encode (with content generated by the camera for camcorder use cases).

Now what you've actually written is that you "repackage MP4 files into HLS fragments". You don't provide your FFmpeg (or equivalent) commandline, but that sounds like it isn't re-encoding the video, only changing the container. In which case you're not using the video codec block at all, and the operation will broadly be limited by the throughput of your storage.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Graphics, sound and multimedia”