LGFae/swww

Very slow performance on intel integrated graphics

Closed this issue · 4 comments

I'm pretty sure this is a fault of my hardware but swww is extremely slow in the transitions when I use it on my laptop. My PC plays the animations perfectly fine but on my laptop it is really slow.

Does swww really need that much hardware to play a smooth transition? Is there any possible solution so that I can have a smooth 60 fps when I change the wallpaper or is this not possible with my current hardware?

Here is my specs:
OS: EndeavourOS Linux x86_64
Host: XPS 13 9310
Kernel: 6.8.9-arch1-2
Uptime: 39 mins
Packages: 1418 (pacman)
Shell: zsh 5.9
Resolution: 3840x2400
DE: Hyprland
Terminal: kitty
CPU: 11th Gen Intel i7-1185G7 (8) @ 4.800GHz
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics]
Memory: 3869MiB / 15709MiB

Here is what I experience:
https://github.com/LGFae/swww/assets/110982014/06807e21-cb43-4195-83f6-8f2b4171fc9a

This is my swww command:
swww img "$IMAGE" -t wipe --transition-fps=144

Your hardware is fine. swww isn't a heavy application.

Try running the daemon with swww-daemon --format xrgb. That should fix your problems. It seems Mesa might have a faulty implementation for bgr surfaces on integrated monitors in general. I wish the compositor simply didn't advertise those formats as being available in the first place in those cases, but alas...

I started the daemon with the specified format and still really laggy.
Here is my result:
https://github.com/LGFae/swww/assets/110982014/790fc659-9e58-4da6-be2d-76ea313f9952

Is there maybe a power saving mode that's active on my laptop that is causing this issue? I recently installed tlp and set these gpu settings. Would this be an impact? Do I need to adjust my CPU frequency or is swww mainly a gpu intensive application?

Here is my tlp gpu and cpu settings:

~                                                                                          
❯ sudo tlp-stat -g
--- TLP 1.6.1 --------------------------------------------

+++ Intel Graphics
/sys/class/drm/card1/device/driver           = i915

/sys/class/drm/card1/power/rc6_enable        =  1 (enabled)
/sys/kernel/debug/dri/1/i915_fbc_status      = FBC disabled: PSR1 enabled (Wa_14016291713)
/sys/kernel/debug/dri/1/i915_edp_psr_status  = PSR mode: PSR1 enabled

/sys/class/drm/card1/gt_min_freq_mhz         =   500 [MHz]
/sys/class/drm/card1/gt_max_freq_mhz         =  1350 [MHz]
/sys/class/drm/card1/gt_boost_freq_mhz       =  1350 [MHz]
/sys/class/drm/card1/gt_RPn_freq_mhz         =   100 [MHz] (GPU min)
/sys/class/drm/card1/gt_RP0_freq_mhz         =  1350 [MHz] (GPU max)
~                                                                                          
❯ sudo tlp-stat -p
--- TLP 1.6.1 --------------------------------------------

+++ Processor
CPU model      = 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  = performance
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq  =   3000000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq  =   400000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = performance [EPP]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu1..cpu7: omitted for clarity, use -v to show all

/sys/devices/system/cpu/intel_pstate/status            = active
/sys/devices/system/cpu/intel_pstate/min_perf_pct      =   8 [%]
/sys/devices/system/cpu/intel_pstate/max_perf_pct      = 100 [%]
/sys/devices/system/cpu/intel_pstate/no_turbo          =   0
/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost =   0
/sys/devices/system/cpu/intel_pstate/turbo_pct         =  41 [%]
/sys/devices/system/cpu/intel_pstate/num_pstates       =  45
/sys/module/workqueue/parameters/power_efficient       = Y
/proc/sys/kernel/nmi_watchdog                          = 0

+++ Platform Profile
/sys/firmware/acpi/platform_profile                    = (not available)
/sys/firmware/acpi/platform_profile_choices            = (not available)

I started the daemon with the specified format and still really laggy

Oh really? That's quite surprising, actually.

Do I need to adjust my CPU frequency or is swww mainly a gpu intensive application?

swww does not use the gpu at all. We do our rendering entirely on the CPU and then send it over to the compositor. The compositor then (in all likelihood) sends the buffer to the GPU for displaying it on screen. It's literally just displaying a single static image per frame.


Okay, if the problem isn't the format, then I feel more confident we can find a good solution for this. There are a few things we can try.

First, are you trying the latest master, or version 0.9.5? The latest master has some faster transitions implementation, so it might help you out. Version 0.9.5 tries to speed up transitions by firing many threads, while the master version has a carefully written loop so that it is much more efficient on just a single thread.

This is my swww command:
swww img "$IMAGE" -t wipe --transition-fps=144

Does you integrated display actually work at 144 fps? Trying to use a larger fps than your display supports could create some issues. Specifically, it might cause us to allocate more buffers than we have to, because when we try to draw, there won't be any free buffers for us to use (because we are drawing faster than the monitor's refresh rate), and we will have to allocate more. It sounds counterintuitive, but using --transition-fps=60 could make the transition smoother if your monitor has a refresh rate of 60. I would actually try this out first, and then move on to the master version of swww if it doesn't help.

TLDR: try using --transition-fps=60 (or whatever value matches your monitor's refresh rate), and if it doesn't work try using the master version.

Okay I tried using the --transition-fps=60 and that didn't seem to fix the problem.

I updated to 0.9.5 and now for some reason if i do wipe it does the center circle transition I believe. The simple transition works great but the others are still laggy

But I compiled the git version and it works perfectly now. I'd say it was probably what you did with single threads. Closing for now.

Thank you!