Hello
I have an Intel NUC (model BOXNUC8i5BEH, with Core i5-8259U Processor and Intel Iris Plus Graphics 655), with 16GB RAM, one 240GB SSD and 2TB HDD
In addition of several VM (MariaDB, FreeNAS, Jeedom...), I would like to have a VM with Kodi running, with this NUC connected to a TV with the HDMI.
I have read several thread in this forum and other google search, to setup the GPU passthrough and I have setup the host and VM in the following way
Step 1
I started to update /etc/default/grub file with
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
and update it with
update-grub
and did a reboot
then I checked that I have now IOMMU with
dmesg | grep -e DMAR -e IOMMU
and checked also for the group with
find /sys/kernel/iommu_groups/ -type l | sort
Step2
I added VFIO modules in the file
Step 3
I run
dmesg | grep 'remapping'
to check about IOMMU interrupt remapping
I got following result
[ 0.211690] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.214426] DMAR-IR: Enabled IRQ remapping in x2apic mode
so I understand from other thread that it should be ok, and therefore I did nothing more for the remapping, in particular, I did not run echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
Step 4
To blackilist the driver, I did add to the /etc/modprobe.d/blacklist.conf the driver that I have seen for the video and audio (got name with lspci -v )
Step 5
To handle the VFIO, I did for the GPU
lspci -n -s 00:02.0
to get
00:02.0 0300: 8086:3ea5 (rev 01)
and for the audio
lspci -n -s 00:1f.3
to get
00:1f.3 0403: 8086:9dc8 (rev 30)
with this 2 UID, I did add them in the file
update-initramfs -u
and the I did a reboot
Step 6
First before creating the GPU passthrough KODI VM, I check that old ones where still running fine, which was the case
To create this Kodi VM, I did it with the following parameters
here is the file /etc/pve/qemu-server/107.conf of this VM's settings
RESULTS:
When I start the VM to boot on the ubuntu installation, the TV become black at once and nothing is going on after. It looks that the network goes down, as the ssh console with the host break and the proxmox webpage is not responding anymore too (by the way, the ethernet 00:1f.6 is on the same group 11 than audio 00:1f.3, could it be a reason?)
I have tried few changes to the initial setup described above, but none of them helped. thing that I tried:
change 1
run echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
reboot
Not working better, deleted this file
change 2
change the line in /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifbff pcie_acs_override=downstream"
update-grub
reboot
Not working better, but keep it this way for next tests
change 3
in the VM hardware
change 4
in VM hardware
So I am out of idea, if someone has some feedback of what can be wrong, your help is welcome.
Thanks in advance for your time. When the issue is found and I get it working, my goal is to make a full tutorial with this answer for others to get clear steps.
I have an Intel NUC (model BOXNUC8i5BEH, with Core i5-8259U Processor and Intel Iris Plus Graphics 655), with 16GB RAM, one 240GB SSD and 2TB HDD
In addition of several VM (MariaDB, FreeNAS, Jeedom...), I would like to have a VM with Kodi running, with this NUC connected to a TV with the HDMI.
I have read several thread in this forum and other google search, to setup the GPU passthrough and I have setup the host and VM in the following way
proxmox-ve: 6.1-2 (running kernel: 5.3.18-3-pve)
pve-manager: 6.1-11 (running version: 6.1-11/f2f18736)
pve-kernel-helper: 6.1-9
pve-kernel-5.3: 6.1-6
pve-kernel-5.3.18-3-pve: 5.3.18-3
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: residual config
ifupdown2: 2.0.1-1+pve8
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libproxmox-acme-perl: 1.0.2
libpve-access-control: 6.0-7
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.1-1
libpve-guest-common-perl: 3.0-10
libpve-http-server-perl: 3.0-5
libpve-storage-perl: 6.1-7
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.2-1
lxcfs: 4.0.3-pve2
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-6
pve-cluster: 6.1-8
pve-container: 3.1-4
pve-docs: 6.1-6
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.1-2
pve-firmware: 3.0-7
pve-ha-manager: 3.0-9
pve-i18n: 2.1-1
pve-qemu-kvm: 4.1.1-4
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-20
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1
pve-manager: 6.1-11 (running version: 6.1-11/f2f18736)
pve-kernel-helper: 6.1-9
pve-kernel-5.3: 6.1-6
pve-kernel-5.3.18-3-pve: 5.3.18-3
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: residual config
ifupdown2: 2.0.1-1+pve8
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libproxmox-acme-perl: 1.0.2
libpve-access-control: 6.0-7
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.1-1
libpve-guest-common-perl: 3.0-10
libpve-http-server-perl: 3.0-5
libpve-storage-perl: 6.1-7
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.2-1
lxcfs: 4.0.3-pve2
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-6
pve-cluster: 6.1-8
pve-container: 3.1-4
pve-docs: 6.1-6
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.1-2
pve-firmware: 3.0-7
pve-ha-manager: 3.0-9
pve-i18n: 2.1-1
pve-qemu-kvm: 4.1.1-4
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-20
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1
Step 1
I started to update /etc/default/grub file with
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
and update it with
update-grub
and did a reboot
/etc/default/grub
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Proxmox Virtual Environment"
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER=true
GRUB_DISABLE_RECOVERY="true"
GRUB_FONT=/boot/grub/fonts/DejaVuSansMono36.pf2
then I checked that I have now IOMMU with
dmesg | grep -e DMAR -e IOMMU
[ 0.000000] Warning: PCIe ACS overrides enabled; This may allow non-IOMMU protected peer-to-peer DMA
[ 0.012566] ACPI: DMAR 0x0000000079DEADE0 0000A8 (v01 INTEL NUC8i5BE 0000004F 01000013)
[ 0.094170] DMAR: IOMMU enabled
[ 0.211662] DMAR: Host address width 39
[ 0.211663] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[ 0.211670] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[ 0.211671] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[ 0.211675] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[ 0.211676] DMAR: RMRR base: 0x00000079d32000 end: 0x00000079d51fff
[ 0.211676] DMAR: RMRR base: 0x0000007b800000 end: 0x0000007fffffff
[ 0.211685] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
[ 0.211688] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[ 0.211690] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.214426] DMAR-IR: Enabled IRQ remapping in x2apic mode
[ 1.214672] DMAR: No ATSR found
[ 1.214747] DMAR: dmar0: Using Queued invalidation
[ 1.214762] DMAR: dmar1: Using Queued invalidation
[ 1.227963] DMAR: Intel(R) Virtualization Technology for Directed I/O
[ 0.012566] ACPI: DMAR 0x0000000079DEADE0 0000A8 (v01 INTEL NUC8i5BE 0000004F 01000013)
[ 0.094170] DMAR: IOMMU enabled
[ 0.211662] DMAR: Host address width 39
[ 0.211663] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[ 0.211670] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[ 0.211671] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[ 0.211675] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[ 0.211676] DMAR: RMRR base: 0x00000079d32000 end: 0x00000079d51fff
[ 0.211676] DMAR: RMRR base: 0x0000007b800000 end: 0x0000007fffffff
[ 0.211685] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1
[ 0.211688] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[ 0.211690] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.214426] DMAR-IR: Enabled IRQ remapping in x2apic mode
[ 1.214672] DMAR: No ATSR found
[ 1.214747] DMAR: dmar0: Using Queued invalidation
[ 1.214762] DMAR: dmar1: Using Queued invalidation
[ 1.227963] DMAR: Intel(R) Virtualization Technology for Directed I/O
and checked also for the group with
find /sys/kernel/iommu_groups/ -type l | sort
/sys/kernel/iommu_groups/0/devices/0000:00:00.0
/sys/kernel/iommu_groups/10/devices/0000:00:1d.6
/sys/kernel/iommu_groups/11/devices/0000:00:1f.0
/sys/kernel/iommu_groups/11/devices/0000:00:1f.3
/sys/kernel/iommu_groups/11/devices/0000:00:1f.4
/sys/kernel/iommu_groups/11/devices/0000:00:1f.5
/sys/kernel/iommu_groups/11/devices/0000:00:1f.6
/sys/kernel/iommu_groups/12/devices/0000:6e:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:02.0
/sys/kernel/iommu_groups/2/devices/0000:00:08.0
/sys/kernel/iommu_groups/3/devices/0000:00:12.0
/sys/kernel/iommu_groups/4/devices/0000:00:14.0
/sys/kernel/iommu_groups/4/devices/0000:00:14.2
/sys/kernel/iommu_groups/4/devices/0000:00:14.3
/sys/kernel/iommu_groups/5/devices/0000:00:16.0
/sys/kernel/iommu_groups/6/devices/0000:00:17.0
/sys/kernel/iommu_groups/7/devices/0000:00:1c.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.4
/sys/kernel/iommu_groups/9/devices/0000:00:1d.0
/sys/kernel/iommu_groups/10/devices/0000:00:1d.6
/sys/kernel/iommu_groups/11/devices/0000:00:1f.0
/sys/kernel/iommu_groups/11/devices/0000:00:1f.3
/sys/kernel/iommu_groups/11/devices/0000:00:1f.4
/sys/kernel/iommu_groups/11/devices/0000:00:1f.5
/sys/kernel/iommu_groups/11/devices/0000:00:1f.6
/sys/kernel/iommu_groups/12/devices/0000:6e:00.0
/sys/kernel/iommu_groups/1/devices/0000:00:02.0
/sys/kernel/iommu_groups/2/devices/0000:00:08.0
/sys/kernel/iommu_groups/3/devices/0000:00:12.0
/sys/kernel/iommu_groups/4/devices/0000:00:14.0
/sys/kernel/iommu_groups/4/devices/0000:00:14.2
/sys/kernel/iommu_groups/4/devices/0000:00:14.3
/sys/kernel/iommu_groups/5/devices/0000:00:16.0
/sys/kernel/iommu_groups/6/devices/0000:00:17.0
/sys/kernel/iommu_groups/7/devices/0000:00:1c.0
/sys/kernel/iommu_groups/8/devices/0000:00:1c.4
/sys/kernel/iommu_groups/9/devices/0000:00:1d.0
Step2
I added VFIO modules in the file
/etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
Step 3
I run
dmesg | grep 'remapping'
to check about IOMMU interrupt remapping
I got following result
[ 0.211690] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[ 0.214426] DMAR-IR: Enabled IRQ remapping in x2apic mode
so I understand from other thread that it should be ok, and therefore I did nothing more for the remapping, in particular, I did not run echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
Step 4
To blackilist the driver, I did add to the /etc/modprobe.d/blacklist.conf the driver that I have seen for the video and audio (got name with lspci -v )
/etc/modprobe.d/blacklist.conf
blacklist i915
blacklist snd_hda_intel
blacklist sof_pci_dev
Step 5
To handle the VFIO, I did for the GPU
lspci -n -s 00:02.0
to get
00:02.0 0300: 8086:3ea5 (rev 01)
and for the audio
lspci -n -s 00:1f.3
to get
00:1f.3 0403: 8086:9dc8 (rev 30)
with this 2 UID, I did add them in the file
and then update it with/etc/modprobe.d/vfio.conf
options vfio-pci ids=8086:3ea5
options vfio-pci ids=8086:9dc8
update-initramfs -u
and the I did a reboot
Step 6
First before creating the GPU passthrough KODI VM, I check that old ones where still running fine, which was the case
To create this Kodi VM, I did it with the following parameters
- System: put Graphic card : none (this is what I saw in different thread, not so sure that it is the right choice)
- BIOS = OMVF (UEFI) and created EFI disk
- Machine = q35
- kept CPU to default kvm64
- Ram: kept Ballonning = Yes (what is the meaning?)
- Network: use the bridge vmbr0 and kept firewall to Yes (better with or without firewall?)
- Video
- All Functions: No (not sure of that it is the best choice?)
- Rom-Bar: Yes (not sure of that it is the best choice?)
- Primary GPU: No (not sure of that it is the best choice?)
- PCI Express: No (not sure of that it is the best choice?)
- Audio
- All Functions: No (not sure of that it is the best choice?)
- Rom-Bar: Yes (not sure of that it is the best choice?)
- Primary GPU: No
- PCI Express: No
here is the file /etc/pve/qemu-server/107.conf of this VM's settings
bios: ovmf
bootdisk: scsi0
cores: 2
efidisk0: VM_SSD:100/vm-100-disk-1.qcow2,size=128K
hostpci0: 00:02.0
hostpci1: 00:1f.3
ide2: ISO_HDD:iso/ubuntu-20.04-live-server-amd64.iso,media=cdrom
machine: q35
memory: 2048
name: Kodi
net0: virtio=2E:AD:B0:61:50:94,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: VM_SSD:100/vm-100-disk-0.qcow2,size=12G
scsihw: virtio-scsi-pci
smbios1: uuid=cafcc154-9ee8-4663-8308-56f850d43b8c
sockets: 1
usb0: host=03f0:0641,usb3=1
usb1: host=03f0:0024,usb3=1
vga: none
vmgenid: c734e49d-5567-421a-a8f1-553424f96053
RESULTS:
When I start the VM to boot on the ubuntu installation, the TV become black at once and nothing is going on after. It looks that the network goes down, as the ssh console with the host break and the proxmox webpage is not responding anymore too (by the way, the ethernet 00:1f.6 is on the same group 11 than audio 00:1f.3, could it be a reason?)
I have tried few changes to the initial setup described above, but none of them helped. thing that I tried:
change 1
run echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" > /etc/modprobe.d/iommu_unsafe_interrupts.conf
reboot
Not working better, deleted this file
change 2
change the line in /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifbff pcie_acs_override=downstream"
update-grub
reboot
Not working better, but keep it this way for next tests
change 3
in the VM hardware
- For the PCI Video, put Primary VGA=Yes
- change Network=e1000, remove firewall
Not working betterhostpci0: 00:02,x-vga=1
net0: e1000=2E:AD:B0:61:50:94,bridge=vmbr0
change 4
in VM hardware
- chage PCI-Audio = all function
- put back network to virtio (but still without firewall
Not working betterhostpci1: 00:1f
net0: virtio=2E:AD:B0:61:50:94,bridge=vmbr0
So I am out of idea, if someone has some feedback of what can be wrong, your help is welcome.
Thanks in advance for your time. When the issue is found and I get it working, my goal is to make a full tutorial with this answer for others to get clear steps.