clbr / radeontop

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

Video encode/decode utilization (enhancement?) #29

Closed Tele42 closed 1 year ago

Tele42 commented 8 years ago

Hi, is it outside the scope of this project to harvest UVD/VCE utilization statistics? Does r600+ hardware expose this kind of information? I've been looking around and have not found a utility that shows this kind of information.

clbr commented 8 years ago

Good question, I don't know, I haven't read UVD docs yet. The earlier docs were released before UVD and VCE were opened.

I have cards with UVD, but none with VCE. Without being able to test, I don't think I could write the VCE code, even if the bits were exposed and documented.

I'll take a look later on, can't promise a date.

clbr commented 8 years ago

I couldn't find docs for either. The code documents suitable registers for both, but not the bits themselves.

I'm not particularly interested in blindly poking them, so perhaps this'll stay open until docs happen, or somebody bugs AMD about the meaning of those registers ;)

Tele42 commented 8 years ago

From a discussion on #dri-devel, I was instructed to look for UVD and VCE in SRBM_STATUS and SRBM_STATUS2. I was able to find some documentation on page 248 of http://support.amd.com/TechDocs/46142.pdf for UVD in particular UVD_BUSY, and I was pointed to http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/amd/include/asic_reg/oss/oss_2_0_sh_mask.h for the layout of SRBM_STATUS2 which includes VCE_BUSY.

It was also suggested that it might be interesting to track SDMA, since it is a separate engine, but that is outside the scope of this issue report.

userofryzen commented 4 years ago

i'm waiting this enchancement too, @clbr are you going to accept the request from @cnamburu ?

clbr commented 4 years ago

The current request has issues. If they're fixed, then sure.

mercuriete commented 4 years ago

There are any way to know if chromium video decoding is actually working? I have everything working but I dont really know what is the real usage of my graphic card.

Having 8 cores I dont really know if there any drop of CPU usage because my CPU is plenty of reaources.

Thanks for this awesome project :+1:

userofryzen commented 4 years ago

View in chrome://media-internals if the codec used is mojovideodecoder o ffmpeg.. if it's the first you are using hardware . Have in mind that with protected videos it's not used.

mercuriete commented 4 years ago

thanks, @userofryzen

I have this on my logs :(

kVideoDecoderName | "FFmpegVideoDecoder"

I need to try to figure out why chromium is not using vaapi :)

thank you very much

mercuriete commented 3 years ago

Sorry for the noise, after updating on gentoo to chromium 87 the gentoo team started to give support for vaapi. using the chrome extension h264ify makes on my computer to see "MojoVideoDecoder" on the media-internal tabs.

kVideoDecoderName | "MojoVideoDecoder"

Anyways, it would be nice that radeontop could read video decoding/encoding statistics from the gpu.

Thank you very much :)

ghost commented 1 year ago

I would also like this feature :+1:

userofryzen commented 1 year ago

Awesome. And is vcn added too?

danielzgtg commented 1 year ago

No. it's not included in my PR. https://github.com/clbr/radeontop/blob/e3bbf06eaed49746f2838a60eb01e7edfc185da5/detect.c#L374

As the UVD and VCN tests are separate files in libdrm, I suspect that they might use something different.

https://github.com/freedesktop/mesa-drm/blob/6d821612d9a4bc4f61d64040a1852a4f139bd28a/tests/amdgpu/uvd_enc_tests.c

https://github.com/freedesktop/mesa-drm/blob/cfbea78fdf85c0ea1bfd3e0038738f998f48b770/tests/amdgpu/vcn_tests.c

Someone needs to find the register for it.