CachyOS Hardware Acceleration - ryzendew/Linux-Tips-and-Tricks GitHub Wiki

CachyOS Hardware Acceleration Guide

Complete beginner-friendly guide to hardware acceleration on CachyOS, including VAAPI, VDPAU, and GPU acceleration for video playback and encoding.


Table of Contents

  1. Understanding Hardware Acceleration
  2. VAAPI (Video Acceleration API)
  3. VDPAU (Video Decode and Presentation API)
  4. NVIDIA GPU Acceleration
  5. AMD GPU Acceleration
  6. Intel GPU Acceleration
  7. Browser Hardware Acceleration
  8. Video Player Configuration
  9. 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

Without hardware acceleration:

  • CPU does all the work (slower)
  • Higher CPU usage (system may lag)
  • Videos may stutter or lag
  • Video encoding is very slow
  • Battery drains faster (on laptops)

With hardware acceleration:

  • GPU handles graphics tasks (faster)
  • Lower CPU usage (system stays responsive)
  • Smooth video playback
  • Fast video encoding
  • Better battery life

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 (Video Acceleration API)

What is VAAPI?

VAAPI (Video Acceleration API) is an open standard for hardware-accelerated video processing.

What it does:

  • Video decoding: Uses GPU to decode videos (playback)
  • Video encoding: Uses GPU to encode videos (conversion)
  • Post-processing: Video effects and filters
  • Scaling: Resizing videos

Supported GPUs:

  • Intel: Most Intel integrated graphics
  • AMD: Most AMD GPUs (Radeon)
  • NVIDIA: Limited support (use VDPAU instead)

Installing VAAPI

For Intel GPUs

Install Intel VAAPI drivers:

sudo pacman -S libva-intel-driver

What this does:

  • Installs Intel VAAPI driver
  • Enables hardware acceleration for Intel GPUs
  • Required for Intel graphics acceleration

For newer Intel GPUs (Gen 8+):

sudo pacman -S intel-media-driver

What this does:

  • Modern Intel GPU driver
  • Better performance for newer Intel GPUs
  • Replaces older libva-intel-driver

For AMD GPUs

Install AMD VAAPI drivers:

sudo pacman -S libva-mesa-driver

What this does:

  • Installs AMD VAAPI driver (via Mesa)
  • Enables hardware acceleration for AMD GPUs
  • Works with most AMD Radeon GPUs

Verify installation:

vainfo

What this does:

  • Shows VAAPI capabilities
  • Lists supported codecs
  • Verifies driver is working

Example output:

libva info: VA-API version 1.20.0
libva info: User wants driver 'radeonsi'
libva info: Trying to open /usr/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 24.0.0 for AMD Radeon RX 6600
vainfo: Supported profile and entrypoints
      VAProfileH264Main           : VAEntrypointVLD
      VAProfileH264High           : VAEntrypointVLD
      ...

What this tells you:

  • VAAPI is working
  • Driver is loaded correctly
  • Supported codecs are listed
  • Hardware acceleration is available

Using VAAPI

Most applications automatically use VAAPI if available.

To force VAAPI in applications:

  • Set environment variables
  • Configure application settings
  • Use VAAPI-enabled applications

Environment variables:

export LIBVA_DRIVER_NAME=radeonsi  # For AMD
export LIBVA_DRIVER_NAME=i965       # For Intel (older)
export LIBVA_DRIVER_NAME=iHD        # For Intel (newer)

Add to shell configuration:

# Add to ~/.bashrc or ~/.zshrc
echo 'export LIBVA_DRIVER_NAME=radeonsi' >> ~/.bashrc
source ~/.bashrc

VDPAU (Video Decode and Presentation API)

What is VDPAU?

VDPAU (Video Decode and Presentation API) is NVIDIA's video acceleration API.

What it does:

  • Video decoding: Uses NVIDIA GPU to decode videos
  • Video presentation: Displays decoded video
  • Post-processing: Video effects and filters

Supported GPUs:

  • NVIDIA: Most NVIDIA GPUs (GeForce, Quadro, etc.)
  • Not supported: Intel, AMD (use VAAPI instead)

Installing VDPAU

Install NVIDIA VDPAU driver:

sudo pacman -S libvdpau

What this does:

  • Installs VDPAU library
  • Provides VDPAU API
  • Required for NVIDIA video acceleration

NVIDIA drivers include VDPAU:

  • If you have NVIDIA drivers installed, VDPAU is usually available
  • Verify with: vdpauinfo

Verify installation:

vdpauinfo

What this does:

  • Shows VDPAU capabilities
  • Lists supported codecs
  • Verifies driver is working

Example output:

display: :0   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  535.183.01  ...

Video surface:

name   width height types
-------------------------------------------
420    16384 16384  NV12 YV12
422    16384 16384  UYVY YUYV
...

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          ---  8192  8192  8192
MPEG2_SIMPLE                      ---  8192  8192  8192
MPEG2_MAIN                       ---  8192  8192  8192
...

What this tells you:

  • VDPAU is working
  • NVIDIA driver is loaded
  • Supported codecs are listed
  • Hardware acceleration is available

Using VDPAU

Most applications automatically use VDPAU if available.

To force VDPAU in applications:

  • Set environment variables
  • Configure application settings
  • Use VDPAU-enabled applications

Environment variables:

export VDPAU_DRIVER=nvidia

Add to shell configuration:

# Add to ~/.bashrc or ~/.zshrc
echo 'export VDPAU_DRIVER=nvidia' >> ~/.bashrc
source ~/.bashrc

NVIDIA GPU Acceleration

NVIDIA Hardware Acceleration

NVIDIA GPUs support multiple acceleration methods:

  1. VDPAU: Video decoding (older method)
  2. NVDEC: Modern video decoding
  3. NVENC: Video encoding

Installing NVIDIA Drivers

Use chwd (recommended):

sudo chwd -h -a nvidia

What this does:

  • Detects NVIDIA GPU
  • Installs appropriate drivers
  • Configures system automatically

Manual installation:

sudo pacman -S nvidia nvidia-utils nvidia-settings

What this does:

  • nvidia: NVIDIA kernel driver
  • nvidia-utils: NVIDIA utilities
  • nvidia-settings: Configuration tool

Verifying NVIDIA Acceleration

Check NVIDIA GPU:

nvidia-smi

Check VDPAU:

vdpauinfo

Check NVENC/NVDEC:

nvidia-smi --query-gpu=encoder.stats.sessionCount --format=csv

What this does:

  • Shows if NVENC is being used
  • Displays encoding session count
  • Verifies hardware encoding is active

Using NVIDIA Acceleration

For video playback:

  • Most players automatically use NVIDIA acceleration
  • VLC, mpv, etc. support NVIDIA acceleration

For video encoding:

  • Use applications that support NVENC
  • FFmpeg with NVENC support
  • OBS Studio for streaming/recording

AMD GPU Acceleration

AMD Hardware Acceleration

AMD GPUs use VAAPI for hardware acceleration.

Supported features:

  • Video decoding: H.264, H.265/HEVC, VP9, AV1
  • Video encoding: H.264, H.265/HEVC (on newer GPUs)
  • Post-processing: Video effects and filters

Installing AMD Drivers

AMD drivers are usually included:

  • Mesa (open-source driver) includes VAAPI support
  • Usually works out of the box

Install Mesa VAAPI driver:

sudo pacman -S libva-mesa-driver

Verify installation:

vainfo

Check GPU:

lspci | grep -i vga
glxinfo | grep "OpenGL renderer"

Using AMD Acceleration

Most applications automatically use AMD acceleration if available.

For video playback:

  • VLC, mpv, etc. support AMD VAAPI
  • Usually works automatically

For video encoding:

  • Newer AMD GPUs support hardware encoding
  • Use applications with AMD VCE/VCN support

Intel GPU Acceleration

Intel Hardware Acceleration

Intel GPUs use VAAPI for hardware acceleration.

Supported features:

  • Video decoding: H.264, H.265/HEVC, VP9, AV1
  • Video encoding: H.264, H.265/HEVC (on newer GPUs)
  • Post-processing: Video effects and filters

Installing Intel Drivers

For older Intel GPUs (Gen 7 and earlier):

sudo pacman -S libva-intel-driver

For newer Intel GPUs (Gen 8+):

sudo pacman -S intel-media-driver

What this does:

  • Installs Intel VAAPI driver
  • Enables hardware acceleration
  • Better performance on newer GPUs

Verify installation:

vainfo

Check GPU:

lspci | grep -i vga
glxinfo | grep "OpenGL renderer"

Using Intel Acceleration

Most applications automatically use Intel acceleration if available.

For video playback:

  • VLC, mpv, etc. support Intel VAAPI
  • Usually works automatically

For video encoding:

  • Newer Intel GPUs support Quick Sync encoding
  • Use applications with Intel Quick Sync support

Browser Hardware Acceleration

Enabling Browser Acceleration

Most browsers support hardware acceleration.

Firefox

Enable hardware acceleration:

  1. Open Firefox
  2. Go to about:preferences
  3. Search for "performance"
  4. Check "Use recommended performance settings"
  5. Or uncheck and enable "Use hardware acceleration when available"

Verify acceleration:

  1. Go to about:support
  2. Look for "Graphics" section
  3. Check "Compositing" (should show "WebRender" or "OpenGL")
  4. Check "GPU Accelerated Windows" (should be enabled)

Force enable (if needed):

  1. Go to about:config
  2. Search for layers.acceleration.force-enabled
  3. Set to true

Chromium/Chrome

Enable hardware acceleration:

  1. Open browser
  2. Go to chrome://settings/system (or chromium://settings/system)
  3. Enable "Use hardware acceleration when available"

Verify acceleration:

  1. Go to chrome://gpu (or chromium://gpu)
  2. Check "Graphics Feature Status"
  3. Most items should show "Hardware accelerated"

Force enable (if needed):

  • Add to command line: --enable-gpu-rasterization
  • Add to command line: --enable-accelerated-video-decode

Brave Browser

Same as Chromium:

  • Uses Chromium engine
  • Same settings and verification

Video Player Configuration

VLC Media Player

Enable hardware acceleration:

  1. Open VLC
  2. Go to ToolsPreferences
  3. Click Show All (bottom left)
  4. Go to Input/CodecsHardware-accelerated decoding
  5. Select your GPU:
  • VAAPI for Intel/AMD
  • VDPAU for NVIDIA
  • Automatic (let VLC choose)

Verify acceleration:

  1. Play a video
  2. Go to ToolsCodec Information
  3. Check "Codec" section
  4. Should show hardware decoder if working

mpv Media Player

Enable hardware acceleration:

Create/edit config file:

nano ~/.config/mpv/mpv.conf

Add for Intel/AMD (VAAPI):

hwdec=vaapi

Add for NVIDIA (VDPAU):

hwdec=vdpau

Add for NVIDIA (NVDEC):

hwdec=nvdec

Verify acceleration:

  • Play a video
  • Press i to show info
  • Check for hardware decoder

FFplay/FFmpeg

Use hardware decoding:

# VAAPI (Intel/AMD)
ffplay -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 video.mp4

# VDPAU (NVIDIA)
ffplay -hwaccel vdpau video.mp4

# NVDEC (NVIDIA, newer)
ffplay -hwaccel nvdec video.mp4

What this does:

  • -hwaccel: Enable hardware acceleration
  • -hwaccel_device: Specify GPU device
  • Uses GPU for video decoding

Troubleshooting

Hardware Acceleration Not Working

Check if drivers are installed:

# Check VAAPI
vainfo

# Check VDPAU
vdpauinfo

# Check GPU
lspci | grep -i vga

Check if GPU is detected:

# Intel/AMD
glxinfo | grep "OpenGL renderer"

# NVIDIA
nvidia-smi

Check environment variables:

echo $LIBVA_DRIVER_NAME
echo $VDPAU_DRIVER

Common issues:

Issue: "No VA display found"

  • Solution: Install correct VAAPI driver
  • For Intel: sudo pacman -S intel-media-driver
  • For AMD: sudo pacman -S libva-mesa-driver

Issue: "VDPAU driver not found"

  • Solution: Install NVIDIA drivers
  • Command: sudo chwd -h -a nvidia

Issue: "Hardware acceleration disabled"

  • Solution: Enable in application settings
  • Check: Browser/player settings

Performance Issues

Videos still stuttering:

  • Check if hardware acceleration is actually being used
  • Verify GPU is being utilized
  • Check CPU usage (should be lower with acceleration)

High CPU usage:

  • Hardware acceleration may not be working
  • Check driver installation
  • Verify application is using acceleration

Black screen or artifacts:

  • Driver issue
  • Try different driver version
  • Check GPU compatibility

Additional Resources


Summary

This guide covered:

  1. Understanding hardware acceleration - What it is and why it matters
  2. VAAPI - Video acceleration for Intel and AMD GPUs
  3. VDPAU - Video acceleration for NVIDIA GPUs
  4. NVIDIA acceleration - NVDEC, NVENC, VDPAU
  5. AMD acceleration - VAAPI for Radeon GPUs
  6. Intel acceleration - VAAPI for Intel graphics
  7. Browser acceleration - Enabling in Firefox, Chromium, Brave
  8. Video player configuration - VLC, mpv, FFmpeg
  9. Troubleshooting - Common issues and solutions

Key Takeaways:

  • Hardware acceleration improves performance significantly
  • VAAPI for Intel/AMD, VDPAU for NVIDIA
  • Most applications use acceleration automatically
  • Verify acceleration is working with vainfo or vdpauinfo
  • Enable in browser and video player settings
  • Troubleshoot driver issues if acceleration doesn't work

This guide is based on the CachyOS Wiki and Arch Linux Wiki and expanded with detailed explanations for beginners. For the most up-to-date hardware acceleration information, always refer to the official documentation.