mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.86k stars 2.87k forks source link

higher power consumption with Vulkan on Intel - related to storable format warnings? #10338

Closed aufkrawall closed 2 years ago

aufkrawall commented 2 years ago

Gemini Lake SoC power consumption is ~0.5W higher vs. OpenGL with minimal config:

vo=gpu-next
gpu-api=vulkan
gpu-context=waylandvk
hwdec=vaapi

There are these warning messages:

[vo/gpu-next/vulkan/libplacebo] Storable format 'bgr565' has no matching GLSL format qualifier but read/write without format is not supported.. disabling
[vo/gpu-next/vulkan/libplacebo] Storable format 'rgb565' has no matching GLSL format qualifier but read/write without format is not supported.. disabling
[vo/gpu-next/vulkan/libplacebo] Storable format 'bgr5a1' has no matching GLSL format qualifier but read/write without format is not supported.. disabling

The gap also seems to grow larger with --video-sync=display-resample, at least in total Watts. No difference between vo=gpu and gpu-next.

Now I wonder if perhaps it falls back to a storable format that isn't optimal for performance?

Log: output.txt

Linux 5.17.9 Mesa 21.1.2 Plasma Wayland 5.25.1 mpv 3a2838c88d428ced32a562a0361f2a89ec0fda27 libplacebo 669139cd48424821c3adc57c61d6bc265631e69a

philipl commented 2 years ago

No, those are not generally useful formats which we wouldn't use and Intel haven't handled properly so those warnings are basically saying their Vulkan and DRM drivers don't have consistent format lists.

There's plenty of potential for differences in hardware usage between the drivers to explain power usage differences. I assume you've looked at Intel_gpu_top data but this is a question for the mesa issues tracker where they'll probably just shrug.

aufkrawall commented 2 years ago

Alright, thanks!

haasn commented 2 years ago

There's nothing in your log that would indicate anything unnecessary being done on our side. As far as I can tell, we are just emitting a minimal fragment shader draw call on a mapped hwdec texture. No extra copies, no compute shaders, nothing.

It might be a difference in the optimization being done between the path taken by the GLSL shader. When running OpenGL, it goes through the mesa GL compiler and NIR->hw mapping layer, which is afaict a completely separate path from the one taken by ANV in compiling SPIR-V (which itself is the output of glslang).

If you really want to dig deep, you could try dumping the raw shader instructions being executed and we could see if there's an obvious difference.

aufkrawall commented 2 years ago

Thanks, good to know that Vulkan VAAPI shouldn't have any additional overhead vs. GL in mpv/gpu-next. I'm happy with OpenGL still being available with gpu-next for such cases, this terrible hardware probably wouldn't deserve a deeper dive.

Unlike getting hold of a crash dump of mpv, as I suspect Linux kernel 5.18.x as a culprit for causing me segfaults on that Gemini Lake system. sigh...