more updates to work with the new ls-iommu

This commit is contained in:
HikariKnight 2023-03-11 19:26:19 +01:00
parent 158e937e6f
commit 692ca7f83a
No known key found for this signature in database
GPG key ID: E8B239063B022F5A
2 changed files with 2 additions and 5 deletions

View file

@ -7,7 +7,6 @@ function set_VFIO () {
# Assign the GPU device ids to a variable # Assign the GPU device ids to a variable
GPU_DEVID="$1" GPU_DEVID="$1"
echo $GPU_DEVID
# Get the kernel_args file content # Get the kernel_args file content
CMDLINE=$(cat "$SCRIPTDIR/config/kernel_args") CMDLINE=$(cat "$SCRIPTDIR/config/kernel_args")

View file

@ -9,15 +9,13 @@ cd "$SCRIPTDIR"
# should exist, which contains all the info we need # should exist, which contains all the info we need
if [ -f "$SCRIPTDIR/config/kernel_args" ]; if [ -f "$SCRIPTDIR/config/kernel_args" ];
then then
# Fetch part of the device id we need
DEVID=$(cat "$SCRIPTDIR/config/kernel_args" | cut -d " " -f 3 | cut -d "=" -f 2 | perl -pe "s/^([0-9a-f]{4}:).*/\1/")
echo "#------------------------------------------#" echo "#------------------------------------------#"
# List info about the vfio gpu and what kernel driver is being used # List info about the vfio gpu and what kernel driver is being used
lspci -d "$DEVID" -v | grep -iP "kernel driver|amd|radeon|nvidia|nouveau" | grep -vi "kernel modules" "$SCRIPTDIR/utils/ls-iommu" -g -r -k
echo "#------------------------------------------#" echo "#------------------------------------------#"
printf " printf "
If the \"Kernel driver in use\" for these devices are \"vfio-pci\", then VFIO has been successfully enabled! If the \"Kernel driver in use\" for the passed through devices are \"vfio-pci\", then VFIO has been successfully enabled!
NOTE: If your system freezes when starting a VM that uses your VFIO enabled card.. NOTE: If your system freezes when starting a VM that uses your VFIO enabled card..
consider adding the below line to your bootloaders kernel arguments: consider adding the below line to your bootloaders kernel arguments: