[SOLVED] GPU passthrough Windows 7 - Error Code 12

lckmt

New Member
Dec 5, 2018
8
0
1
Seperated Thread from https://forum.proxmox.com/threads/igd-passthrough-doesnt-work-after-upgrade.49411/

After Upgrade to newst Version passthrough is not working on windows 7 guests with hostpci
Windows 10 works.

Code:
 hostpci0: 1a:00.0,x-vga=on
is not working with Windows 7
I get always error Code 12 on GPU in Windows 7, it maybe conflicts with Redhat SMBus IRQ

Is it possible to configure q35 win7 machine?

Error on passthrough NVIDIA GTX 1070 with args command on newest version:
Code:
kvm: -device VGA,id=vga,bus=pcie.0,addr=0x1: PCI: slot 1 function 0 not available for VGA, in use by vfio-pci
Windows 7 runs on qemu-server <=5.0.38 and
Code:
-device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on -device vfio-pci,host=1a:00.1
Config and Version see below at the end.

differences on commandline
args loading before
Code:
-readconfig /usr/share/qemu-server/pve-q35.cfg
hostpci0: 1a:00.0,x-vga=on
Code:
...
  -k de \
  -readconfig /usr/share/qemu-server/pve-q35.cfg \
  -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \
  -device 'vfio-pci,host=1a:00.0,id=hostpci0.0,bus=ich9-pcie-port-1,addr=0x0.0,multifunction=on' \
  -device 'vfio-pci,host=1a:00.1,id=hostpci0.1,bus=ich9-pcie-port-1,addr=0x0.1' \
  -device 'usb-host,hostbus=1,hostport=9,id=usb0' \
  -device 'usb-host,hostbus=1,hostport=10,id=usb1' \
...

args: -device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on -device vfio-pci,host=1a:00.1
Code:
...
  -k de \
  -vnc 0.0.0.0:110 \
  -device 'vfio-pci,host=1a:00.0,multifunction=on,x-vga=on' \
  -device 'vfio-pci,host=1a:00.1' \
  -soundhw ac97 \
  -readconfig /usr/share/qemu-server/pve-q35.cfg \
  -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' \
  -device 'usb-host,hostbus=1,hostport=9,id=usb0' \
  -device 'usb-host,hostbus=1,hostport=10,id=usb1' \
  -device 'usb-host,hostbus=1,hostport=12,id=usb2' \
  -device 'VGA,id=vga,bus=pcie.0,addr=0x1' \
...

pveversion -v after update to newest Version
Code:
proxmox-ve: 5.3-1 (running kernel: 4.15.18-9-pve)
pve-manager: 5.3-5 (running version: 5.3-5/97ae681d)
pve-kernel-4.15: 5.2-12
pve-kernel-4.15.18-9-pve: 4.15.18-30
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-3
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-43
libpve-guest-common-perl: 2.0-18
libpve-http-server-perl: 2.0-11
libpve-storage-perl: 5.0-33
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.0.2+pve1-5
lxcfs: 3.0.2-2
novnc-pve: 1.0.0-2
proxmox-widget-toolkit: 1.0-22
pve-cluster: 5.0-31
pve-container: 2.0-31
pve-docs: 5.3-1
pve-edk2-firmware: 1.20181023-1
pve-firewall: 3.0-16
pve-firmware: 2.0-6
pve-ha-manager: 2.0-5
pve-i18n: 1.0-9
pve-libspice-server1: 0.14.1-1
pve-qemu-kvm: 2.12.1-1
pve-xtermjs: 1.0-5
qemu-server: 5.0-43
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.12-pve1~bpo1
Last working config before update
Code:
agent: 1
args: -vnc 0.0.0.0:110  -device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on -device vfio-pci,host=1a:00.1 -soundhw ac97
balloon: 0
bios: ovmf
boot: c
bootdisk: scsi2
cores: 14
cpu: kvm64,hidden=1
efidisk0: vmdata:vm-110-disk-0,size=128K
keyboard: de
machine: q35
memory: 16384
name: windows7
net0: virtio=A5:1F:68:F9:E8:43,bridge=vmbr0
numa: 0
onboot: 0
ostype: win7
scsi0: vmdata:vm-110-disk-1,cache=writeback,size=250G
scsi1: templates:iso/virtio-win-0.1.160.iso,media=cdrom,size=315276K
scsi2: vmdata:vm-110-disk-3,cache=writeback,size=1G
scsi3: /dev/disk/by-id/ata-WDC_WDxxx
scsi4: vmdata:vm-110-disk-4,cache=writeback,size=1T
scsi5: vmdata:vm-110-disk-5,cache=writeback,size=512G
scsihw: virtio-scsi-pci
smbios1: uuid=4d3789e0-1e19-492f-98a4-acd458e1a14b
sockets: 1
startup: order=9999
usb0: host=1-9
usb1: host=1-10
usb2: host=1-12
vga: std
Last working pveversion -v with args commandline
Code:
proxmox-ve: 5.2-3 (running kernel: 4.15.18-9-pve)
pve-manager: 5.2-12 (running version: 5.2-12/ba196e4b)
pve-kernel-4.15: 5.2-12
pve-kernel-4.15.18-9-pve: 4.15.18-30
corosync: 2.4.4-pve1
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.1-2
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-42
libpve-guest-common-perl: 2.0-18
libpve-http-server-perl: 2.0-11
libpve-storage-perl: 5.0-32
libqb0: 1.0.3-1~bpo9
lvm2: 2.02.168-pve6
lxc-pve: 3.0.2+pve1-5
lxcfs: 3.0.2-2
novnc-pve: 1.0.0-2
proxmox-widget-toolkit: 1.0-20
pve-cluster: 5.0-30
pve-container: 2.0-30
pve-docs: 5.2-10
pve-edk2-firmware: 1.20181023-1
pve-firewall: 3.0-14
pve-firmware: 2.0-6
pve-ha-manager: 2.0-5
pve-i18n: 1.0-6
pve-libspice-server1: 0.14.1-1
pve-qemu-kvm: 2.12.1-1
pve-xtermjs: 1.0-5
qemu-server: 5.0-38
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.12-pve1~bpo1
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
3,776
343
83
31
Vienna
args: -vnc 0.0.0.0:110 -device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on -device vfio-pci,host=1a:00.1 -soundhw ac97
instead of manually adding the pci devices, add
Code:
hostpci0: 1a:00,x-vga=on,pcie=1
and for the soundhw, you should give it a pci port manually : ,addr='

our pci address mapping is found under '/usr/share/perl5/PVE/QemuServer/PCI.pm'
justs choose an address which you dont use (e.g. the address for net5 => addr=0x17)

this should be fixed soon, when we add the args at the very end of the qemu commandline, then qemu chooses the first free port it has
https://bugzilla.proxmox.com/show_bug.cgi?id=1267
 

lckmt

New Member
Dec 5, 2018
8
0
1
Code:
   hostpci0: 1a:00,x-vga=on,pcie=1
this is not working, because of irq conflict with smbus

smbus irq = 10
vga irq = 10

on windows 10
smbus irq = 10
vga irq = 16


soundhw is not important for now



instead of manually adding the pci devices, add
Code:
hostpci0: 1a:00,x-vga=on,pcie=1
and for the soundhw, you should give it a pci port manually : ,addr='

our pci address mapping is found under '/usr/share/perl5/PVE/QemuServer/PCI.pm'
justs choose an address which you dont use (e.g. the address for net5 => addr=0x17)

this should be fixed soon, when we add the args at the very end of the qemu commandline, then qemu chooses the first free port it has
https://bugzilla.proxmox.com/show_bug.cgi?id=1267
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
3,776
343
83
31
Vienna
this is not working, because of irq conflict with smbus
did you actually try it ? afaics the error code 12 on windows 7 was only relevant for pcie devices on pci bridges, which is not the case when you specify 'pcie=1' on the hospci line
 

lckmt

New Member
Dec 5, 2018
8
0
1
i tried pcie and pci a lot of times both are not working, same result, code 12


did you actually try it ? afaics the error code 12 on windows 7 was only relevant for pcie devices on pci bridges, which is not the case when you specify 'pcie=1' on the hospci line
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
3,776
343
83
31
Vienna
ok yes, after looking at all configs/outputs again and finding this (https://forum.proxmox.com/threads/is-anybody-who-succeeded-gpu-passthrough-nvidia-with-windows-7.40815/#post-217887) thread
it seems that windows 7/2008 is particularly picky about the pcie port assignments

in your case i guess it would be enough to change your original config in the following way:

change this part in your args:
Code:
-device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on -device vfio-pci,host=1a:00.1
to

Code:
-device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on,bus=pcie.0,addr=0x10.0 -device vfio-pci,host=1a:00.1,bus=pcie.0,addr=0x10.1
i will see if i can send a fix so that we do the correct address assignment for that case (q35 win7/2008 and gpu passthrough)
 

lckmt

New Member
Dec 5, 2018
8
0
1
thx for your help, dcsapak.

gpu passthrough on windows 7 is running on proxmox-ve: 5.3-1, qemu-server: 5.0-43 and
Code:
-device vfio-pci,host=1a:00.0,multifunction=on,x-vga=on,bus=pcie.0,addr=0x10.0 -device vfio-pci,host=1a:00.1,bus=pcie.0,addr=0x10.1
is there a bug id for
... correct address assignment for that case (q35 win7/2008 and gpu passthrough)
?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!