UPDATE: Now you can install the VA-API enabled Mesa (for all the codecs) on openSUSE Tumbleweed by using PackMan with
sudo opi codecs
. This will also pull the Mesa driver automatically (you are most likely want to install all the codecs with this command after all). If you don't have opi installed yet, just runsudo zypper install opi
. Thanks Luis Zepeda for this update!
Following the drama at Fedora's subreddit regarding the fact that Fedora 37 drops VA-API accelerated hardware video decoding and encoding, which will be back ported to Fedora 36 also, openSUSE has followed Fedora's direction to disable this feature in their Mesa build. But before anything else, here are what you need to know:
- This change only affects AMD users on Mesa open source driver. If you're using AMD's proprietary driver, Intel GPU/iGPU, or Nvidia GPU, you are not affected by this change. More on this later on.
- Technically, this change doesn't disable all the codecs from using VA-API hardware video acceleration. It only affects H.264, H.265/HEVC, and VC-1.
- On openSUSE, you can re-enable VA-API hardware video acceleration for all the supported codecs by deleting just 2 lines of code from the spec file.
Why Intel and Nvidia users are not affected by this issue?
Because Intel is using all the VA-API features through Intel Media Driver for distro's packaged apps, or org.freedesktop.Platform.VAAPI.Intel for Flatpak apps. And Nvidia users mostly (if not all) use proprietary driver on Linux. Therefore, any change in Mesa is not related to Intel and Nvidia when it comes to VA-API.
AMD on the other hand uses VA-API features in Mesa directly, so it is affected by this issue. But if you're using AMD's proprietary driver, you naturally won't be affected by this change in Mesa.
Well, should you use AMD's proprietary driver instead of Mesa on Linux? I don't think you should, considering that you won't get any performance benefit at all by using the proprietary driver, and you might face a lot of hassles to get it installed/updated correctly without any issue on your system compared to Mesa in the pre-compiled kernel, I would recommend AMD users to stay on Mesa. The fact that AMD GPUs work without having to rely on the proprietary driver makes it the #1 choice for most Linux users.
Here is how to fix this issue in openSUSE Tumbleweed, step by step.
The fix is extremely easy for openSUSE Tumbleweed. Note that openSUSE Leap doesn't have to apply this fix yet as it will take a long long time before Mesa 22.2.x arrives on Leap. Without further ado, let's begin to re-enable VA-API hardware video acceleration for all the supported codecs.
Go to openSUSE Build Service website and create a new account there. If you already have an account, you can log in to use your account.
-
Go to Your Home Project page.
-
Click at Branch Package to clone and link a repository.
-
In the original project name box, search for openSUSE.
-
In the original package name box, search for Mesa.
-
Make sure that you don't check stay on this revision, so you will link (auto syncing) with the upstream repo. Then click the Branch button to clone the upstream repo to your branch.
-
Now you should have the Mesa driver at your own branch.
-
Let's edit the Mesa.spec file.
-
Search text for Dvideo-codecs in the file.
-
Remove
%if %{video_codecs}
above and%endif
below theDvideo-codecs=all \
line. This is based on Mesa revision 1142 before Mesa revision 1143 re-disabled the codecs. The result should look like this. -
Save the file.
-
Wait for the builds. It will take some time in the cloud. You can click on the Refresh button to update the builds' status. All the builds except for Leap 15.4, which is not related to our change, will show as succeeded when the build is completed.
-
Download your Mesa build.
-
Install your Mesa build with YaST 1-Click Install. Follow the screen instructions, it should be very easy, hence it's called 1-Click Install 😂
Reboot your PC/laptop. After rebooted, open YaST Software Management and search for Mesa package to check whether you're actually using your Mesa build.
Check available VA-API codecs with
vainfo
which is part ofvaapi-tools
package.
Note that:
- Your build is very safe to use since it will be linked along with the upstream build.
- If there's a breaking change, your build wouldn't success. Therefore, with this route, even though you wouldn't break the system, you'll have to maintain your build to be compatible with the main branch. Otherwise, you won't be able to update your system. I recommend using
opi codecs
instead.
Cover photo by Tim Mossholder on Unsplash
Smoker photo by Adrien King on Unsplash
Herbs photo by Bundo Kim on Unsplash
Background photo by Bruno Aguirre on Unsplash
Top comments (2)
Thanks for the write up!
I've been using openSUSE for a few months now, your articles had helped me deepen my knowledge of this distro and also improve my install.
I followed this guide to get back my hardware decoding and I also think it was also a good hands-on intro to the OBS, since this was my first time using it.
I also wanted to let you know that the people at the Packman repo now seem to be packaging Mesa with hardware decoding support. Just need to do the "opi codecs" command and you are good to go (probably not the most user friendly thing, but even before the mesa change, you already had to install the codecs not included by default, so they didn't really add any more steps IMO).
Looking forward to more of your excellent articles! openSUSE is severely underrated so it's harder for noobs like me to find as much info as with other more popular distros.
Agreed! openSUSE is the most underrated Linux distro. I am using it as my main working-gaming distro, love it >...<
Thanks for the info about the Mesa in Packman 🙏
I am glad you like my articles, thanks 😍