LibreElec with Intel KabyLake GPU Passthrough

Ekinox

New Member
Mar 17, 2020
5
0
1
40
Hello, I have a mini computer with an Intel i5-7200 CPU (with Intel HD 620 GPU, not UEFI compatible) that i use for vitualization. This computer is near of my TV and i would like to use it as a Kodi box, using LibreElec distribution (i know virtualization is not made for that but i try the challenge...). Intel VMX, VT-d & AES are enabled in the bios.

The target :
Having a Kodi up and running, in a dedicated Proxmox VM, with GPU (for 4k decoding) and audio (HDMI output). Best would be with less CPU & RAM usage.

Preliminary test:
In order to check my hardware performance & compatibility, i've installed LibreElec on the computer, on a dedicated hard disk, without virtualization, alone. Result was more than i expected: GPU & Audio recognized at first boot, 4K films rendered at 30fps with 20% CPU and 500Mo RAM usage only. My hardware and LibreElec are delivering a very good result.

The idea is to reproduce it in through a Proxmox VM.

My configuration:
proxmox-ve: 6.1-2 (running kernel: 5.3.18-2-pve)
pve-manager: 6.1-8 (running version: 6.1-8/806edfe1)
pve-kernel-helper: 6.1-7
pve-kernel-5.3: 6.1-5
pve-kernel-5.3.18-2-pve: 5.3.18-2
pve-kernel-5.3.10-1-pve: 5.3.10-1
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libpve-access-control: 6.0-6
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.0-17
libpve-guest-common-perl: 3.0-5
libpve-http-server-perl: 3.0-5
libpve-storage-perl: 6.1-5
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-3
pve-cluster: 6.1-4
pve-container: 3.0-22
pve-docs: 6.1-6
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.0-10
pve-firmware: 3.0-6
pve-ha-manager: 3.0-9
pve-i18n: 2.0-4
pve-qemu-kvm: 4.1.1-4
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-7
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1
/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

/etc/modules
vfio
vfio_iommu_type1

info pci

vfio_pci
vfio_virqfd

IOMMU Groups:

IOMMU Group 0:
-e 00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:5904] (rev 02)
IOMMU Group 1:
-e 00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 620 [8086:5916] (rev 02)
IOMMU Group 10:
-e 01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 07)
IOMMU Group 11:
-e 02:00.0 Network controller [0280]: Broadcom Limited BCM43224 802.11a/b/g/n [14e4:4353] (rev 01)
IOMMU Group 2:
-e 00:08.0 System peripheral [0880]: Intel Corporation Skylake Gaussian Mixture Model [8086:1911]
IOMMU Group 3:
-e 00:14.0 USB controller [0c03]: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller [8086:9d2f] (rev 21)
-e 00:14.2 Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Thermal subsystem [8086:9d31] (rev 21)
IOMMU Group 4:
-e 00:16.0 Communication controller [0780]: Intel Corporation Sunrise Point-LP CSME HECI #1 [8086:9d3a] (rev 21)
IOMMU Group 5:
-e 00:17.0 SATA controller [0106]: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] [8086:9d03] (rev 21)
IOMMU Group 6:
-e 00:1c.0 PCI bridge [0604]: Intel Corporation Sunrise Point-LP PCI Express Root Port [8086:9d12] (rev f1)
IOMMU Group 7:
-e 00:1c.3 PCI bridge [0604]: Intel Corporation Device [8086:9d13] (rev f1)
IOMMU Group 8:
-e 00:1e.0 Signal processing controller [1180]: Intel Corporation Sunrise Point-LP Serial IO UART Controller #0 [8086:9d27] (rev 21)
-e 00:1e.4 SD Host controller [0805]: Intel Corporation Device [8086:9d2b] (rev 21)
-e 00:1e.6 SD Host controller [0805]: Intel Corporation Sunrise Point-LP Secure Digital IO Controller [8086:9d2d] (rev 21)
IOMMU Group 9:
-e 00:1f.0 ISA bridge [0601]: Intel Corporation Sunrise Point-LP LPC Controller [8086:9d58] (rev 21)
-e 00:1f.2 Memory controller [0580]: Intel Corporation Sunrise Point-LP PMC [8086:9d21] (rev 21)
-e 00:1f.3 Audio device [0403]: Intel Corporation Sunrise Point-LP HD Audio [8086:9d71] (rev 21)
-e 00:1f.4 SMBus [0c05]: Intel Corporation Sunrise Point-LP SMBus [8086:9d23] (rev 21)

lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 02)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)
00:08.0 System peripheral: Intel Corporation Skylake Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1)
00:1c.3 PCI bridge: Intel Corporation Device 9d13 (rev f1)
00:1e.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO UART Controller #0 (rev 21)
00:1e.4 SD Host controller: Intel Corporation Device 9d2b (rev 21)
00:1e.6 SD Host controller: Intel Corporation Sunrise Point-LP Secure Digital IO Controller (rev 21)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 07)
02:00.0 Network controller: Broadcom Limited BCM43224 802.11a/b/g/n (rev 01)

lspci -n -s 00:02.0
00:02.0 0300: 8086:5916 (rev 02)
lspci -n -s 00:1f.3
00:1f.3 0403: 8086:9d71 (rev 21)

/etc/modprobe.d/vfio.conf
options vfio-pci ids=8086:5916
options vfio-pci ids=8086:9d71

/etc/modprobe.d/blacklist.conf
blacklist snd_hda_intel
blacklist snd_hda_codec_hdmi
blacklist i915


Graphic card IS NOT UEFI compatible:

Valid ROM signature found @0h, PCIR offset 40h
PCIR: type 0 (x86 PC-AT), vendor: 8086, device: 0406, class: 030000
PCIR: revision 3, vendor revision: 0
Last image


LibreElec installation:
- .OVA downloaded
- tar -xvf in order to extract the VMDK file
- qm importdisk 109 libreelec.vmdk local-lvm --format vmdk
(Note: I've tried to convert to qcow2 before import; but once the VM started, i had a systematic mount error at startup...)
- installed as an IDE hard disk
(Note: Also work with ATA disk; but do not work with SCSI disk (LibreElec do not boot))

boot: c
bootdisk: ide0
cores: 4
hostpci0: 00:1f,rombar=0
hostpci1: 00:02,rombar=0,x-vga=1
ide0: local-lvm:vm-109-disk-0,size=548M
machine: q35
memory: 2048
name: LibreElec4
net0: virtio=7A:1D:F2:84:4D:D2,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=fe322f1e-8fb3-4d22-a17f-d11a874d9838
sockets: 1
vga: none
vmgenid: 8014702e-f642-41f7-ba07-308da07c2d77

(Note: Need "rombar=0" option if i want it to work)
(Note: Tried "machine" with "pc-q35-3.1" or "i440" but not better)

info pci
Bus 6, device 16, function 2:
Audio controller: PCI device 8086:9d71
PCI subsystem 8086:7270
IRQ 10.
BAR0: 64 bit memory at 0xfc054000 [0xfc057fff].
BAR4: 64 bit memory at 0xfc040000 [0xfc04ffff].
id "hostpci0.2"
Bus 6, device 17, function 0:
VGA controller: PCI device 8086:5916
PCI subsystem 8086:2212
IRQ 11.
BAR0: 64 bit memory at 0xfb000000 [0xfbffffff].
BAR2: 64 bit prefetchable memory at 0xc0000000 [0xcfffffff].
BAR4: I/O at 0x4000 [0x403f].
id "hostpci1"

Result:
- If I start with audio passthrough but without GPU Passthrough, LibreElec starts correctly (can be seen in the console); the audio card is recognized (HDMI output available); CPU stay low 15%; memory low 500Mo.
- If I start with GPU Passthrough (with or without audio) CPU gets high 75 to 99%, memory stays low 500Mo, no ping, no ssh. Don't know how to debug...

May you help in order to make it work ? Thanks in advance for your time.
 
Last edited:

Ekinox

New Member
Mar 17, 2020
5
0
1
40
Hello, i think your configuration is okay, i cant see a problem. Did you try with these settings another distribution? Test it with Linux Mint, like i did:

https://forum.proxmox.com/threads/p...s-passthrough-for-ubuntu-18.47129/post-296532
Thanks for this link. I will give it a try !
I'm not that much optimistic because i've made many tries and each of them fails in a different maner.

Here is the results of my tests in order to have Kodi running:
- VM with Ubuntu: GPU passthrough is "working more or less" / HDMI display works / Kodi works BUT do not detect the GPU as a Intel HD 620 but llvmpipe (this implies very bad performance) / Audio not recognized (LSPCI on the guest shows that GPU and Audio are here)
- VM with Windows 10: GPU passthrough seems to work fine (Intel HD 620 is recognized, ready to work) BUT... i'm not able to activate HDMI (?!?!?)(with a VNC Server on Win10, i can connect but i can not detect any screen and turn on HDMI)... wierd... / Starting Kodi, he recognizes the HD 620 and acceleration is fine / Audio still not available (error on the Audio device, "can not be started". Tried to delete, reinstall, update drivers, etc... don't want to work....)
- VM with Librelec: No progress since my previous post / GPU seems to work and HDMI works / But the VM stops immediatly...

So... I will continue to work on the Windows 10 side... GPU seems to work mainly but the Audio really don't....

Thanks for your help.
 

Ekinox

New Member
Mar 17, 2020
5
0
1
40
When you only want use only LibreElec with your TV i have another suggestion: You can install Debian Buster with Gui install Proxmox for your Virtual machines: https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Buster

After that you get the Multimedia repository with Kodi.

That works fine.
Such a workaround make sense for me and will answer my needs.
I will continue to investigate in order to find a solution "100% Proxmox"; once i will be discouraged, i will give it a try. Thank you very much.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!