You are not logged in.

#1 2016-10-03 13:24:54

DocMAX2
Member
Registered: 2016-10-03
Posts: 6

NVIDIA PCI/VGA Passthrough not working as PRIMARY VGA

Hello,

as subject says it works as secondary if Intel GPU is enabled as primary.
But as primary with Intel GPU disabled it doesnt work. The monitor goes black.
No errors in dmesg.

Any ideas?

-DocMAX2

Offline

#2 2016-10-03 15:57:06

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: NVIDIA PCI/VGA Passthrough not working as PRIMARY VGA

Are you using a classic BIOS, UEFI with CSM or a pure UEFI system?
I'll assume the GPU ROM itself does support UEFI since it does work if it is the secondary GPU.

Other than that, since I do not know your specific configuration (you've pretty much not given any information at all...), the best I can do for you is describe my personal experiences on this issue.
Keep in mind that this has been a few nVidia driver versions ago as well as a libvirt version or 2.
1) Booting in non-UEFI mode locks the primary GPU out for use in pass-through scenario's.
2) Forwarding only works with the nouveau drivers on the host. (in my case the host does not even properly boot with the binary drivers if IOMMU is enabled)
3) Unbinding a GPU while it's being used by X/Gnome freezes the system (no crash or error, just frozen).
4) If exiting the VM causes the GPU to be re-bound to the host system and X/Gnome is running, the system freezes as well.

To ensure everything works fine regardless of which GPU I forward my system is set up as follows:
1) Pure-UEFI only (CSM disabled completely)
2) Nouveau driver instead of the binary drivers
3) Boot to multi-user.target instead of graphical.target
Now I can unbind any GPU on the host (be it primary or not), bind it to vfio-pci and start a VM with the GPU without problem.

Also, for reference, the Arch Wiki has a very nice page about this subject:
https://wiki.archlinux.org/index.php/PC … h_via_OVMF

Last edited by Omar007 (2016-10-03 16:00:17)

Offline

#3 2016-10-03 23:09:19

DocMAX2
Member
Registered: 2016-10-03
Posts: 6

Re: NVIDIA PCI/VGA Passthrough not working as PRIMARY VGA

I just switched from CSM to full UEFI. But still no effect.
My screens go off and stay black.

Its a Geforce GTX 970. What specs also do you need to know?

Offline

#4 2016-10-04 12:47:24

DocMAX
Member
Registered: 2016-09-16
Posts: 6

Re: NVIDIA PCI/VGA Passthrough not working as PRIMARY VGA

GOT IT WORKING! After 3 sleepless nights and days i found the problem.
KVM has a problem with the VIDEO ROM if running primary.
When running as secondary i was able to extract that ROM as a file (needs unbind from vfio-pci first).
Then, loading as primary again with x-vga=on,romfile=/bios.rom, VGA passthrough works in every way (UEFI or CSM).

Offline

#5 2016-10-05 19:31:34

DocMAX2
Member
Registered: 2016-10-03
Posts: 6

Re: NVIDIA PCI/VGA Passthrough not working as PRIMARY VGA

...but my new problem is Error 43. cant get rid of it

Offline

#6 2016-10-12 18:51:11

DocMAX
Member
Registered: 2016-09-16
Posts: 6

Re: NVIDIA PCI/VGA Passthrough not working as PRIMARY VGA

Just wanted to add:

I still had issues with error 43.
That was caused because of a "corruped" video bios caused by module efifb.
Unbind it and boom! everything works!

Last question is: is it possible, AFTER i shutdown the guest to come back to linux?
Loading efifb and nvidia driver doesnt work.
Screen stays black!

DocMAX

Offline

Board footer

Powered by FluxBB