VFIO script and Permission Denied.

I am new to Linux let alone Manjaro, but I've been scratching my head at this one after looking around a fair bit.

Been following this guide for GPU passthrough: https://thereisnospoon.ews-network.net/posts/manjaro-win10-gpu-passthrough/

Created a brand new installation of Manjaro and then got to it. I have identical GPUs (RX 580's) so I got to play with all that; figured out the card I want to pass through has its own IOMMU group and could be listed as 0000:09:00.0 and 0000:09:00.1 for its audio respectively.

So after going through the brief steps in the guide above, on reboot, I can't get past the boot screen with the error:

sh /usr/bin/vfio-pci-override.sh Permission Denied

I had already assumed it was a permission issue since some threads here mention .sh file and permission problems, so I went into a Live USB, manjaro-chroot -a'd my inaccessible Manjaro install, and then chmod 777'd the script in question (I'd make it reasonable after I ascertained it worked)-- ls -l'd it, all looks good.

Rebooted.

Permission still denied. I even tried chown'ing it so my user and group owned it and it still gave the same error.

IOMMU and virtualization are all enabled, this seems to be the last step to getting this setup functional but I'm not certain where to go from here. I'd appreciate any advice.

Contents of the .sh in case that's showing a red flag I'm not privy to:

#!/bin/sh

DEVS="0000:09:00.0 0000:09:00.1"

if [ ! -z "$(ls -A /sys/class/iommu)" ]; then
for DEV in $DEVS; do
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
done
fi
modprobe -i vfio-pci

itt Fresh Manjaro XFCE install (with all pertinent updates ran), above guide are only changes made. Script permission error despite seemingly having permissions.

AMD Ryzen 5 3600, two RX 580's, motherboard (with latest bios) b450m ds3h wi-fi. amd-iommu=on and iommu=pt as boot arguments, working prior to above changes. Relevant virtualization items (svm and IOMMU) enabled in bios.

Thanks again.

Your best bet would be to ask the author of that guide for support.

Copy that. Yeah, I e-mail'd the blog's contact but of course, your guess as good as mine on if that'll get a response.

Tried the Arch Linux wiki's passthrough guide among others, this just seemed to be a recently updated one actually specifying Manjaro.

That said it is 5 months old so it's entirely possible something's changed reference-wise between then and now.

1 Like

Fixed it.

In case anyone has the same problem:

That guide was mostly correct, but their variant of that script no matter how I modified it wasn't playing friendly with the identical GPUs and I imagine having permission issues even accessing the correct boot_vga card.

The other Arch Linux wiki script-

#!/bin/sh

for i in /sys/devices/pci*///boot_vga; do
if [ $(cat "$i") -eq 0 ]; then
GPU="${i%/boot_vga}"
AUDIO="$(echo "$GPU" | sed -e "s/0$/1/")"
echo "vfio-pci" > "$GPU/driver_override"
if [ -d "$AUDIO" ]; then
echo "vfio-pci" > "$AUDIO/driver_override"
fi
fi
done

modprobe -i vfio-pci

..coupled with getting linux-vfio 5.5.8.arch1-1 installed and appending this to my boot:

pcie_acs_override=downstream,multifunction

And then manually shutting down the now properly IOMMU group isolated second card:

sudo virsh nodedev-detach pci_0000_05_00_0
sudo virsh nodedev-detach pci_0000_05_00_1

..allowed the vfio driver to take and my VM to grab it.

I imagine I can run that at startup trivially.

2 Likes

Thank you so much, it's crazy how I ran into the same issue today and a few hours later a solution presents itself. And the funny part is that I'm using arch

1 Like

Just tried it out on my system and it works. Thanks again. To everyone reading make sure your rebuild your initramfs (mkinitcpio -p linux-vfio) after installing the vfio kernel and set the perms on the override script to 777

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by