Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Considerable GPU usage during switching animation #255

Open
SchrodingerZhu opened this issue Apr 1, 2024 · 4 comments
Open

Considerable GPU usage during switching animation #255

SchrodingerZhu opened this issue Apr 1, 2024 · 4 comments

Comments

@SchrodingerZhu
Copy link

image

I set swww to change the wallpaper every 30 seconds. And it successfully make my both cards busy.

#!/bin/bash

# This script will randomly go through the files of a directory, setting it
# up as the wallpaper at regular intervals
#
# NOTE: this script is in bash (not posix shell), because the RANDOM variable
# we use is not defined in posix

if [[ $# -lt 1 ]] || [[ ! -d $1   ]]; then
        echo "Usage:
        $0 <dir containing images>"
        exit 1
fi

# Edit below to control the images transition
export SWWW_TRANSITION_FPS=60
export SWWW_TRANSITION_STEP=2

# This controls (in seconds) when to switch to the next image
INTERVAL=30

while true; do
        find "$1" -type f \
                | while read -r img; do
                        echo "$((RANDOM % 1000)):$img"
                done \
                | sort -n | cut -d':' -f2- \
                | while read -r img; do
                        swww img "$img"
                        sleep $INTERVAL
                done
done

BTW, I found this when I was playing DDNet with swww running in the background. It freezes the game every 30 seconds.

@SchrodingerZhu
Copy link
Author

Wallpapers are from https://github.com/RumiAxolotl/hyprland-config/tree/main/wallpapers. They are not huge pics.

@LGFae
Copy link
Owner

LGFae commented Apr 1, 2024

We do not use the GPU in any capacity in swww. All the animations and transitions are done with the CPU. The work you observe in the GPU must be inside the compositor's renderer.

Seeing as you have an NVIDIA card, there's probably some shenanigans abound. There should be no world where the GPU is doing more work than the CPU. The GPU literally just needs to display a static image at every frame. Its work is trivial.

@shot-codes
Copy link

I experience this as well, alongside framedrop across the board during the animation with hyprland, running on intel integrated graphics. If I disable opacity and blur then it improves, but I still experience some frame drop.

Perhaps the GPU usage could come from all of blur updates as the background changes. Whats odd is my setup performed just fine some months ago, after a week or so not on the computer it was there. I suppose its also possible I just hadn't noticed it before but doubtful.

@shot-codes
Copy link

shot-codes commented May 16, 2024

#233 (comment) -- swww-daemon --format xrgb seems to solve my framerate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants