Hi,
I’d like to setup a VM via qemu/kvm/virt-manager and passing trough my GTX1070.
Long story short: I want to have a system running a windows 10 vm to run all games (and some CAD programs), instead of messing with proton or wine.
And go a step further by using some scripts to give the gpu back to the host so I could use it there. But that is optional. (something like this: https://www.youtube.com/watch?v=ssfvpLXK8po&t=208s)
My system specs are as follows:
- Palit GTX1070
- Intel i5 6500
- Asrock Z170 extreme4
- The rest is not important I assume.
According to the docs of arc.intel.com the CPU has VT-d capability.
In the docs of the motherboard it states also this should support VT-d.
The tutorials I’m following are these:
- Ubuntu 17.04 -- VFIO PCIe Passthrough & Kernel Update (4.14-rc1)
- https://blog.zerosector.io/2018/07/28/kvm-qemu-windows-10-gpu-passthrough/
They are very much alike so I don’t think it matters which I use…
In the bios I have both “Intel virtualization technology” and VT-d enabled.
When looking at the chipset config it also states: “Virtualization technologies: Supported”
So it should work right?..
The steps I took so far:
- Updated the bios to the newest version to ensure the problem does not ly somewhere there…
- Did a clean install of Ubuntu 19.04
- Installed the necessary packages for the vm to work properly: sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager ovmf
- Blacklisted the nouveau drivers (is this even needed in my case?)
– /etc/modprobe.d/blacklist-nouveau.conf contains the following:
blacklist nouveau
options nouveau modeset=0 -
/etc/default/grub contains:
–GRUB_CMDLINE_LINUX_DEFAULT=“quiet splash intel_iommu=on”
– In a later stage i also tried to add iommu=1 but that does not help. - Ran “lspci -nn | grep -i nvidia” to look for the pci id’s that should be put in the vfio.conf file
– That gave:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1) - put the correct id’s in /etc/modprobe.d/vfio.conf , which are:
options vfio-pci ids=10de:1b81,10de:10f0 - updated initramfs: sudo update-initramfs -u
- And then rebooted my device.
So all is well at this stage.
After the reboot I checked with: dmesg | grep -E “DMAR|IOMMU” if is configured correctly. This returns the following:
[ 0.008716] ACPI: DMAR 0x0000000067F58DB8 0000A8 (v01 INTEL SKL 00000001 INTL 00000001)
[ 0.232850] DMAR: Host address width 39
[ 0.232851] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[ 0.232855] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 7e3ff0505e
[ 0.232856] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[ 0.232858] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[ 0.232859] DMAR: RMRR base: 0x00000067553000 end: 0x00000067572fff
[ 0.232860] DMAR: RMRR base: 0x00000068800000 end: 0x00000078ffffff
[ 0.232861] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
[ 0.232862] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[ 0.232862] DMAR-IR: x2apic is disabled because BIOS sets x2apic opt out bit.
[ 0.232862] DMAR-IR: Use ‘intremap=no_x2apic_optout’ to override the BIOS setting.
[ 0.234292] DMAR-IR: Enabled IRQ remapping in xapic mode
There should be a “IOMMU” line somewhere in this result i read somewhere. But there isn’t. The tutorial states that if there are results, all is well…
So I began to be a bit sceptical if this is going to work or not…
Next i executed “dmesg | grep -i vfio”
[ 3.027184] VFIO - User Level meta-driver version: 0.3
[ 3.042504] vfio-pci: probe of 0000:01:00.0 failed with error -22
[ 3.042507] vfio_pci: add [10de:1b81[ffff:ffff]] class 0x000000/00000000
[ 3.042511] vfio-pci: probe of 0000:01:00.0 failed with error -22
[ 3.042553] vfio-pci: probe of 0000:01:00.1 failed with error -22
[ 3.042554] vfio_pci: add [10de:10f0[ffff:ffff]] class 0x000000/00000000
And also in this case: “If there are results, all is well…”
It returned results so all should be well. But since I saw 3 lines with error -22 I don’t think any of this is going to work…
But I kept going since the two lines of my GPU id’s didnt gave an error.
Lastly I tried creating a new VM in virt-manager. That went ok, until I had to add both the audio and gpu pci-express id’s to the vm. I can select them, but when trying to run the vm I get something like: “Passtrough is not supported” or “virtualisation is not supported/enabled for this hardware”
I double checked the settings in the BIOS: both settings are enabled.
Does anyone know what to try?
Did I overlook something?
If there is some more info needed, please let me know!
Any help would be appreciated!