PCI pass through Nvidia

SpaceCowBoy

Member
Feb 13, 2016
51
0
11
39
EDIT: Bottom line I can passthrough GPU to Ubuntu but not Windows anyone know why??? I'm a poor college student but I can offer $10 via paypal to anyone who can help me fix this. :D


Original:
Hello. I'm a total newbie to proxmox so I'm sorry if this is obvious.

I followed this guide.
https://m.reddit.com/r/homelab/comments/2xmua3/i_did_something_weird_any_kvm_proxmox_pros_around/

I was able to setup proxmox with a Ubuntu guest and get PCI-Passthrough of my Nvidia GT 750 working no problem :)

So I deleted the Ubuntu guest and moved on to trying to get a Windows 7 guest working as gaming is the end goal for the PCI passsthrough.

I managed to install Windows fine. However after I edit the /etc/pve/qemuserver/win7.cfg

And add

machine: q35
hostpci0: 01:00,x-vga=on,pcie=1,driver=vfio

Then try to boot the Windows VM I get a no signal on my monitor. I am also unable to access the VM anymore from the console in the web interface.

So I can only assume that I must do something different to get PCI passsthrough working with Windows instead of Ubuntu? Some help would be awesome I've been at the googling for 3 days now :)

UPDATE:
I have tried also with Windows 10 in UEFI mode. Same issue. No signal to monitor. Loose console abilities.
 
Last edited:
Hey i'm using the 4.1 ISO. Are you saying there is a update I need on top of that to make it work?

yes, please do the last updates, because they are fixes for pci passthrough of vga cards.

Check the wiki to update the repository to nosubscription
https://pve.proxmox.com/wiki/Package_repositories

then
apt-get update
apt-get dist-upgrade

when update are done, I'll try to help you.
 
yes, please do the last updates, because they are fixes for pci passthrough of vga cards.

Check the wiki to update the repository to nosubscription
https://pve.proxmox.com/wiki/Package_repositories

then
apt-get update
apt-get dist-upgrade

when update are done, I'll try to help you.
So I added the nosubscription repo and did the update. rebooted. Same issue. Ubunu can pass through get all the way to the login screen. but not windows. When I start the windows vm the screen goes black no signal.
 
Ok,do you have an code 43 error somewhere in device logs ?

If yes, I'm trying to debug this on another proxmox forum post too :

can you try to edit:
/usr/share/perl5/PVE/QemuServer.pm

and change
Code:
if ($xvga && $xvga ne '') {
$kvm_off = 1;
$vga = 'none';
$nohyperv = 1;
if ($conf->{bios} && $conf->{bios} eq 'ovmf') {
$xvga = "";
}
}

to
Code:
if ($xvga && $xvga ne '') {
$kvm_off = 1;
$vga = 'none';
push @$cpuFlags , 'hv_vendor_id=Nvidia43FIX';
if ($conf->{bios} && $conf->{bios} eq 'ovmf') {
$xvga = "";
}
}


then restart

# /etc/init.d/pvedaemon restart

i
and start the vm again

(and send me the kvm command for verification)

(Also if your card has an uefi compatible bios, should you try to use "bios: ovmf" )
 
Not seeing any error in the web interface when starting the machine. When starting the machine I get "OK". Sorry how would I get the device logs you want?

I made the changes to /usr/share/perl5/PVE/QemuServer.pm still getting no signal.

Here are my two different VM conf i've tried. One a win7 and one a win10 Maybe i'm donig somthing wrong in there.

Code:
bootdisk: ide0                                                                                                                                
cores: 2                                                                                                                                      
ide0: local:101/vm-101-disk-1.qcow2,cache=writeback,size=300G                                                                                
ide2: local:iso/Win7.iso,media=cdrom                                                                                                          
memory: 4000                                                                                                                                  
name: Win7                                                                                                                                    
net0: e1000=66:36:33:63:61:34,bridge=vmbr0                                                                                                    
numa: 0                                                                                                                                      
ostype: win7                                                                                                                                  
smbios1: uuid=fd583fc7-bf9b-49c2-aca5-29167fb353be                                                                                            
sockets: 1                                                                                                                                    
machine: q35                                                                                                                                  
hostpci0: 01:00,x-vga=on,pcie=1,driver=vfio

Code:
bios: ovmf                                                                                                                                    
bootdisk: ide0                                                                                                                                
cores: 1                                                                                                                                      
ide0: local:102/vm-102-disk-1.qcow2,cache=writeback,size=200G                                                                                
ide2: local:iso/Win10.iso,media=cdrom                                                                                                        
memory: 4000                                                                                                                                  
name: Win10                                                                                                                                  
net0: e1000=3A:32:31:66:64:33,bridge=vmbr0                                                                                                    
numa: 0                                                                                                                                      
ostype: win8                                                                                                                                  
smbios1: uuid=ea2a30d9-9a6b-4f26-9038-b7d84a4b4c9a                                                                                            
sockets: 1                                                                                                                                    
args: -vnc 0.0.0.0:100                                                                                                                        
hostpci0: 01:00,x-vga=on


Here is the ubuntu VM. This is the one that works I get video and the desktop out of the card.
Code:
bootdisk: ide0                                                                                                                               
cores: 1                                                                                                                                     
ide0: local:100/vm-100-disk-1.qcow2,cache=writeback,size=32G                                                                                   
ide2: local:iso/ubuntu-14.04.3-desktop-amd64.iso,media=cdrom                                                                                 
memory: 1024                                                                                                                                 
name: UbuntuDesktop                                                                                                                           
net0: e1000=66:61:33:62:30:39,bridge=vmbr0                                                                                                   
numa: 0                                                                                                                                       
ostype: l26                                                                                                                                   
smbios1: uuid=047a36a8-9a7f-49eb-bd82-6ee7bdab8368                                                                                             
sockets: 1                                                                                                                                   
args: -vnc 0.0.0.0:100                                                                                                                       
machine: q35                                                                                                                                 
hostpci0: 01:00,x-vga=on,pcie=1,driver=vfio
 
you shouldn't use
"args: -vnc 0.0.0.0:100", because vga card should be primary to works fine.
If you don't have display with ovmf, they are chance that your card don't have a uefi compatible rom.

you can also try without ",pcie=1" and "machine:q35"

Also some users have seen vga card reset problem. (start vm work, shutdown vm, start vm again don't work).
This need a full proxmox node reboot.
 
you shouldn't use
"args: -vnc 0.0.0.0:100", because vga card should be primary to works fine.
If you don't have display with ovmf, they are chance that your card don't have a uefi compatible rom.

you can also try without ",pcie=1" and "machine:q35"

Also some users have seen vga card reset problem. (start vm work, shutdown vm, start vm again don't work).
This need a full proxmox node reboot.

Ok I removed the vnc. I was just using that to do the initial install of the vm.
removed pcie=1 and machine q35.
Still same problem.

I found somthing of note tho. If I double click the OK status I see

Code:
Unknown hostpci setting 'driver=vfio'

This happens on both the working ubuntu, and the not working win7.

rebooted the whole system. Cold boot still no response from win7 or win10 vm.
 
Code:
Unknown hostpci setting 'driver=vfio'
.
",driver=vfio" is not needed anymore in proxmox4 (check the wiki)
It's only a warning, but you can remove it

For windows, can you give me the kvm command line running on the host ?

(ps -aux| grep kvm|grep <vmid>)
 
I'm going to do some test with a geforce 970, I have a test platform.
I'll keep you in touch as soon as possible
Thanks so much for all the help :)

Win7 VM:
Code:
root@proxmox:~# ps -aux| grep kvm|grep 101
root      1930 94.6 20.0 5191076 4125160 ?     SLl  03:00   1:02 /usr/bin/kvm -id 101 -chardev socket,id=qmp,path=/var/run/qemu-server/101.qmp,server,nowait -mon chardev=qmp,mode=control -vnc unix:/var/run/qemu-server/101.vnc,x509,password -pidfile /var/run/qemu-server/101.pid -daemonize -smbios type=1,uuid=fd583fc7-bf9b-49c2-aca5-29167fb353be -name Win7 -smp 2,sockets=1,cores=2,maxcpus=2 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000 -vga none -no-hpet -cpu kvm64,hv_vendor_id=Nvidia43FIX,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_relaxed,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce,kvm=off -m 4000 -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=01:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,x-vga=on,multifunction=on -device vfio-pci,host=01:00.1,id=hostpci0.1,bus=pci.0,addr=0x10.1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-name=iqn.1993-08.org.debian:01:8e7ea2964e68 -drive file=/var/lib/vz/template/iso/Win7.iso,if=none,id=drive-ide2,media=cdrom,aio=threads -device ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200 -drive file=/var/lib/vz/images/101/vm-101-disk-1.qcow2,if=none,id=drive-ide0,cache=writeback,format=qcow2,aio=threads,detect-zeroes=on -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100 -netdev type=tap,id=net0,ifname=tap101i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown -device e1000,mac=66:36:33:63:61:34,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300 -rtc driftfix=slew,base=localtime -global kvm-pit.lost_tick_policy=discard


Win10 VM:
Code:
root@proxmox:~# ps -aux| grep kvm|grep 102
root      2109 80.7 20.0 4873624 4129992 ?     SLl  03:03   0:14 /usr/bin/kvm -id 102 -chardev socket,id=qmp,path=/var/run/qemu-server/102.qmp,server,nowait -mon chardev=qmp,mode=control -vnc unix:/var/run/qemu-server/102.vnc,x509,password -pidfile /var/run/qemu-server/102.pid -daemonize -smbios type=1,uuid=ea2a30d9-9a6b-4f26-9038-b7d84a4b4c9a -drive if=pflash,format=raw,readonly,file=/usr/share/kvm/OVMF-pure-efi.fd -drive if=pflash,format=raw,file=/tmp/102-OVMF_VARS-pure-efi.fd -name Win10 -smp 1,sockets=1,cores=1,maxcpus=1 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000 -vga none -no-hpet -cpu kvm64,hv_vendor_id=Nvidia43FIX,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_relaxed,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce,kvm=off -m 4000 -k en-us -vnc 0.0.0.0:100 -device pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f -device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e -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=01:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on -device vfio-pci,host=01:00.1,id=hostpci0.1,bus=pci.0,addr=0x10.1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-name=iqn.1993-08.org.debian:01:8e7ea2964e68 -drive file=/var/lib/vz/images/102/vm-102-disk-1.qcow2,if=none,id=drive-ide0,cache=writeback,format=qcow2,aio=threads,detect-zeroes=on -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100 -drive file=/var/lib/vz/template/iso/Win10.iso,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=tap102i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown -device e1000,mac=3A:32:31:66:64:33,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300 -rtc driftfix=slew,base=localtime -global kvm-pit.lost_tick_policy=discard
 
Hello. I have downloaded the deb and installed using the provided info. Still a black screen no signal.

Win7
Code:
root@proxmox:~# (ps -aux| grep kvm|grep 101)
root      1952 30.9 20.0 5209728 4120612 ?     SLl  10:12   1:18 /usr/bin/kvm -id 101 -chardev socket,id=qmp,path=/var/run/qemu-server/101.qmp,server,nowait -mon chardev=qmp,mode=control -pidfile /var/run/qemu-server/101.pid -daemonize -smbios type=1,uuid=fd583fc7-bf9b-49c2-aca5-29167fb353be -name Win7 -smp 2,sockets=1,cores=2,maxcpus=2 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000 -vga none -nographic -no-hpet -cpu kvm64,hv_vendor_id=Nvidia43FIX,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_relaxed,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce,kvm=off -m 4000 -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=01:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,x-vga=on,multifunction=on -device vfio-pci,host=01:00.1,id=hostpci0.1,bus=pci.0,addr=0x10.1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-name=iqn.1993-08.org.debian:01:8e7ea2964e68 -drive file=/var/lib/vz/images/101/vm-101-disk-1.qcow2,if=none,id=drive-ide0,cache=writeback,format=qcow2,aio=threads,detect-zeroes=on -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100 -drive file=/var/lib/vz/template/iso/Win7.iso,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=tap101i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown -device e1000,mac=66:36:33:63:61:34,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300 -rtc driftfix=slew,base=localtime -global kvm-pit.lost_tick_policy=discard

win10
Code:
root@proxmox:~# (ps -aux| grep kvm|grep 102)root      2047 76.5 20.0 4937336 4125496 ?     SLl  10:24   0:14 /usr/bin/kvm -id 102 -chardev socket,id=qmp,path=/var/run/qemu-server/102.qmp,server,nowait -mon chardev=qmp,mode=control -pidfile /var/run/qemu-server/102.pid -daemonize -smbios type=1,uuid=ea2a30d9-9a6b-4f26-9038-b7d84a4b4c9a -drive if=pflash,format=raw,readonly,file=/usr/share/kvm/OVMF-pure-efi.fd -drive if=pflash,format=raw,file=/tmp/102-OVMF_VARS-pure-efi.fd -name Win10 -smp 1,sockets=1,cores=1,maxcpus=1 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000 -vga none -nographic -no-hpet -cpu kvm64,hv_vendor_id=Nvidia43FIX,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_relaxed,+lahf_lm,+sep,+kvm_pv_unhalt,+kvm_pv_eoi,enforce,kvm=off -m 4000 -k en-us -device pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f -device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e -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=01:00.0,id=hostpci0.0,bus=pci.0,addr=0x10.0,multifunction=on -device vfio-pci,host=01:00.1,id=hostpci0.1,bus=pci.0,addr=0x10.1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-name=iqn.1993-08.org.debian:01:8e7ea2964e68 -drive file=/var/lib/vz/template/iso/Win10.iso,if=none,id=drive-ide2,media=cdrom,aio=threads -device ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200 -drive file=/var/lib/vz/images/102/vm-102-disk-1.qcow2,if=none,id=drive-ide0,cache=writeback,format=qcow2,aio=threads,detect-zeroes=on -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100 -netdev type=tap,id=net0,ifname=tap102i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown -device e1000,mac=3A:32:31:66:64:33,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300 -rtc driftfix=slew,base=localtime -global kvm-pit.lost_tick_policy=discard