GPU passthrough issue: Device is already attached

proxwolfe

Well-Known Member
Jun 20, 2020
502
53
48
49
Hi,

I am trying to passthrough my GPU to a VM and followed this guide: https://pve.proxmox.com/wiki/Pci_passthrough

But it seems that somehow I am not able to reserve the GPU for use in the VM.

Did this
echo "options vfio-pci ids=1002:6808,1002:aab0" > /etc/modprobe.d/vfio.conf​
and when this did not help in a later try I also added "vfio-pci.ids=1002:6808,1002:aab0" to the kernel command line in the grub config
And I did this:
echo "blacklist radeon" >> /etc/modprobe.d/blacklist.conf​
and when this didn't work, in a later try I also blacklisted "amdgpu"

I also updated initramfs and rebooted.

lspci -nnk tells me that for both the graphics subsystem and the sound subsystem the kernel driver in use is vfio-pci

So I think it should be good to go but I keep getting this:
kvm: -device vfio-pci,host=0000:04:00.0,id=hostpci1.0,bus=ich9-pcie-port-2,addr=0x0.0,multifunction=on: vfio 0000:04:00.0: device is already attached​
TASK ERROR: start failed: QEMU exited with code 1​
(04:00 is the right PCI slot)

What am I missing?

(Additional info, in case this is relevant for the error: My system has a Xeon E5, so it supports ACS and the card is in its own iommu group.

The only thing that looks a bit off is:

To identify if your system has support for interrupt remapping:​
dmesg | grep 'remapping'​
If you see one of the following lines:​
  • "AMD-Vi: Interrupt remapping enabled"
    • "DMAR-IR: Enabled IRQ remapping in x2apic mode" ('x2apic' can be different on old CPUs, but should still work)
then remapping is supported.​
But I get:
DMAR-IR: Enabled IRQ remapping in xapic mode​
x2apic: IRQ remapping doesn't support X2APIC mode​
So this is not exactly what the guide describes but it would seem to be still in line with the expectation?)
 
Aarrghhh!

I had added both subsystems of my card to the VM (because I want graphics and sound) but I had ticked the "all functions" box both times. So each entry added both subsystems and when the qemu tried to work through the second passthrough entry it found that the card was already attached (to the same VM). Deleting one of the PCI passthrough entries resolved the issue.
 
had added both subsystems of my card to the VM (because I want graphics and sound) but I had ticked the "all functions" box both times. So each entry added both subsystems and when the qemu tried to work through the second passthrough entry it found that the card was already attached (to the same VM). Deleting one of the PCI passthrough entries resolved the issue.
Thank You! I have been struggling with this for about 30 minutes when I came across this post. Fixed me right up. Appreciate you putting your solution in here.
 
Aarrghhh!

I had added both subsystems of my card to the VM (because I want graphics and sound) but I had ticked the "all functions" box both times. So each entry added both subsystems and when the qemu tried to work through the second passthrough entry it found that the card was already attached (to the same VM). Deleting one of the PCI passthrough entries resolved the issue.
I signed up to the forum just to say thank you. I spent a good hour struggling with this.
 
  • Like
Reactions: leesteken
Aarrghhh!

I had added both subsystems of my card to the VM (because I want graphics and sound) but I had ticked the "all functions" box both times. So each entry added both subsystems and when the qemu tried to work through the second passthrough entry it found that the card was already attached (to the same VM). Deleting one of the PCI passthrough entries resolved the issue.
Thank you so much for this observation, I can finally confirm successful GPU passthrough!
 
Thank you! I followed 2 different passthrough guides and none of them were working because of this error. I was starting to go crazy before I found your post.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!