#!/bin/bash # # Purpose : Install the Vulkan driver for each Intel or AMD GPU in the machine, # and Intel's video decoding driver (VA-API), so video and calls # don't decode on the CPU. AMD's comes with mesa, NVIDIA's with its # driver (see nvidia.sh). set -e source "$HOME/.local/share/coredesktop/utils.sh" # Read vendor IDs from sysfs: lspci needs pciutils and wakes suspended GPUs PACKAGES=() for device in /sys/bus/pci/devices/*; do [[ $(< "$device/class") == 0x03* ]] || continue case "$(< "$device/vendor")" in # intel-media-driver covers Broadwell (2014) and newer 0x8086) PACKAGES+=(vulkan-intel intel-media-driver) ;; 0x1002) PACKAGES+=(vulkan-radeon) ;; esac done if (( ${#PACKAGES[@]} > 0 )); then mapfile -t PACKAGES < <(printf '%s\n' "${PACKAGES[@]}" | sort -u) install_packages "${PACKAGES[@]}" else echo "No Intel or AMD GPU found." fi