Breaking
December 12, 2024

How GPU hardware acceleration works with Linux | usagoldmines.com

The processor of current PCs is usually powerful enough to work smoothly with all types of content. However, some processes put a higher load on the processor — for example, when you watch videos.

Still, playback is usually smooth because streaming providers automatically reduce the video quality if the internet connection is not fast enough or the PC’s performance is insufficient.

Nevertheless, it makes sense to reduce the load on the CPU because this reduces power consumption and the battery lasts longer on laptops.

The graphics unit (GPU) of the PC is located in the main processor, in a separate graphics chip, or on a dedicated graphics card. The GPU often doesn’t have much to do apart from displaying the desktop. But the graphics chip is often more powerful than the CPU when it comes to playing (decoding) videos.

The GPU can also help when converting videos into other formats (encoding). The overall power consumption is reduced, videos can be played in higher quality levels or converted faster.

IDG

GPU utilization under Linux

Whether and how hardware acceleration can be utilized by the graphics chip depends on several factors under Linux:

  • The model of the graphics chip and its capabilities
  • The driver used
  • The display protocol (X11 or Wayland)
  • The respective software (browser, video player, video editor)

IDG

There are also several interfaces for different application areas that can be used for hardware acceleration:

  • Vulkan is mainly used by games and can also be used when playing videos.
  • Open GL is the predecessor of Vulkan and offers support for 2D/3D vector graphics on the desktop and in games.
  • Vdpau offers hardware acceleration for video playback, comes from Nvidia, and is also supported by AMD graphics drivers.
  • CUDA is a programming interface (API) from Nvidia with which program parts can be processed by the graphics processor (GPU). The API is used, for example, in AI applications and when playing (NVDEC) and converting (NVENC) videos.
  • VA-API is an interface for decoding and encoding videos with AMD and Intel GPUs.
  • Quick Sync Video is the name of the hardware acceleration of Intel GPUs, which is accessed via the VA-API.

Media players usually recognize the available interfaces automatically and use hardware acceleration by default. Web browsers, on the other hand, usually do not offer this function with common graphics chips.

Current graphics chips provide hardware acceleration for playback with the codecs H264 (AVCHD), H265 (HEVC), and VP9. This means you are well equipped because YouTube, for example, usually uses H264 or VP9.

You can find out what a chip can do from Nvidia, Intel and AMD.

IDG

In the foreseeable future, YouTube will increasingly switch to the license fee-free AV1 codec, the improved successor to VP9. Netflix will also be using AV1 in the future.

However, only newer graphics chips such as Intel Tiger Lake (11th generation) or Nvidia GeForce from RTX 2050 offer hardware acceleration (decoder) for AV1. If you want to use the AV1 encoder for conversion, you need a graphics card from GeForce RTX 4050, AMD Radeon RX 7000, or Intel Arc.

Even if the graphics chip supports a format, drivers and interfaces must also be compatible. VLC, for example, can use Vdpau for hardware acceleration if the Nvidia driver is installed.

However, browsers such as Mozilla Firefox or Google Chrome rely on VA-API, which the Nvidia driver does not support. A suitable driver with VA-API (“nvidia-vaapi-driver”) is only officially available in the distribution repository from Ubuntu 23.04 onwards. Support for VA-API is included as standard for Intel graphics; AMD drivers support VA-API and Vdpau.

The open source driver Nouveau for Nvidia chips also supports VA-API and VDPAU, but only for older chipsets such as GeForce 700 or 600.

Check support for Intel chips

The graphics units from Intel are usually found in the CPU of the PC. Quick Sync Video has been included since around 2011, starting with the Sandy Bridge processors (Intel HD Graphics 2000 and 3000). Linux distributions contain the necessary drivers as standard.

IDG

You can find out what the chipset has to offer in the terminal with the vainfo tool, which can be installed via the package of the same name. It displays the version numbers of the VA-API and the Intel driver.

You can also see the supported codec profiles, such as “VAProfileH264Main” and “VAProfileVP8Version0_3”. The addition “VAEntrypointEncSliceLP” indicates that encoding, i.e. accelerated conversion to this format, is also offered for this codec.

You can check whether a program actually uses the VA-API with another tool, which you can install with

sudo apt install intel-gpu-tools

in the terminal. Then start

sudo intel_gpu_top

and in another terminal call the media player VLC in the form

vlc 

If the video is encoded with a codec such as VP9 or H264, VLC provides information on the use of VA-API and the associated driver, intel_gpu_top shows the utilization of the GPU.

Note: If a dedicated graphics card from Nvidia is installed in the PC, the functions of the Intel graphics unit cannot be used. For laptops with hybrid graphics, you can switch to the Intel chip via the Nvidia X Server Settings tool under “PRIME profiles.” If the option is not available, use the following in the terminal

sudo prime-select intel

You must then log out and log in again. Replace “intel” with “nvidia” or “on-demand” (if required) to switch back to the more powerful Nvidia chip.

Play videos in Firefox with VA-API

Firefox offers support for the VA-API under X11 (Linux Mint) and under Wayland (Ubuntu) by default.

Call up the internal address “about:support” to check the function. Below the “Graphics” section, you will see “WebRenderer” after “Composing.” If “WebRenderer (software)” is displayed here, hardware acceleration is not active. Under “Media” you can find out for which codecs hardware decoding is offered.

You can call up a list of YouTube example videos in high resolution here.

Show “Statistics for interested parties” via the context menu of the video. If the line after “Codec” begins with “av01,” hardware acceleration is only available if the graphics chip already supports the format.

Try out different resolutions after clicking on the cogwheel symbol behind “Quality” until “vp09” appears behind “Codec.”

You can also install the “Your Codecs” extension in Firefox and use it to block the VP8, VP9, or AV1 formats. If all are blocked, YouTube will deliver videos with the AVC1 codec (H.264), but usually only in a lower resolution of up to 1080p.

In the YouTube settings, which you can access via the hamburger menu (three horizontal lines) at the top left, the behavior can be influenced under “Playback and performance.” If the graphics chip does not support AV1, activate the option “Prefer AV1 for SD” under “AV1 settings.”

YouTube then only uses AV1 at low resolutions, which reduces the CPU load. Otherwise it will switch to VP9 or another format. In the terminal you can use

sudo intel_gpu_top

to see how much support from the GPU reduces the load on the CPU.

IDG

AMD graphics chips: Linux automatically sets up the necessary drivers and the functions can be checked with vainfo. If the tool does not display anything, the kernel modules probably do not support the chipset.

For newer AMD graphics cards, you should use kernel versions 6.2 or higher. Ubuntu 22.04 automatically installs this version through updates. Users of Linux Mint 21 go to “System management > Update management, and in the menu to “View > Linux kernel.” Select a more recent kernel version and click on “Install.”

If you want to check the GPU utilization, install the Radeon-Profile tool with these three lines:

sudo add-apt-repository ppa:radeon-profile/stable
sudo apt update
sudo apt install radeon-profile

The value behind “GPU usage” increases as soon as you play a video.

Google Chrome and Chromium

There are numerous tips circulating on the internet on how to activate hardware acceleration in Chromium-based browsers. Depending on the program version and desktop environment, you may be successful.

In our tests, we were unable to persuade Google Chrome or Chromium to cooperate. One reason for this is the outdated version of VA-API in Ubuntu and Linux Mint. The browsers do not currently work with AMD graphics chips, regardless of which version is installed. The description therefore only applies to Intel graphics.

IDG

If you are not afraid of the effort, you can update the libraries and drivers. To do this, use the script “build_intel_ media.sh” (only for Intel chips). It installs the program packages required for development, downloads the source code to the “$HOME/src” folder, and compiles the files. Then restart Linux.

In the terminal, vainfo now displays VA-API version 1.21 (or higher) (previously: 1.14). Under Linux Mint, set up Chromium as a system package via the application management. Google Chrome does not yet work with the new VA-API, nor does the Snap package from Ubuntu.

Start the browser and play a test video. Open the internal address “chrome://gpu” in another tab. Behind “Video Decode:” it says “Hardware accelerated.” However, this means nothing because Chromium also provides this information if hardware acceleration is only theoretically possible. Detailed information can be found at “chrome://media-internals.”

Click on the link with the addition “(kPlay)” while the video is playing. The “kVideoDecoderName” is followed by “VaapiVideo- Decoder” if GPU acceleration is active.

Retrofitting VA-API for Nvidia

You can already use the VA-API driver under Ubuntu 22.04 or Linux Mint 21. However, you must create the driver yourself from the source code.

The prerequisite is that the proprietary Nvidia driver in version 470, 500 or higher is activated. The VA-API driver is primarily intended for hardware acceleration in Firefox; the function is not guaranteed for other software.

In addition, the driver does not yet work optimally under Wayland and certainly not with Firefox installed as Snap or Flatpak. Linux Mint fulfils these requirements, Ubuntu users follow these instructions.

IDG

To install the Nvidia driver — if not already present — Ubuntu users search for “Drivers” via “Activities” and click on “Additional drivers.”

With Linux Mint, the path leads via “Driver management.” Select the driver with the highest version number and the addition “Proprietary, tested” (Linux Mint “recommended”). Click on “Apply changes” and restart Linux after completing the installation.

To be able to create the VA-API driver, install some packages in the terminal:

sudo apt install build-essential git meson gstreamer1.0-plugins-bad libffmpeg-nvenc-dev libva-dev libegl-dev cmake pkg-config libdrm-dev libgstreamer-plugins-bad1.0-dev

Then create a working directory and download the source code (four lines):

mkdir ~/src && cd ~/src
wget https://github.com/elFarto/nvidia-vaapi-driver/archive/refs/tags/v0.0.11.tar.gz
tar xvf v0.0.11.tar.gz
cd nvidia-vaapi-driver-0.0.11

Adjust the version numbers if necessary. Then compile and install with

meson setup build
sudo meson install -C build

to compile and install the driver.

Activating the Nvidia VA API driver for Firefox

In order for Linux to load the driver, you must set some environment variables. Open the file “/etc/environment” as administrator in a text editor and add the three lines

export LIBVA_DRIVER_NAME=nvidia
export MOZ_DISABLE_RDD_SANDBOX=1
export NVD_BACKEND=direct

is added. The last line is currently required for Nvidia drivers from version 525. The Linux kernel must also be informed. Open the text file “/etc/default/ grub” with root authorization and add this option to the line “GRUB_CMDLINE_LINUX_DEFAULT”

nvidia-drm.modeset=1

Then execute in the terminal

sudo update-grub

and restart Linux for the changes to take effect. You can check the correct function with vainfo. The tool outputs “vainfo: Driver version: VA-API NVDEC driver [direct backend].”

You need to change some settings so that Firefox takes the new driver into account. To be on the safe side, use a new user profile to test the settings first.

In the terminal, start

firefox -P

and create and start a new profile. Call up the “about:config” address and set the following three options

media.ffmpeg.vaapi.enabled
media.rdd-ffmpeg.enabled
widget.dmabuf.force-enabled

to “true” in each case. Then restart Firefox.

To test the GPU utilization, start Nvidia X Server Settings and click on “GPU 0″ ([Nvidia model]).” The values behind “GPU Utilization” and “Video Engine Utilization” increase when hardware acceleration is used.

 

This articles is written by : Nermeen Nabil Khear Abdelmalak

All rights reserved to : USAGOLDMIES . www.usagoldmines.com

You can Enjoy surfing our website categories and read more content in many fields you may like .

Why USAGoldMines ?

USAGoldMines is a comprehensive website offering the latest in financial, crypto, and technical news. With specialized sections for each category, it provides readers with up-to-date market insights, investment trends, and technological advancements, making it a valuable resource for investors and enthusiasts in the fast-paced financial world.

Recent:

Adobe Acrobat Pro review: Still the gold standard | usagoldmines.com
Best PCIe 4.0 SSDs 2024: Top picks from experts | usagoldmines.com
Best holiday tech deals on Amazon: Save big with expert-curated picks | usagoldmines.com
Best monitor deals: Sweet holiday sales on OLED, gaming displays, and more | usagoldmines.com
AT&T's Messaging App Is Officially Dead Michelle Ehrhardt | usagoldmines.com
My Favorite Amazon Deal of the Day: The Ultimate Ears Wonderboom 4 Speaker Daniel Oropeza | usagoldm...
Keynote, Pages, and Numbers Get Apple Intelligence Features Juli Clover | usagoldmines.com
Cybercriminals are using virtual hard drives to drop RATs in phishing attacks udinmwenefosa@gmail.co...
Google Gemini on your Nest speaker: How to give it a try | usagoldmines.com
Epic Games Store Will Now be Preloaded On Millions of Android Phones Tim | usagoldmines.com
Five Unexpected Subscription Services That Can Actually Save You Money Jeff Somers | usagoldmines.co...
You'll Soon Be Able to Share Your AirTag's Location With Your Airline Jake Peterson | usagoldmines.c...
Apple Adopting Custom-Designed Bluetooth and Wi-Fi Chip in 2025, Cutting Reliance on Broadcom Juli C...
New Apple TV and HomePod Mini Launching in 2025 Juli Clover | usagoldmines.com
Anker Kicks Off Massive Holiday Sale With Up to 40% Off Sitewide, Charger Bundles, Mystery Gifts, an...
British startup launches low-power RISC-V processor design to address the twin problems of memory an...
Microsoft patches worrying zero-day along with 71 other flaws | usagoldmines.com
Your Roku device is getting a free, high-definition upgrade for the holidays james.davidson@futurene...
Refurbished Steam Deck OLEDs are now almost as cheap as new LCD models – good luck finding one thoug...
The optical disc onslaught continues, with LG quitting Blu-ray players Scharon Harding | usagoldmine...
OpenAI introduces “Santa Mode” to ChatGPT for ho-ho-ho voice chats Benj Edwards | usagoldmines.com
Studies pin down exactly when humans and Neanderthals swapped DNA Kiona N. Smith | usagoldmines.com
Generating power with a thin, flexible thermoelectric film Jacek Krywko | usagoldmines.com
Sending files from iPhone to Windows just got a lot faster and easier | usagoldmines.com
Get this Dell laptop with Core i5 for the super-budget price of $300 | usagoldmines.com
Samsung’s 34-inch 1440p ultrawide monitor drops 42% to its best price ever | usagoldmines.com
YouTube TV is hiking its monthly price, again | usagoldmines.com
Best online backup 2024: iDrive, Backblaze, Livedrive, and more | usagoldmines.com
This 27-inch Dell IPS gaming monitor is an incredible $150 today | usagoldmines.com
Save individual emails locally to your hard drive in the new Outlook | usagoldmines.com
This Core i9 mini PC with 32GB RAM is down to $455 right now | usagoldmines.com
Is Fubo’s cheaper “Essential” plan worth it? | usagoldmines.com
DEAL: Galaxy Z Flip 6 Down to $249 ($850 Off), $300 Off Even With No Trade-in Tim | usagoldmines.com
I’m Always Cold, and the Dreo Solaris Is the Best Space Heater I’ve Tried Allie Chanthorn Reinmann |...
ResMed Debuts Ergonomic Head Strap for Vision Pro Juli Clover | usagoldmines.com
The Huawei Mate X6 looks like a huge step forward for foldable phone photography, and I’m annoyed th...
The EU still cant agree on chat control – but it's not over yet chiara.castro@futurenet.com (Chiara ...
Struggle to find where to live stream your favorite sports team on Max, ESPN Plus, Peacock and more?...
United Airlines and Apple AirTags are ready to help reunite you with your lost bags jacob.krol@futur...
Intel Arc B580 review: A $249 RTX 4060 killer, one-and-a-half years later Andrew Cunningham | usagol...
Google steps into “extended reality” once again with Android XR Kevin Purdy | usagoldmines.com
YouTube TV is hiking its monthly price, again | usagoldmines.com
Here’s All the Cool Stuff Android XR Wants to Do Kellen | usagoldmines.com
The Best Chrome Extensions of 2024, According to Google Pranay Parab | usagoldmines.com
The ‘Magic Basket’ Method Breaks Decluttering Into Two Manageable Steps Lindsey Ellefson | usagoldmi...
New Mac Pro and an 'Extreme' Chip: Here's What the Latest Rumors Say Joe Rossignol | usagoldmines.co...
Haunted Chocolatier - everything we know elie.gould@futurenet.com (Elie Gould) | usagoldmines.com
Comcast plans to launch another streaming service in 2025 – here's what that means for Peacock | us...
Another major WordPress plugin has been hacked to try and hijack your sites | usagoldmines.com
Wix just made it easier to engage with your website visitors | usagoldmines.com
Anker’s tipped next wireless power bank could be the iPhone’s best MagSafe option yet jamie.richards...
AI helps ID paint chemistry of Berlin Wall murals Jennifer Ouellette | usagoldmines.com
Sending files from iPhone to Windows just got a lot faster and easier | usagoldmines.com
Android XR is Official as Google’s Extended Reality Platform, Samsung Shows Off First Headset Kellen...
How to Browse the Dark Web David Nield | usagoldmines.com
What People Are Getting Wrong This Week: CEO Shooter Conspiracy Theories Stephen Johnson | usagoldmi...
AirPods Pro 2 Hearing Aid and Hearing Test Features Approved to Launch in Canada Joe Rossignol | usa...
Apple Watch Ultra 2 Drops to $719.00 Low Price on Amazon With Christmas Delivery Mitchel Broussard |...
Apple Expands iPhone Driver's License Feature to 10th Location Joe Rossignol | usagoldmines.com
Four key steps to creating a DEX Operations Centre | usagoldmines.com
Apple fixes Passwords app security bug with new 18.2 update chiara.castro@futurenet.com (Chiara Cast...
Gemini 2.0 is here, as Google continues push towards agentic AI | usagoldmines.com
Google and Samsung reveal Project Moohan mixed-reality headset and Android XR, 'the first platform b...
Hollow Knight Silksong - everything we know | usagoldmines.com
Dune Awakening - everything we know so far | usagoldmines.com
Phantom Blade Zero - everything we know so far | usagoldmines.com
Apple TV Plus scores the streaming rights to All of You, a sci-fi romance from the co-creator of Shr...
Assassin's Creed Shadows' new combat overview details how skills, offensive attacks, and weapons are...
In an odd bit of propaganda, Belarus claims to have its own Starlink technology Eric Berger | usagol...
YouTube TV is hiking prices again after denying “erroneous” report days ago Kevin Purdy | usagoldmin...
Weight loss drugs may also treat addiction, Alzheimer’s, and heart disease Ian Johnston and Michael ...
Intel Arc B580 review: The first worthy budget GPU of the decade | usagoldmines.com
The Windows 11 24H2 update is no longer blocked on these PCs | usagoldmines.com
YouTube TV Raises Price Yet Again, This Time to $82.99 in January Kellen | usagoldmines.com
You Should Plan Your 2025 Travel During These 'Dead Weeks' Emily Long | usagoldmines.com
You Can Get the Sonos Ace Wireless Headphones for Their Lowest Price Ever Right Now Pradershika Shar...
BMW’s iconic M3 is going electric – and I hope battery packs and e-motors don't destroy what makes i...
Assassin's Creed Infinity - everything we know so far | usagoldmines.com
Want to remove information about yourself online? You're not alone | usagoldmines.com
From gut feeling to data-driven strategy: AI’s role in holiday retail success | usagoldmines.com
This devious new malware technique looks to hijack Windows itself to avoid detection | usagoldmines...
Independent auditors confirm Mullvad VPN as secure chiara.castro@futurenet.com (Chiara Castro) | usa...
What is phishing and how dangerous is it? | usagoldmines.com
Garmin's 2024 data revealed – find out how good your stress and sleep scores are now stephen.warwick...
Intel Arc B580 review: The first worthy budget GPU of the decade | usagoldmines.com
Pokemon TCG Pocket Gets First Expansion Called “Mythical Island” on December 17 Kellen | usagoldmine...
Apple Just Patched These 20 Security Vulnerabilities With iOS 18.2 Jake Peterson | usagoldmines.com
Why a Chest Strap Is the Best Way to Track Your Heart Rate During Exercise Beth Skwarecki | usagoldm...
iOS 18 Updates Continue to Cause Delays in Apple's iOS 19 Plans Tim Hardwick | usagoldmines.com
Sony reveals that the transition of players from PS4 to PS5 is 'trending well' but doesn't see a 'ma...
I can’t keep track of all the Yellowstone spin-offs on Paramount Plus and yet another is reportedly ...
You've got more time – the great Google Maps Timeline switch gets a new deadline date | usagoldmine...
Krispy Kreme orders across the US disrupted after cyberattack | usagoldmines.com
Apple might have ditched plans for an M4 Extreme chip in favor of AI - and I think that's for the be...
Whoops! Apple seemingly just leaked its M4 MacBook Airs thanks to the macOS 15.2 update matthew.hans...
Microsoft announces that Xbox Insiders with Game Pass Ultimate can now stream select games on consol...
Samsung Galaxy S25 Ultra predicted colors: every rumored shade | usagoldmines.com
Thousands of Bitcoin ATM users may have personal data leaked after breach | usagoldmines.com
Mike Flanagan has written a Clayface movie and I can't wait to see his take on an underrated Batman ...
NASA’s boss-to-be proclaims we’re about to enter an “age of experimentation” Stephen Clark | usagold...

Leave a Reply