Comment by Havoc

1 day ago

Interesting - will see if I can toy with it.

Word of caution though. I’ve found that on my machine (Linux/nvidia) unaccelerated video is way more power efficient. The second video is playing it kept the GPU in a high power state and that uses incrementally more power than the cpu doing software decoding

I had always assumed gpu would obviously be more efficient until I measured it

Are you using nvidia-vaapi-driver? If so, you'll need to set `CUDA_DISABLE_PERF_BOOST` in your environment.

  • Oh that’s interesting. I shall investigate thanks.

    edit: very quick test with MPV seems to confirm this works - eliminates the gnarly additional GPU draw. Measuring draw at wall now puts CPU and GPU route on equal footing...both basically the machines idle draw. Tested both 264 and 265...same outcome. 3090.

    Thanks!

    • Bonus discovery I just learned. Under nvtop -> F2 -> Processes -> Fields -> there you can make it show encode/decode. It's disabled by default

    • If you really want to power optimize, there's a special dmabuf-wayland backend that hands off compositing to Wayland. You lose some post-processing but your power use can drop from 12-15w to 2-5w. This is also how the newer Linux video players attain really low power draws.

Interesting.

through, from a pure power POV you probably would want to exclusively use the integrated graphics most CPUs have (1) with the external GPU powered down for most "daily/office-style" usage (browser, news, email, coding (not gamedev,etc.)) and only switch to external GPUs for Gaming, GPGPU, and I guess some edge cases like too many monitors or insisting on running a coding IDE at >240Hz ;)

EDIT, forgot the food note (1): Even the very very minimal GPU recent (non APU) AMD processors have are good enough for many peoples daily "office" needs.

  • No iGPU on my CPU (5800x3d). So was straight software decode (well maybe AVX2?) against GPU decode. GPU route was 80W more.

    joebonrichie's comment was excellent though - there is a new nvidia tweak that eliminates the GPU going to a high power state the second it sniffs video. So now GPU & CPU get me the same draw.

    >enough for many peoples daily "office" needs

    Yeah been considering using my mac air for when not gaming / messing with LLMs, but frankly struggling with it on UX.

i am bit confused, what does it mean by vulkan video decoding? does it mean that it will be done via gpu or via hardware accelerator sepcific to decoder via some vulkan extension? if it is via extension gpu would be free to do gpu specific things?

  • It's a Vulkan extension to use dedicated video decoders like QuickSync, NVDEC and VCN. It's not using shaders.

All modern CPUs come with an iGPU, so it's unlikely to be software decoding. Just iGPU driver's decoder being more efficient than dGPU one.

  • "All" really isn't true, most AM4 Ryzen chips don't have iGPU (unless they are specificly APUs), and a lot of Intel chips have popular 'F' SKUs without an iGPU.

  • The iGPU's video decoder could even be drastically less efficient than the dGPU's decoder, and it would still be better to use the iGPU, because just powering up the PCIe link and VRAM for the dGPU costs far more power than the video decoding itself.

    • Exactly, mpv logic causes it to pick up Nvidia for HW video even if renderer is on iGPU. There is special flag to choose device which solves the problem and Nvidia is kept down

  • What makes you think the unaccelerated path would use the accelerated iGPU path? Typically hardware decoding is disabled because of driver/reliability issues and thus would switch to software decoding to sidestep these concerns.

  • I assumed the OP/comment means "software vs. hardware accelerated rendering" when they say "it uses the CPU. And iGPU is still hardware accelerated rendering.

    But some modern video codecs are designed to work quite okay with software rendering, especially if it's lower resolutions, and modern higher end dGPUs often have a pretty high "power overhead" on low utilization. To add to it the driver might keep it in a more high power state then strictly needed due to "expecting" more utilization, or similar.

the story is kind of complicated, it's impossible to guess the culprit, you must profile. HDR content for example can sometimes incorrectly request a bespoke tonemapping instead of a video engine silicon one, like it does in libavcodec, or you have a privacy setting in your browser that breaks GPU compositing. so many little things can go wrong unfortunately.