majk

New Member
Mar 10, 2023
6
0
1
Hi guys. I just wanted to share with you my last lucky shoot which is fully working iGPU passthrough for KODI on Ubuntu VM. Believe me, that was nearly doomed, but the hope dies last Let's get started!

Assumptions​

- working KODI on my TV connected via HDMI cable to "one and only" Proxmox PC,
- KODI works as standalone instance installed on Ubuntu VM - no Libreelec unfortunately,
- KODI transcodes with HW and runs flawlessly.

My hardware:​

- DELL 3050 PC with Intel 6th gen. i5-6500 Skylake
- integrated graphics on Intel HD Graphics 530,
- unfortunately this PC (like most of this kind) doesn't support HDMI CEC.

Credits​

First, I want to put most of credits to authors of this site, which was very helpful
https://3os.org/infrastructure/proxmox/gpu-passthrough/igpu-passthrough-to-vm/
but it was not 100% compatible with my configuration.

It is highly recommended for you to start with reading that before you go any further.

Proxmox config​

/etc/default/grub​

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction initcall_blacklist=sysfb_init video=simplefb:off video=vesafb:off video=efifb:off video=vesa:off disable_vga=1 vfio_iommu_type1.allow_unsafe_interrupts=1 kvm.ignore_msrs=1 modprobe.blacklist=i915"

/etc/modules​

Code:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

# Modules required for PCI passthrough
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

# Modules required for Intel GVT-g Split
# kvmgt

Hardware tab​

  • Display
    • for valid OpenGL driver only VirtIO-GPU option works
      also on host install
      Bash:
      apt install libgl1 libegl1
1703686983972.png

Manually add PCI devices:
  • hostpci0 - iGPU, make Primary GPU option ticked (x-vga=1),
  • hostpci1 - HD audio soundcard, there will be no audio without this.
You can also passthrough the whole USB hub device (if no USB devices will be used on another VMs) or certain USB devices, like keyboards/mice, hard drives, etc. In my case there was also an internal USB hub and some thermal monitoring connected to VM (hostpci2 and hostpci3), but currently I don't have it connected and everything is fine. Instead USB hub I have wireless USB dongle connected for keyboard and mouse.

KODI installation and config​

Manual​

Just follow steps for Debian installation described on official KODI wiki:
https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux?https=1#Debian

Troubleshooting​

Full screen video glitches, loosing frames, etc.​

- if CPU usage is low, but video is not flawless it seems that you may want to reduce number of screens in Ubuntu video configuration and leave only one that is connected via HDMI.

Goal​

video_info.jpg
sys_info_summary.jpg
sys_info_video.jpg


Have a nice 2024 year!
 
Thanks for sharing your results! Does it work flawless for you furthermore? I'm also thinking about using mit intel NUC8 for my tv. So my homeserver with proxmox and some services like homeassistant, unifi controller, opnsense etc. could also be my HTPC. An all in one box with only one time power usage! It's already running 24/7 and does have enough capacity for more workload.
 
Thanks for sharing your results! Does it work flawless for you furthermore? I'm also thinking about using mit intel NUC8 for my tv. So my homeserver with proxmox and some services like homeassistant, unifi controller, opnsense etc. could also be my HTPC. An all in one box with only one time power usage! It's already running 24/7 and does have enough capacity for more workload.
That's right buddy! That's the all-in-one power :cool:. Also, you can put some automation and turn off the KODI VM when it's not used, to save even more power.

Does it works flawless? Yes. One thing I miss is no CEC support, the KODI cannot control the TV via HDMI and I need to switch on and off by myself. It is working with Raspberry and it's very convenient. I'm not sure, but your NUC could have CEC support, but you need to check.
 
Thank-you. Any chance you can run "lspci -n -s 00:02 -v" and paste the output? Mine is below (even after I've tried blacklisting i915 everywhere)

Code:
root@pve01:~# lspci -n -s 00:02 -v
00:02.0 0300: 8086:1912 (rev 06) (prog-if 00 [VGA controller])
        Subsystem: 1028:07a3
        Flags: bus master, fast devsel, latency 0, IRQ 255, IOMMU group 0
        Memory at f6000000 (64-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable- Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Kernel driver in use: vfio-pci
        Kernel modules: i915
 
Thank-you. Any chance you can run "lspci -n -s 00:02 -v" and paste the output? Mine is below (even after I've tried blacklisting i915 everywhere)

Code:
root@pve01:~# lspci -n -s 00:02 -v
00:02.0 0300: 8086:1912 (rev 06) (prog-if 00 [VGA controller])
        Subsystem: 1028:07a3
        Flags: bus master, fast devsel, latency 0, IRQ 255, IOMMU group 0
        Memory at f6000000 (64-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable- Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Kernel driver in use: vfio-pci
        Kernel modules: i915

Here you go, it's not identical though.

Code:
root@proxmox:~# lspci -n -s 00:02 -v
00:02.0 0300: 8086:1912 (rev 06) (prog-if 00 [VGA controller])
        Subsystem: 1028:07a3
        Flags: bus master, fast devsel, latency 0, IRQ 133, IOMMU group 1
        Memory at f6000000 (64-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Kernel driver in use: i915
        Kernel modules: i915


root@proxmox:~#

As far as I remember the i915 driver was needed for the HW acceleration support.
 
Thank-you for that. Interesting that yours has "Kernel driver in use: i915". I'm new to this, and between the two of us -- I'm the one that does not have it working so take what I say with a grain of salt -- but I would have expected to pass through the iGPU you would need it to be vfio-pci. Looks like I've got some more digging to do :cool:
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!