Skip to content

Instantly share code, notes, and snippets.

@DDoSolitary
Last active February 19, 2022 02:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DDoSolitary/ce7a005f9a139e0547484508a78259f7 to your computer and use it in GitHub Desktop.
Save DDoSolitary/ce7a005f9a139e0547484508a78259f7 to your computer and use it in GitHub Desktop.
Automatically configure hardware acceleration on Arch Linux.
#!/bin/bash
unset LIBVA_DRIVER_NAME VDPAU_DRIVER DRI_PRIME
if lspci -k | grep -q -e amdgpu -e radeon; then
export LIBVA_DRIVER_NAME=radeonsi
export VDPAU_DRIVER=radeonsi
elif lspci -k | grep -q nouveau; then
export LIBVA_DRIVER_NAME=nouveau
export VDPAU_DRIVER=nouveau
fi
if lspci -k | grep -q i915; then
if [ -z "$LIBVA_DRIVER_NAME" ]; then
export LIBVA_DRIVER_NAME=i965
export VDPAU_DRIVER=va_gl
else
export DRI_PRIME=1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment