PCI & PCI-e passthrough

grindcore

New Member
Aug 8, 2016
1
1
1
35
Hello friends!
I'm non subscriptions user!

I'm trying to connect the pci & pci-e device to the virtual machine.
1 - PCI card
& 3 PCI-e cards

But in my VM I am watching only 3 cards.
When you try to add a fourth card - I get the error:
Code:
kvm: -device vfio-pci,host=03:00.0,id=hostpci2,bus=pci.0,addr=0x1b: vfio: Error: Failed to setup INTx fd: Device or resource busy
kvm: -device vfio-pci,host=03:00.0,id=hostpci2,bus=pci.0,addr=0x1b: Device initialization failed
TASK ERROR: start failed: command '/usr/bin/kvm -id 100 -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=de39ae3f-6dc9-4c4c-a37d-651abeb88982' -name vm-developers-151 -smp '2,sockets=1,cores=2,maxcpus=2' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000' -vga std -vnc unix:/var/run/qemu-server/100.vnc,x509,password -no-hpet -cpu 'kvm64,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_reset,hv_vpindex,hv_runtime,hv_relaxed,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce' -m 4096 -k en-us -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' -device 'vfio-pci,host=06:01.0,id=hostpci0,bus=pci.0,addr=0x10' -device 'vfio-pci,host=02:00.0,id=hostpci1,bus=pci.0,addr=0x11' -device 'vfio-pci,host=03:00.0,id=hostpci2,bus=pci.0,addr=0x1b' -device 'vfio-pci,host=08:00.0,id=hostpci3,bus=pci.0,addr=0x1c' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:4abaa0bb2d3a' -drive 'file=/dev/pve/vm-100-disk-1,if=none,id=drive-ide0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100' -drive 'if=none,id=drive-ide2,media=cdrom,aio=threads' -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' -device 'virtio-net-pci,mac=3E:04:D6:0B:F9:CB,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' -rtc 'driftfix=slew,base=localtime' -global 'kvm-pit.lost_tick_policy=discard'' failed: exit code 1

My system information:
Code:
root@pve-mdltr:~# pveversion -V
proxmox-ve: 4.2-58 (running kernel: 4.4.13-2-pve)
pve-manager: 4.2-17 (running version: 4.2-17/e1400248)
pve-kernel-4.4.6-1-pve: 4.4.6-48
pve-kernel-4.4.13-2-pve: 4.4.13-58
lvm2: 2.02.116-pve2
corosync-pve: 2.4.0-1
libqb0: 1.0-1
pve-cluster: 4.0-43
qemu-server: 4.0-85
pve-firmware: 1.1-8
libpve-common-perl: 4.0-71
libpve-access-control: 4.0-18
libpve-storage-perl: 4.0-56
pve-libspice-server1: 0.12.8-1
vncterm: 1.2-1
pve-qemu-kvm: 2.6-1
pve-container: 1.0-71
pve-firewall: 2.0-29
pve-ha-manager: 1.0-33
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u2
lxc-pve: 1.1.5-7
lxcfs: 2.0.0-pve2
cgmanager: 0.39-pve1
criu: 1.6.0-1
zfsutils: 0.6.5.7-pve10~bpo80

VM's config (WORKING):
Code:
root@pve-mdltr:~# cat /etc/pve/qemu-server/100.conf
bootdisk: ide0
cores: 2
hostpci0: 06:01.0
hostpci1: 02:00
#hostpci2: 03:00
hostpci3: 08:00

ide0: local-lvm:vm-100-disk-1,size=150G
ide2: none,media=cdrom
memory: 4096
name: vm-developers-151
net0: virtio=3E:04:D6:0B:F9:CB,bridge=vmbr0
numa: 0
ostype: win7
smbios1: uuid=de39ae3f-6dc9-4c4c-a37d-651abeb88982
sockets: 1

If I'm uncommented
Code:
#hostpci2: 03:00
, then immediately I get an error when you start a virtual machine

VT-d support is ENABLE in BIOS

GRUB settings
Code:
....
GRUB_DISTRIBUTOR="Proxmox Virtual Environment"
GRUB_CMDLINE_LINUX_DEFAULT="quiet max_loop=64 vfio-pci.ids=1a0e:083b,1a0e:083f,1a0e:0870,10b5:9056 intel_iommu=on allow_unsafe_interrupts=1"
GRUB_CMDLINE_LINUX=""
......
I tried to change these parameters - the result is the same

Maybe there is some limit on the number of connected cards?
I would be grateful for your help. Maybe there are some links?
 
  • Like
Reactions: admoin