wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Vulkan renderer uses more GPU and battery than GLES one

Open mark-herbert42 opened this issue 1 month ago • 8 comments

Just wanted to try vulkan, as it advertized to be more efficient. Now it works with wayfire too, unfortunately many features that makes wayfire special are not supported there. And noticed that vulkan uses twice more GPU (measured by gputop or intel_gputop) than gles2. At idle arount 0.2-0.4% of rendering cores vs 0.1 in gles, and same on firefox youtube - 6-14% vs 3-7%. Tested on the same video same config just chenging WLR_RENDER and restart. Tried this many times and that is not measuring statostical fluctuation, that's how it is working.

Tried with git snaphot of wlroots which had more vulkan improvements over the stable 0.19 - but nothing changes, vulkan is worse than gles2 in all aspects. Both in features and efficiency. And - it does not show HDR content on firefox-youtube, just green rectangle. As I undestand gles does not as well - it shows SDR video instead of HDR bit that's better than green rect.

Not a bug - as I uderstand vulkan rendering is pretty experimental for all software involved - wlroots, wayfire and firefox. But so far not good. starting - but not a single reason for use so far.

mark-herbert42 avatar Nov 06 '25 15:11 mark-herbert42

Just wanted to try vulkan, as it advertized to be more efficient. Now it works with wayfire too, unfortunately many features that makes wayfire special are not supported there. And noticed that vulkan uses twice more GPU (measured by gputop or intel_gputop) than gles2. At idle arount 0.2-0.4% of rendering cores vs 0.1 in gles, and same on firefox youtube - 6-14% vs 3-7%. Tested on the same video same config just chenging WLR_RENDER and restart. Tried this many times and that is not measuring statostical fluctuation, that's how it is working.

Tried with git snaphot of wlroots which had more vulkan improvements over the stable 0.19 - but nothing changes, vulkan is worse than gles2 in all aspects. Both in features and efficiency. And - it does not show HDR content on firefox-youtube, just green rectangle. As I undestand gles does not as well - it shows SDR video instead of HDR bit that's better than green rect.

Not a bug - as I uderstand vulkan rendering is pretty experimental for all software involved - wlroots, wayfire and firefox. But so far not good. starting - but not a single reason for use so far.

You're right, Vulkan does use more hardware than GLES2. Currently, ICC profiles are the main reason to use it. But everything will move to Vulkan eventually, so Wayfire is on the right track by adopting this renderer and improving alongside it.

killown avatar Nov 06 '25 18:11 killown

I agree with you here - vulkan is used not only as graphics renderer, but also used as AI driver level etc, so it potentially has some future advantages as technology. The thing is why is the renderer so inefficient - is it a fault of vulkan as a technology that can not and will not be fixed, or is it the issue with this particular render code - wayfire is using mostly wlroots here. I am not sure how other compositors are doing here - if there any vulkan based renderers that do better or same as GLES? Maybe mutter or kwin or hyprland?

mark-herbert42 avatar Nov 06 '25 18:11 mark-herbert42

actually from what I see in wlroots and kwin discussions - it is in theory possible to implement ICC profiles and HDR in GLES (gles3), so the only vulkan advantage will be gone for now. From the other hand if vulkan rendering can be optimized to use less hardware resources - it would look better. Anyway still miss window shadows and wobbly windows.... are they possible on vulkan at all?

mark-herbert42 avatar Nov 06 '25 18:11 mark-herbert42

I agree with you here - vulkan is used not only as graphics renderer, but also used as AI driver level etc, so it potentially has some future advantages as technology. The thing is why is the renderer so inefficient - is it a fault of vulkan as a technology that can not and will not be fixed, or is it the issue with this particular render code - wayfire is using mostly wlroots here. I am not sure how other compositors are doing here - if there any vulkan based renderers that do better or same as GLES? Maybe mutter or kwin or hyprland?

I believe there is nothing that @ammen99 could do to improve it for now

actually from what I see in wlroots and kwin discussions - it is in theory possible to implement ICC profiles and HDR in GLES (gles3), so the only vulkan advantage will be gone for now. From the other hand if vulkan rendering can be optimized to use less hardware resources - it would look better. Anyway still miss window shadows and wobbly windows.... are they possible on vulkan at all?

Indeed, but who would implement this? Why not just use Vulkan? ICC profiles for color management in GLES3 will likely increase CPU, GPU, and battery usage. I suspect Vulkan could handle it more efficiently and in the end both gles3 and vulkan would have similar battery usage.

killown avatar Nov 06 '25 20:11 killown

@mark-herbert42 you could repeat your gpu test on sway and see, we use wlr_renderer for most stuff except custom effects, so if wayfire is idling at 2x the resource consumption, likely the issue is in wlroots / vulkan.

Vulkan is indeed experimental as nowhere near as optimized as GLES. However one has to point out that Vulkan is currently the only renderer which supports proper SRGB colors. It also does proper transparency (by proper, it is meant that it works according to the math of it). You can compare for example Vulkan and GLES wayfire even without color profiles, you will notice there is a great difference in both the colors and the transparency of terminals / etc. So Vulkan is more correct if you care about colors (maybe if you are a digital artist, or work with Photoshop, etc.). On the other hand, for regular users GLES2 is the recommended default.

As for the special effects in Wayfire: they can be ported to Vulkan, but it would require more work that I have not had the motivation for. I am actually not using most of the effects that Wayfire provides, and am currently happily daily-driving Vulkan, as I enjoy having correct colors :)

ammen99 avatar Nov 06 '25 23:11 ammen99

I've noticed the difference in colors as the first thing autostarts up in my desktop is a terminal with some transparency.

There are a lot of draft PR's for vulkan at wlroots side, so hope we'll see some improvements with upcoming 0.20 release.

mark-herbert42 avatar Nov 07 '25 03:11 mark-herbert42

I've noticed the difference in colors as the first thing autostarts up in my desktop is a terminal with some transparency.

Well what I was saying is that Vulkan is implemented correctly, but that comes at a cost, you need to do more computations. Therefore I am not sure that Vulkan will ever be as efficient as GLES, unless wlroots implements an option to disregard correctness in favor of performance.

ammen99 avatar Nov 07 '25 13:11 ammen99

Also seems that applications like firefox use GLES rendering inside, so it might be a better match with the GLES renderer within compositor. So I've tried vulkan, it us definitely more consumng but the difference in power save/temps is less than 10 %. But missing features are a no-go for me and I guess for most of users as well. So may be worth to get a list of features to be ported.

For myself - window shadows and server side decoration. Shadows are not just fun, bells and whistles - it is extremely important to see where one window ends and another starts. With my use it is an effort to see messenger window if it covers mail program. Is it a part of a mail interface or window on top? Terrible. The client side deco is crap - it ok in Win or Mac where you have 1 toolkit to rule them all, but here you have plenty and each of them use own way fro CSD. QT apps do not draw shadows at all - they claim that the program should do it in the code, explicitly - and if not kwin will make server shadow. Kwin will - not wayfire. And only very basic deco works - all fancwy shadowed ones are GLES only.....
Secongd in my list - wobbly windows. Bells and whistles, but it is a symbol of compiz era same as cube. But cube is not practical - look, enjoy, disable second day, But wobbly ususally reamain and there are questions all the time - how can I get wobbly in kde, gnome, mate, cinnamon etc... With the rest vilkan is more or less ok. App switcher in my No3, but it can be replaced with scale and wall.

mark-herbert42 avatar Nov 07 '25 17:11 mark-herbert42