Linux Hardware Acceleration - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux Hardware Acceleration Guide
Complete beginner-friendly guide to hardware acceleration on Linux, covering Arch Linux, CachyOS, and other distributions including VAAPI, VDPAU, GPU acceleration for video playback, encoding, and browser acceleration.
Table of Contents
- Understanding Hardware Acceleration
- VAAPI Setup
- VDPAU Setup
- NVIDIA GPU Acceleration
- AMD GPU Acceleration
- Intel GPU Acceleration
- Video Player Configuration
- Browser Acceleration
- Troubleshooting
Understanding Hardware Acceleration
What is Hardware Acceleration?
Hardware acceleration uses your graphics card (GPU) instead of your processor (CPU) for certain tasks.
What it does:
- Video decoding: Playing videos uses GPU instead of CPU
- Video encoding: Converting videos uses GPU (faster)
- Graphics rendering: Applications use GPU for graphics
- Computational tasks: Some programs use GPU for calculations
Why it matters:
- Better performance: GPU is faster for graphics tasks
- Lower CPU usage: CPU is free for other tasks
- Better battery life: More efficient (on laptops)
- Smoother playback: Videos play without stuttering
- Faster encoding: Video conversion is much faster
Types of Hardware Acceleration
VAAPI (Video Acceleration API):
- What it is: Open standard for video acceleration
- Supported by: Intel, AMD, some NVIDIA
- Used for: Video decoding and encoding
- Best for: Intel and AMD GPUs
VDPAU (Video Decode and Presentation API):
- What it is: NVIDIA's video acceleration API
- Supported by: NVIDIA GPUs
- Used for: Video decoding
- Best for: NVIDIA GPUs
NVDEC/NVENC:
- What it is: NVIDIA's hardware decoder/encoder
- Supported by: Modern NVIDIA GPUs
- Used for: Video decoding and encoding
- Best for: NVIDIA GPUs (newer models)
VAAPI Setup
Install VAAPI
For Intel GPUs:
# Arch/CachyOS
sudo pacman -S libva-intel-driver libva-utils
# Debian/Ubuntu
sudo apt install i965-va-driver vainfo
# Fedora
sudo dnf install intel-media-driver libva-utils
For AMD GPUs:
# Arch/CachyOS
sudo pacman -S libva-mesa-driver libva-utils
# Debian/Ubuntu
sudo apt install mesa-va-drivers vainfo
# Fedora
sudo dnf install mesa-va-drivers libva-utils
Verify VAAPI
Check VAAPI:
# List VAAPI devices
vainfo
# Check codecs
vainfo --display drm --codecs
VDPAU Setup
Install VDPAU
Install packages:
# Arch/CachyOS
sudo pacman -S libvdpau libvdpau-va-gl vdpauinfo
# Debian/Ubuntu
sudo apt install libvdpau1 vdpauinfo
# Fedora
sudo dnf install libvdpau vdpauinfo
Verify VDPAU
Check VDPAU:
# Check VDPAU
vdpauinfo
🟢 NVIDIA GPU Acceleration
NVDEC/NVENC
Modern NVIDIA GPUs support NVDEC/NVENC.
Check support:
# Check NVIDIA
nvidia-smi
# Check codecs
nvidia-smi --query-gpu=name --format=csv
Configure:
# Usually works automatically with NVIDIA drivers
# No additional configuration needed
AMD GPU Acceleration
AMD VAAPI
AMD GPUs use VAAPI for acceleration.
Install:
# Arch/CachyOS
sudo pacman -S libva-mesa-driver mesa-vdpau
# Verify
vainfo
Intel GPU Acceleration
Intel VAAPI
Intel GPUs use VAAPI for acceleration.
Install:
# Arch/CachyOS
sudo pacman -S libva-intel-driver intel-media-driver
# Verify
vainfo
Video Player Configuration
MPV
Configure MPV:
# Edit MPV config
vim ~/.config/mpv/mpv.conf
Add:
# Hardware acceleration
hwdec=auto
vo=gpu
gpu-context=wayland
VLC
VLC usually detects hardware acceleration automatically.
Check:
Tools > Preferences > Input/Codecs > Hardware-accelerated decoding
Browser Acceleration
Chrome/Chromium
Enable hardware acceleration:
# Usually enabled by default
# Check: chrome://gpu
Firefox
Enable hardware acceleration:
Preferences > General > Performance
Enable: Use recommended performance settings
Troubleshooting
Hardware Acceleration Not Working
Check drivers:
# Check VAAPI
vainfo
# Check VDPAU
vdpauinfo
# Check GPU
lspci | grep VGA
Video Playback Issues
Check codecs:
# Check VAAPI codecs
vainfo --display drm --codecs
# Check VDPAU
vdpauinfo
Summary
This guide covered hardware acceleration for Arch Linux, CachyOS, and other distributions, including VAAPI, VDPAU, GPU acceleration, and video player configuration.
Next Steps
- Graphics Drivers - GPU setup
- Multimedia - Media playback
- CachyOS Hardware Acceleration - CachyOS details
- ArchWiki Hardware Acceleration: https://wiki.archlinux.org/title/Hardware_video_acceleration
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.