Hey guys. I have a PCIe SATA controller that I'm trying to pass through to a Debian VM on my Proxmox node. The machine is running on a Ryzen 7 3700X in an Asrock B450 Pro 4 motherboard that I have updated to the latest BIOS with 64GB of RAM. Proxmox is installed on a RAIDZ-2 consisting of four 250GB WD Blue SATA SSDs that are home to both the PVE and the VMs. Connected to the SATA controller I'm trying to pass through are two 6TB WD Red hard drives in a RAID0 which was created using Debian.
I added the following lines as required to /etc/modules:
Here are the results of
I don't know why it is two devices. It is only one PCIe SATA controller with two SATA ports on it. Maybe that's why?
I have IOMMU enabled in the BIOS, and I have added the appropriate line to grub config and verified that iommu is enabled.
I have the two devices added to the VM, and it was created as a q35 machine as are all indicated in the VM config:
One can also see that my PCIe card is not just in a separate group, but each part of it is in fact in its own separate group:
I created a file in /etc/modprobe.d and I also followed the directions in this forum thread that mentioned adding aliases to the /etc/modprobe.d/vfio.conf file/:
I blacklisted the driver:
I don't really know what the DRIVERNAME referenced in the directions is, so asmedia is just a guess. Also, the PCI(e) directions don't mention a filename for the blacklist, but the PCI directions name /etc/modpbrode.d/blacklist.conf. However, the file I found at /etc/modprobe.d/ was pve-blacklist.conf, so that's where I put my blacklist. Should it have been in blacklist.conf? I can't seem to get the asmedia device to list either vfio-pci driver or no driver at all in use.
The problem is that every time I try to run my VM, rpool encounters an uncorrectable I/O failure error and gets suspended, and the entire PVE crashes and has to be hard booted.
I cannot figure out what is wrong and I can't do anything else with my server until this card is passed through. Any help is greatly appreciated.
EDIT: I've since realized that I was looking at the wrong device groups before and my PCIe SATA card is in fact in group 0 with a whole lot of other things:
It appears that it shares a group with the rest of my pci bridges and the onboard LAN. I don't know how to fix this.
EDIT AGAIN: I managed to get ACS enabled in my BIOS. All it did was put them all in group 13 now, minus a few of the Starship/Matisse PCIe Dummy Host Bridge devices. I have an m.2 PCIe adapter. Would it be worth installing that and putting my PCIe SATA card in an m.2 slot?
I added the following lines as required to /etc/modules:
Code:
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
Here are the results of
lspci -nnk
as it pertains to the device in question:
Code:
04:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Controller [1b21:0612] (rev 02)
Subsystem: ASRock Incorporation Motherboard [1849:0612]
Kernel driver in use: ahci
Kernel modules: ahci
07:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Controller [1b21:0612] (rev 02)
Subsystem: ASRock Incorporation Motherboard [1849:0612]
Kernel driver in use: ahci
Kernel modules: ahci
I have IOMMU enabled in the BIOS, and I have added the appropriate line to grub config and verified that iommu is enabled.
Code:
# cat /etc/default/grub | grep iommu
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt"
Code:
# dmesg | grep -e DMAR -e IOMMU -e AMD-Vi
[ 1.190979] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[ 1.194154] pci 0000:00:00.2: AMD-Vi: Found IOMMU cap 0x40
[ 1.194154] pci 0000:00:00.2: AMD-Vi: Extended features (0x58f77ef22294a5a):
[ 1.194156] AMD-Vi: Interrupt remapping enabled
[ 1.194223] AMD-Vi: Lazy IO/TLB flushing enabled
[ 1.195100] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
I have the two devices added to the VM, and it was created as a q35 machine as are all indicated in the VM config:
Code:
hostpci0: 04:00.0,pcie=1
hostpci1: 07:00.0,pcie=1
machine: q35
Code:
# find /sys/kernel/iommu_groups/ -type l | grep groups/6
/sys/kernel/iommu_groups/6/devices/0000:00:07.1
# find /sys/kernel/iommu_groups/ -type l | grep groups/3
/sys/kernel/iommu_groups/3/devices/0000:00:04.0
I created a file in /etc/modprobe.d and I also followed the directions in this forum thread that mentioned adding aliases to the /etc/modprobe.d/vfio.conf file/:
Code:
# cat /etc/modprobe.d/vfio.conf
options vfio-pci ids=1b21:0612
alias pci:v00001B21d00000612sv00001849sd00000612bc01sc06i01 vfio-pci
alias pci:v00001B21d00000612sv00001849sd00000612bc01sc06i01 vfio-pci
I blacklisted the driver:
Code:
# cat /etc/modprobe.d/pve-blacklist.conf
# This file contains a list of modules which are not supported by Proxmox VE
# nidiafb see bugreport https://bugzilla.proxmox.com/show_bug.cgi?id=701
blacklist nvidiafb
blacklist asmedia
I don't really know what the DRIVERNAME referenced in the directions is, so asmedia is just a guess. Also, the PCI(e) directions don't mention a filename for the blacklist, but the PCI directions name /etc/modpbrode.d/blacklist.conf. However, the file I found at /etc/modprobe.d/ was pve-blacklist.conf, so that's where I put my blacklist. Should it have been in blacklist.conf? I can't seem to get the asmedia device to list either vfio-pci driver or no driver at all in use.
The problem is that every time I try to run my VM, rpool encounters an uncorrectable I/O failure error and gets suspended, and the entire PVE crashes and has to be hard booted.
I cannot figure out what is wrong and I can't do anything else with my server until this card is passed through. Any help is greatly appreciated.
EDIT: I've since realized that I was looking at the wrong device groups before and my PCIe SATA card is in fact in group 0 with a whole lot of other things:
Code:
# find /sys/kernel/iommu_groups/ -type l | grep groups/0
/sys/kernel/iommu_groups/0/devices/0000:02:07.0
/sys/kernel/iommu_groups/0/devices/0000:02:00.0
/sys/kernel/iommu_groups/0/devices/0000:00:01.0
/sys/kernel/iommu_groups/0/devices/0000:08:00.0
/sys/kernel/iommu_groups/0/devices/0000:01:00.2
/sys/kernel/iommu_groups/0/devices/0000:01:00.0
/sys/kernel/iommu_groups/0/devices/0000:02:06.0
/sys/kernel/iommu_groups/0/devices/0000:07:00.0
/sys/kernel/iommu_groups/0/devices/0000:00:01.3
/sys/kernel/iommu_groups/0/devices/0000:02:05.0
/sys/kernel/iommu_groups/0/devices/0000:01:00.1
/sys/kernel/iommu_groups/0/devices/0000:04:00.0
/sys/kernel/iommu_groups/0/devices/0000:02:01.0
/sys/kernel/iommu_groups/0/devices/0000:02:04.0
EDIT AGAIN: I managed to get ACS enabled in my BIOS. All it did was put them all in group 13 now, minus a few of the Starship/Matisse PCIe Dummy Host Bridge devices. I have an m.2 PCIe adapter. Would it be worth installing that and putting my PCIe SATA card in an m.2 slot?
Last edited: