From 0db62afe6522f470b2d849b2e7aaa5195d1c867f Mon Sep 17 00:00:00 2001 From: HikariKnight <2557889+HikariKnight@users.noreply.github.com> Date: Mon, 28 Feb 2022 21:37:09 +0100 Subject: [PATCH] added vfio-verify script and updated the last script page with more info --- lib/set_CMDLINE.sh | 3 +++ vfio-verify | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 vfio-verify diff --git a/lib/set_CMDLINE.sh b/lib/set_CMDLINE.sh index acea2e5..f69c0fc 100755 --- a/lib/set_CMDLINE.sh +++ b/lib/set_CMDLINE.sh @@ -22,6 +22,9 @@ $CMDLINE Make sure that the files inside \"$SCRIPTDIR/config/etc\" are copied to your /etc AND PLEASE MAKE A BACKUP FIRST! +Then reboot your system and run \"$SCRIPTDIR/vfio-verify\" to check if your GPU is properly set up. +NOTE: Some AMD GPUs will require the vendor-reset kernel module from https://github.com/gnif/vendor-reset to be installed! + The files inside \"$SCRIPTDIR/$QUICKEMU\" are currently unused files, however they provide the required information that the QuickEMU project can hook into and use to add support for VFIO enabled VMs. diff --git a/vfio-verify b/vfio-verify new file mode 100755 index 0000000..5ef8d92 --- /dev/null +++ b/vfio-verify @@ -0,0 +1,17 @@ +#!/bin/bash + +# Get the scripts directory +SCRIPTDIR=$(dirname `which $0`) +cd $SCRIPTDIR + +if [ -f $SCRIPTDIR/config/kernel_args ]; +then + DEVID=$(cat $SCRIPTDIR/config/kernel_args | cut -d " " -f 3 | cut -d "=" -f 2 | perl -pe "s/^([0-9a-f]{4}:).*/\1/") + echo "#------------------------------------------#" + lspci -d $DEVID -v | grep -iP "kernel driver|amd|radeon|nvidia|nouveau" | grep -vi "kernel modules" + echo "#------------------------------------------#" + + printf " +If the \"Kernel driver in use\" for these devices are \"vfio-pci\", then VFIO has been successfully enabled! +" +fi \ No newline at end of file