As promised here are my config files:
Hardware:
MSI GT70-2PE Dominator Pro Laptop
i7-4810mq 2.8ghz (3.6ghz turbo)
12GB ram
Nvidia GTX 880m 8gb
Intel Hybrid video (in the CPU)
(2) 2TB hard drives
Bluray burner
Windows 10/Linux Mint 18 64bit Cinnamon dual boot.
NOTE: I do not blacklist nouveau, the open source nvidia driver. After reserving the nvidia card using pci_stub nouveau doesn't even grab the card, but nouveau does load into memory, so no issue. I do uninstall ALL nvidia drivers and I use ">prime-select intel" before I uninstal the nvidia drivers to make sure linux is using intel.:
>inxi -Gx
Graphics: Card-1: Intel 4th Gen Core Processor Integrated Graphics Controller bus-ID: 00:02.0
Card-2: NVIDIA GK104M [GeForce GTX 880M] bus-ID: 01:00.0
Display Server: X.Org 1.18.3 drivers:
intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.02hz
GLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 11.2.0 Direct Rendering: Yes
my boot line:
>cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-4.5.4-040504-generic root=/dev/mapper/vg-root ro transparent_hugepage=never intel_pstate=disable intel_iommu=on quiet splash vt.handoff=7 init=/sbin/upstart
my iommu groups:
>find /sys/kernel/iommu_groups/ -type l
group 1 is the nvidia gaming card:
/sys/kernel/iommu_groups/1/devices/0000:00:01.0 (pci-e controller, not held for qemu, qemu emulates a "q35" pc with pci-e controller)
/sys/kernel/iommu_groups/1/devices/0000:01:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
my nvidia hardware info:
>lspci -nnk
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller [8086:0c01] (rev 06)
Kernel driver in use: pcieport
Kernel modules: shpchp
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104M [GeForce GTX 880M] [10de:1198] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] GK104M [GeForce GTX 880M] [1462:1105]
Kernel driver in use: vfio-pci
Kernel modules: nvidiafb, nouveau
01:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] GK104 HDMI Audio Controller [1462:1105]
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
/etc/initramfs-tools/modules (rebuild ramdisk after editing)
pci_stub ids=10de:1198,1462:1105,10de:0e0a
/etc/modules
pci_stub
vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel
vfio-pci1.cfg
0000:01:00.0
0000:01:00.1
Code: Select all
#!/bin/bash
configfile=~/qemu/vfio-pci1.cfg
vfiobind() {
dev="$1"
vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
device=$(cat /sys/bus/pci/devices/$dev/device)
if [ -e /sys/bus/pci/devices/$dev/driver ]; then
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
fi
echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
}
modprobe vfio-pci
cat $configfile | while read line;do
echo $line | grep ^# >/dev/null 2>&1 && continue
vfiobind $line
done
sudo qemu-system-x86_64 -enable-kvm -M pc-q35-xenial -m 6144 -cpu host,kvm=off \
-smp 4,sockets=1,cores=4,threads=1 \
-bios /usr/share/seabios/bios.bin \
-serial none \
-parallel none \
-rtc clock=host,base=localtime \
-vga none \
-usbdevice host:413c:a503 \
-usbdevice host:046d:c52b \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on \
-hda /home/dad/qemu/windows1.img \
-cdrom /home/dad/qemu/Windows7.iso \
-boot menu=on \
-boot order=dc \
exit 0
I use a Dell usb soundbar and a logitech receiver with mouse/keyb combo.
I realize this does not tell anyone how to do it themselves, I will be writing an article later on.
There are a LOT of gotchas and catch22's with qemu. A LOT of them.
The main thing is that after launching this you have to sit and wait for 7 minutes with nothing but a qemu monitor console window before windows finally comes up on the external monitor. You cannot watch the pretty windows startup screen.
On my laptop the hdmi port is exclusively owned by the nvidia card.
Linux runs on the intel hybrid on the laptop screen.
The intel video does have access to the 15pin connector on the back and since my external 27" monitor has both hdmi and 15 pin I can hook up both video cards to one monitor and use the monitor panel buttons to switch back and forth.
If anyone needs help with this just contact me.
I still need help getting windows on the same network as linux so I can use synergy.
I assume windows synergy automatically runs on boot and connects to the linux synergy server.
I played some Doom 4 this morning to verify this all works.
I need to optimize load times with the hardfile as it is very slow.