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

Enable Hardware Acceleration. #9

Closed
LiveWallpaperReborn opened this issue Apr 4, 2024 · 3 comments
Closed

Enable Hardware Acceleration. #9

LiveWallpaperReborn opened this issue Apr 4, 2024 · 3 comments

Comments

@LiveWallpaperReborn
Copy link

The instructions for enabling hardware acceleration are unclear/insufficient. I've gone through the linked Arch Wiki, and I believe I have everything installed. Nvidia 2070 Super. (Also Fuck Nvidia) From my research enabling hardware acceleration isn't just something you do on an OS level like your instructions make it out to be (but i'm also retarded though, so maybe it is). The following instructions to enable hardware acceleration in FFMPEG and Gstreamer seemed to make sense at first, but after digging on how to do that, it appears that you don't just enable hardware acceleration in FFMPEG, but instead specify for the program to use it when you're encoding a video, for example. Honestly i'm not very familiar with FFMPEG and always use a gui wrapper. I was hoping you could make it more clear what specific underlying program is running the video, and what specific changes your end users would need to make to enable it to run on the GPU.

For me specifically i'm running Nvidia proprietary drivers on the latest Endeavour OS. (That's basically Arch, btw)

As it stands my CPU runs around 20% from KDE when video wallpaper is on.

Ps. This reimplimentation of smart video wallpaper is fucking phenomenal. the video start stop on window maximize is instant! infinitely smoother than the original that would sometimes take up to 5 seconds to restart the video. You must have done some serious code optimization. This plugin is better than the original, and smartER video wallpaper. I was very upset when I saw it wasn't ported to plasma 6 when Endeavour updated. So, seriously man... thank you. I like the interface a lot more too, and it seems simpler to use as a whole and more powerful, as well. multi video support is badass!

So again, Thanks. Seriously.

@luisbocanegra
Copy link
Owner

luisbocanegra commented Apr 4, 2024

The instructions for enabling hardware acceleration are unclear/insufficient. I've gone through the linked Arch Wiki, and I believe I have everything installed. Nvidia 2070 Super. (Also Fuck Nvidia) From my research enabling hardware acceleration isn't just something you do on an OS level like your instructions make it out to be (but i'm also retarded though, so maybe it is). The following instructions to enable hardware acceleration in FFMPEG and Gstreamer seemed to make sense at first, but after digging on how to do that, it appears that you don't just enable hardware acceleration in FFMPEG, but instead specify for the program to use it when you're encoding a video, for example.

The commandline stuff can be ignored. If there are additional dependencies that are not listed in the main Hardware video acceleration page they should be installed. But for Nvidia proprietary driver + ffmpeg backend (which is the default) only nvidia-utils additional package should be needed.

Honestly i'm not very familiar with FFMPEG and always use a gui wrapper. I was hoping you could make it more clear what specific underlying program is running the video, and what specific changes your end users would need to make to enable it to run on the GPU.

The video is played by Qt Multimedia, which has a qml plugin that internally uses ffmpeg (or gstreamer if forced with the environment variable). The specific code that plays the video is located in main.qml so as you can see it is not running ffmpeg or gstreamer commands directly.

For me specifically i'm running Nvidia proprietary drivers on the latest Endeavour OS. (That's basically Arch, btw)

As it stands my CPU runs around 20% from KDE when video wallpaper is on.

I just tried booting with only the nvidia card enabled and it works with hw acceleration. All I did was install the proprietary driver + nvidia-utils and set LIBVA_DRIVER_NAME=nvidia environment variable. I'm using the default ffmpeg backend.

Nvidia Intel
Screenshot_20240404_064105 This is on a laptop with two monitors + GTX 1650 (weak) + intel gpu, the iGPU is only used to display output from the main renderer (which is the Nvidia card) to the laptop's screen Screenshot_20240404_075849 For reference, same laptop/displays, Intel gpu only with hw acceleration

The video playing is in 4K and cpu/gpu load is still somewhat high but as you can see in nvtop DEC: 26% it is using the gpu for video decoding, same for the Intel gpu on the right Video 40.5%.

Can you please install and run nvtop and show the output you get?

Ps. This reimplimentation of smart video wallpaper is fucking phenomenal. the video start stop on window maximize is instant! infinitely smoother than the original that would sometimes take up to 5 seconds to restart the video. You must have done some serious code optimization. This plugin is better than the original, and smartER video wallpaper. I was very upset when I saw it wasn't ported to plasma 6 when Endeavour updated. So, seriously man... thank you. I like the interface a lot more too, and it seems simpler to use as a whole and more powerful, as well. multi video support is badass!

So again, Thanks. Seriously.

You're welcome! At first just wanted to make it work and send the patches to the old project, but seeing it wasn't really being maintained I decided to continue my own and just kept improving it.

@LiveWallpaperReborn
Copy link
Author

thank you so much for your well thought out and complete reply! So, remember when I said I was retarded? Turns out I was hardware accelerating the whole time and found out with nvtop (thanks for that, btw. nvtop is awesome! Always bugged me htop never showed GPU usage. nvtop just got added to my list of programs in my post-install script) the cpu utilization is only 20% on one core, anyways, gpu is at like 20% while accelerating, and it all dies when i pull up a fullscreen app because unlike the original Smart Video Wallpaper your pause resume on maximized windows works flawlessly and instantly. that's easy to live with especially with the epic eye candy. I can't go back to jpeg's as wallpaper, man. :D

You may want to add a bit to the hardware encoding part of your readme for people like me something like (on most distro's its likely hardware acceleration is enabled out of the box. check nvtop for GPU utilization) . Always good to idiot proof something. :D

Ps. I thought i'd seen your name before and just noticed...
Panel Colorizer
You make panel colorizer too?! how awesome can you be! you've basically made my whole desktop, man. I found colorizer on a forum post looking for a latte dock replacement. Pic attached of my desktop. It's literally all you, and colors by catpuccin. The KDE team should really just hire you on and integrate your plasma addons into mainline.

@luisbocanegra
Copy link
Owner

luisbocanegra commented Apr 5, 2024

thank you so much for your well thought out and complete reply! So, remember when I said I was retarded? Turns out I was hardware accelerating the whole time and found out with nvtop (thanks for that, btw. nvtop is awesome! Always bugged me htop never showed GPU usage. nvtop just got added to my list of programs in my post-install script) the cpu utilization is only 20% on one core, anyways, gpu is at like 20% while accelerating

Yeah I also noticed that, it seems video decoding on Nvidia may need some improvements. But knowing how things go with Nvidia+Linux I am thankful it works at least. Also surprises me AMD is the one having problems with this plugin.

and it all dies when i pull up a fullscreen app because unlike the original Smart Video Wallpaper your pause resume on maximized windows works flawlessly and instantly. that's easy to live with especially with the epic eye candy. I can't go back to jpeg's as wallpaper, man. :D

You may want to add a bit to the hardware encoding part of your readme for people like me something like (on most distro's its likely hardware acceleration is enabled out of the box. check nvtop for GPU utilization) . Always good to idiot proof something. :D

Thanks for the suggestion, I'll add it to the readme.

Ps. I thought i'd seen your name before and just noticed... Panel Colorizer You make panel colorizer too?! how awesome can you be! you've basically made my whole desktop, man. I found colorizer on a forum post looking for a latte dock replacement. Pic attached of my desktop. It's literally all you, and colors by catpuccin. The KDE team should really just hire you on and integrate your plasma addons into mainline.

Thanks for the kind words ❤️. Unfortunately most of the plugins I make are experimental/overkill and susceptible to decreased accessibility/performance. Not to mention the abuse of qml, some of these things should be done in C++ which I know nothing of 🙃.

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

2 participants