I'm having an issue with getting this to work on my computer - I get the output:
Code: Select all
collin@surveillance:~/vm$ sudo ./run.sh
qemu-system-x86_64: -device vfio-pci,host=03:00.0,multifunction=on: VFIO 0000:03:00.0 BAR 3 mmap unsupported. Performance may be slow
I am using an AMD Radeon R5 235X and an NVIDIA GTX 1060 3GB, the AMD as the "host" and the NVIDIA as the one being passed to the vm. I'm forced to use my AMD in the last PCI slot (05:00.0) because I plan to pass through the 1060 3GB as well as a 1060 6GB. Currently the 1060 3GB is in the PCI slot 03:00.0. I'm on Ubuntu (cinnamon would crash on linuxmint) - results from cat /proc/version:
Code: Select all
Linux version 4.13.0-32-generic (buildd@lgw01-amd64-004) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)) #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018
First, to prevent the NVIDIA from being defaulted to render the host, I have been using this xorg.conf file in /etc/X11/xorg.conf:
Code: Select all
Section "Device"
Identifier "AMD GPU"
Driver "radeon"
BusID "PCI:5:0:0"
EndSection
Section "Monitor"
Identifier "ASUS MONITOR"
HorizSync 30-94
VertRefresh 48-85
EndSection
Section "Screen"
Identifier "SCREEN 1"
Device "AMD GPU"
Monitor "ASUS MONITOR"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1200"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "SCREEN 1"
EndSection
Code: Select all
blacklist nouveau
options nouveau modeset=0
Code: Select all
[ 12.792120] vfio-pci 0000:03:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 12.836044] vfio_pci: add [10de:1c02[ffff:ffff]] class 0x000000/00000000
[ 12.864128] vfio_pci: add [10de:10f1[ffff:ffff]] class 0x000000/00000000
[ 16.071934] vfio-pci 0000:03:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 60.844184] vfio_ecap_init: 0000:03:00.0 hiding ecap 0x19@0x900
[ 60.845603] vfio-pci 0000:03:00.0: BAR 3: can't reserve [mem 0xb0000000-0xb1ffffff 64bit pref]
[ 63.553983] vfio-pci 0000:03:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
[ 63.553994] vfio-pci 0000:03:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
[ 881.640205] vfio_ecap_init: 0000:03:00.0 hiding ecap 0x19@0x900
[ 881.641764] vfio-pci 0000:03:00.0: BAR 3: can't reserve [mem 0xb0000000-0xb1ffffff 64bit pref]
Code: Select all
#!/bin/bash
vmname="windows10vm"
if ps -A | grep -q $vmname; then
echo "$vmname is already running." &
exit 1
else
# use pulseaudio
#export QEMU_AUDIO_DRV=pa
#export QEMU_PA_SAMPLES=8192
#export QEMU_AUDIO_TIMER_PERIOD=99
#export QEMU_PA_SERVER=/run/user/1000/pulse/native
#alsa/ac97 test 1/8/26 9:55am
export QEMU_AUDIO_DRV=alsa
export QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256
export QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256
export QEMU_AUDIO_DAC_FIXED_SETTINGS=1
export QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_AUDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16
export QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1
export QEMU_AUDIO_TIMER_PERIOD=50
cp /usr/share/OVMF/OVMF_VARS.fd /tmp/my_vars.fd
qemu-system-x86_64 \
-name $vmname,process=$vmname \
-machine type=q35,accel=kvm \
-cpu host,kvm=off \
-smp 4,sockets=1,cores=2,threads=2 \
-m 8G \
-mem-prealloc \
-balloon none \
-rtc clock=host,base=localtime \
-vga none \
-serial none \
-parallel none \
-soundhw ac97 \
-usb -usbdevice host:04f2:0939 -usbdevice host:04d9:a0cd -usbdevice host:28de:1142 \
-device vfio-pci,host=03:00.0,multifunction=on \
-device vfio-pci,host=03:00.1, \
-drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/tmp/my_vars.fd \
-boot order=dc \
-drive id=disk0,if=virtio,cache=none,format=raw,file=/home/collin/vm/win.img \
-drive file=/home/collin/vm/windows.iso,index=3,media=cdrom \
-drive file=/home/collin/vm/virtio.iso,index=4,media=cdrom \
-net user,net=10.0.0.0/8,host=10.0.0.1,hostfwd=tcp:127.0.0.1:2222-10.0.0.2:22 \
-net nic
exit 0
fi
Code: Select all
[ 16.027]
X.Org X Server 1.19.5
Release Date: 2017-10-12
[ 16.028] X Protocol Version 11, Revision 0
[ 16.028] Build Operating System: Linux 4.4.0-101-generic x86_64 Ubuntu
[ 16.028] Current Operating System: Linux surveillance 4.13.0-32-generic #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018 x86_64
[ 16.028] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-32-generic root=UUID=578c959d-72df-4509-b468-c5501bc7ca99 ro intel_iommu=on
[ 16.028] Build Date: 24 November 2017 09:44:25AM
[ 16.028] xorg-server 2:1.19.5-0ubuntu2~16.04.1 (For technical support please see http://www.ubuntu.com/support)
[ 16.028] Current version of pixman: 0.33.6
[ 16.028] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 16.028] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 16.028] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Feb 8 19:18:56 2018
[ 16.028] (==) Using config file: "/etc/X11/xorg.conf"
[ 16.028] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 16.028] (==) ServerLayout "Default Layout"
[ 16.028] (**) |-->Screen "SCREEN 1" (0)
[ 16.028] (**) | |-->Monitor "ASUS MONITOR"
[ 16.028] (**) | |-->Device "AMD GPU"
[ 16.028] (==) Automatically adding devices
[ 16.028] (==) Automatically enabling devices
[ 16.028] (==) Automatically adding GPU devices
[ 16.028] (==) Automatically binding GPU devices
[ 16.028] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 16.029] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 16.029] Entry deleted from font path.
[ 16.029] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[ 16.029] Entry deleted from font path.
[ 16.029] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[ 16.029] Entry deleted from font path.
[ 16.029] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[ 16.029] Entry deleted from font path.
[ 16.029] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 16.029] Entry deleted from font path.
[ 16.029] (==) FontPath set to:
/usr/share/fonts/X11/misc,
/usr/share/fonts/X11/Type1,
built-ins
[ 16.029] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"
[ 16.029] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 16.029] (II) Loader magic: 0x55a100290e00
[ 16.029] (II) Module ABI versions:
[ 16.029] X.Org ANSI C Emulation: 0.4
[ 16.029] X.Org Video Driver: 23.0
[ 16.029] X.Org XInput driver : 24.1
[ 16.029] X.Org Server Extension : 10.0
[ 16.030] (++) using VT number 7
[ 16.030] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 16.030] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 16.032] (--) PCI:*(0:3:0:0) 10de:1c02:1462:8c95 rev 161, Mem @ 0xfa000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/131072
[ 16.032] (--) PCI: (0:5:0:0) 1002:6771:1028:2120 rev 0, Mem @ 0xc0000000/268435456, 0xfb320000/131072, I/O @ 0x0000d000/256, BIOS @ 0x????????/131072
[ 16.032] (II) LoadModule: "glx"
[ 16.033] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 16.039] (II) Module glx: vendor="X.Org Foundation"
[ 16.039] compiled for 1.19.5, module version = 1.0.0
[ 16.039] ABI class: X.Org Server Extension, version 10.0
[ 16.039] (II) LoadModule: "radeon"
[ 16.039] (II) Loading /usr/lib/xorg/modules/drivers/radeon_drv.so
[ 16.041] (II) Module radeon: vendor="X.Org Foundation"
[ 16.041] compiled for 1.19.3, module version = 7.9.0
[ 16.041] Module class: X.Org Video Driver
[ 16.041] ABI class: X.Org Video Driver, version 23.0
[ 16.041] (II) RADEON: Driver for ATI/AMD Radeon chipsets: [ cut down for character limit ]
[ 16.071] (II) [KMS] Kernel modesetting enabled.
[ 16.071] (**) RADEON(0): Depth 24, (--) framebuffer bpp 32
[ 16.071] (II) RADEON(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)
Here's lspci -vnn:
Code: Select all
03:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:1c02] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:8c95]
Physical Slot: 6
Flags: fast devsel, IRQ 27
Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
Memory at a0000000 (64-bit, prefetchable) [size=256M]
Memory at b0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: vfio-pci
Kernel modules: nvidiafb, nouveau
03:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10f1] (rev a1)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device [1462:8c95]
Physical Slot: 6
Flags: fast devsel, IRQ 55
Memory at fb080000 (32-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
05:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Caicos XTX [Radeon HD 8490 / R5 235X OEM] [1002:6771] (prog-if 00 [VGA controller])
Subsystem: Dell Caicos XTX [Radeon HD 8490 / R5 235X OEM] [1028:2120]
Physical Slot: 2-1
Flags: bus master, fast devsel, latency 0, IRQ 50
Memory at c0000000 (64-bit, prefetchable) [size=256M]
Memory at fb320000 (64-bit, non-prefetchable) [size=128K]
I/O ports at d000 [size=256]
Expansion ROM at fb300000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: radeon
Kernel modules: radeon
05:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Caicos HDMI Audio [Radeon HD 6400 Series] [1002:aa98]
Subsystem: Dell Caicos HDMI Audio [Radeon HD 6400 Series] [1028:aa98]
Physical Slot: 2-1
Flags: bus master, fast devsel, latency 0, IRQ 54
Memory at fb340000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
If anyone needs more information, I can give it to them.
Thanks!