stow_dotfiles/scripts/hows-my-gpu
Matthieu Fortin (CPC/CCP) 369ca7ed8e updated scripts
2024-10-29 08:47:50 -04:00

28 lines
872 B
Bash
Executable file

#!/bin/bash
#set -x
echo "Loaded Graphics Cards Kernel Drivers:"
nvidia_output=$(lspci -nnk | grep -A 3 -P '^(\d{4}:)?\d{2}:\d{2}\.\d\s+VGA compatible controller.*NVIDIA')
if [ ! -z "$nvidia_output" ]; then
echo "-------------------------------------"
echo "NVIDIA Graphics:"
echo "$nvidia_output" | grep "Kernel driver in use"
echo
fi
intel_output=$(lspci -nnk | grep -A 3 -P '^(\d{4}:)?\d{2}:\d{2}\.\d\s+VGA compatible controller.*Intel')
if [ ! -z "$intel_output"]; then
echo "-------------------------------------"
echo "Intel Graphics:"
echo "$intel_output" | grep "Kernel driver in use"
echo
fi
amd_output=$(lspci -nnk | grep -A 3 -P '^(\d{4}:)?\d{2}:\d{2}\.\d\s+VGA compatible controller.*AMD')
if [ ! -z "$amd_output"]; then
echo "-------------------------------------"
echo "AMD Graphics:"
echo "$amd_output" | grep "Kernel driver in use"
echo
fi