[SOLVED] LXC i9-12900T GPU Plex passthrough

Sep 9, 2021
41
4
8
47
Hello,
I migrated my proxmox to a new machine.
The old one had a nvidia GPU: I uninstalled that driver after I moved the LXC to the new proxmox.

I used this as a reference to make the iGPU available in the LXC container:
https://forum.proxmox.com/threads/intel-rocket-lake-11th-quicksync-passthrough.98874/#post-446128

When I reach Step 5^^, and I run "ls -l /dev/dri" inside the container, I got "No such file or directory".

In the container start log I see this so something remained from my NVDIA setup :( .. not sure if this is the cause for the issue listed above ....
Code:
May 12 13:19:35 Plex apparmor.systemd[100]: /sbin/apparmor_parser: Unable to replace "kmod".  Permission denied; attempted to load a profile while confined?
May 12 13:19:35 Plex apparmor.systemd[100]: /sbin/apparmor_parser: Unable to replace "nvidia_modprobe".  Permission denied; attempted to load a profile while confined?

Any hints ?
Thank you!
 
Last edited:
@nick.kopas

Im receiving a new Intel NUC 10gen today and I want to setup Proxmox for this unit. I want a Plexmediaserver installed with GPU passthrough.
Maybe you can guide me in the correct direction how to get this up and running?

I read this The Ultimate Beginner's Guide to GPU Passthrough (Proxmox, Windows 10) but I need it for Ubuntu 20.04 server. How much of this do I need to configure to be able to get GPU up and running on the latest Proxmox ISO ? :)

You follow this guide Proxmox LXC Intel Quick Sync Transcode for Plex but I don't see that he is editing the PVE Grubfile with RUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" ?

Im so confused :) so I hope that you might would be able to assist me?

Thanks :)
 
Im so confused :) so I hope that you might would be able to assist me?
I'll do my best... what are you looking to achieve?

The tutorials you mention are two different types of "passthrough":
  • The Ultimate Beginner's Guide to GPU Passthrough (Proxmox, Windows 10) - This guide's purpose is to hand over control of a traditional GPU (e.g., RTX3060) off to a QEMU Virtual Machine running on your Proxmox host.
  • Proxmox LXC Intel Quick Sync Transcode for Plex - This guide's purpose is to allow an LXC Container access to an Intel iGPU for the limited purpose of media transcoding in Plex.
NOTE: You cannot mix these methods, it's going to be one or the other.

If all you want is media transcoding for Plex running on "headless" Ubuntu 20.04, then the LXC Container approach is your best option.

I personally used the Ubuntu 20.04 template with the following settings:
  • Privileged Container
  • 50GB Disk
  • 2 Cores / 1024MB Memory / 512MB Swap
  • Mount Point for my Music (/raid/music,mp=/mnt/music)
  • Mount Point for my Movies (/raid/movies,mp=/mnt/movies)
  • Mount Point for my TV Shows (/raid/television,mp=/mnt/television)
I then followed the Proxmox LXC Intel Quick Sync Transcode for Plex guide.

Finally, I installed Plex with the following commands in the LXC Container:
Code:
apt install -y curl gnupg-utils
apt update && apt upgrade -y

mkdir ~/neo
wget https://github.com/intel/compute-runtime/releases/download/21.49.21786/intel-gmmlib_21.3.3_amd64.deb -P ~/neo
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9441/intel-igc-core_1.0.9441_amd64.deb -P ~/neo
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.9441/intel-igc-opencl_1.0.9441_amd64.deb -P ~/neo
wget https://github.com/intel/compute-runtime/releases/download/21.49.21786/intel-opencl-icd_21.49.21786_amd64.deb -P ~/neo
dpkg -i ~/neo/intel-gmmlib_21.3.3_amd64.deb
dpkg -i ~/neo/intel-igc-core_1.0.9441_amd64.deb
dpkg -i ~/neo/intel-igc-opencl_1.0.9441_amd64.deb
dpkg -i ~/neo/intel-opencl-icd_21.49.21786_amd64.deb

curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
apt update && apt install -y plexmediaserver
 
Last edited:
  • Like
Reactions: adresner
@nick.kopas

Well first I want to try the Ubuntu 20.04 LTS server with GNU/Linux 5.13.0-44-generic x86_64.

I think I followed this guide: iGPU Passthrough to VM (Intel Integrated Graphics)

But - the hw transcoding don't work. As I can see you wrote that you didnt use the intel IGC? But at this point now you show me that they are installed in the LXC container? :)

As im am aware - you only need those if you enable HDR tonemapping? You have a 10gen nuc and didnt have to use those ?

Im most confortable with using the ubuntu 20.04 LTS server , but not as LXC ( I never tried LXC before to be honest. )

For now I haven't installed IGC - but I can try to do so.

My PVE Grub show like this:

Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream,multifunction nofb nomodset video=vesafb:off,efifb:off"

nano /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

Verify that IOMMU is enabled

Code:
root@vm:~# dmesg | grep -e DMAR -e IOMMU
[    0.000000] Warning: PCIe ACS overrides enabled; This may allow non-IOMMU protected peer-to-peer DMA
[    0.024492] ACPI: DMAR 0x000000006EFF9000 0000A8 (v01 INTEL  NUC9i5FN 00000038      01000013)
[    0.024553] ACPI: Reserving DMAR table memory at [mem 0x6eff9000-0x6eff90a7]
[    0.069190] DMAR: IOMMU enabled
[    0.189698] DMAR: Host address width 39
[    0.189700] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.189710] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[    0.189715] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.189721] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[    0.189726] DMAR: RMRR base: 0x0000006f546000 end: 0x0000006f78ffff
[    0.189729] DMAR: RMRR base: 0x00000078800000 end: 0x0000007cffffff
[    0.189732] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.189735] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.189737] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.192167] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.639370] DMAR: No ATSR found
[    0.639373] DMAR: No SATC found
[    0.639381] DMAR: IOMMU feature fl1gp_support inconsistent
[    0.639382] DMAR: IOMMU feature pgsel_inv inconsistent
[    0.639384] DMAR: IOMMU feature nwfs inconsistent
[    0.639385] DMAR: IOMMU feature pasid inconsistent
[    0.639386] DMAR: IOMMU feature eafs inconsistent
[    0.639387] DMAR: IOMMU feature prs inconsistent
[    0.639389] DMAR: IOMMU feature nest inconsistent
[    0.639390] DMAR: IOMMU feature mts inconsistent
[    0.639391] DMAR: IOMMU feature sc_support inconsistent
[    0.639392] DMAR: IOMMU feature dev_iotlb_support inconsistent
[    0.639393] DMAR: dmar0: Using Queued invalidation
[    0.639398] DMAR: dmar1: Using Queued invalidation
[    0.640816] DMAR: Intel(R) Virtualization Technology for Directed I/O

lspci -nnv | grep VGA

Code:
00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:9bca] (rev 04) (prog-if 00 [VGA controller])

On the VM settings the internal card is added under PCI device.

Skærmbillede 2022-06-09 kl. 14.46.22.png

On the running VM I have this :

Code:
plex@vm-plex:~$ lspci -nnv | grep VGA
00:02.0 VGA compatible controller [0300]: Device [1234:1111] (rev 02) (prog-if 00 [VGA controller])
00:10.0 VGA compatible controller [0300]: Intel Corporation Device [8086:9bca] (rev 04) (prog-if 00 [VGA controller])

cd /dev/dri && ls -la

Code:
plex@vm-plex:~$ cd /dev/dri && ls -la
total 0
drwxr-xr-x  3 root root       120 Jun  9 12:30 .
drwxr-xr-x 21 root root      4240 Jun  9 12:30 ..
drwxr-xr-x  2 root root       100 Jun  9 12:30 by-path
crw-rw----  1 root video 226,   0 Jun  9 12:30 card0
crw-rw----  1 root video 226,   1 Jun  9 12:30 card1
crw-rw----  1 root video 226, 128 Jun  9 12:30 renderD128


lspci -k

Code:
plex@vm-plex:/dev/dri$ lspci -k
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
    Subsystem: Red Hat, Inc. Qemu virtual machine
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
    Subsystem: Red Hat, Inc. Qemu virtual machine
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
    Subsystem: Red Hat, Inc. Qemu virtual machine
    Kernel driver in use: ata_piix
    Kernel modules: pata_acpi
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
    Subsystem: Red Hat, Inc. QEMU Virtual Machine
    Kernel driver in use: uhci_hcd
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
    Subsystem: Red Hat, Inc. Qemu virtual machine
    Kernel driver in use: piix4_smbus
    Kernel modules: i2c_piix4
00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
    Subsystem: Red Hat, Inc. Device 1100
    Kernel driver in use: bochs-drm
    Kernel modules: bochs_drm
00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon
    Subsystem: Red Hat, Inc. Virtio memory balloon
    Kernel driver in use: virtio-pci
00:05.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
    Subsystem: Red Hat, Inc. Virtio SCSI
    Kernel driver in use: virtio-pci
00:10.0 VGA compatible controller: Intel Corporation Device 9bca (rev 04)
    Subsystem: Intel Corporation Device 2081
    Kernel driver in use: i915
    Kernel modules: i915
00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device
    Subsystem: Red Hat, Inc. Virtio network device
    Kernel driver in use: virtio-pci
00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge

Don't know what im doing wrong :(
 
Last edited:
But - the hw transcoding don't work. As I can see you wrote that you didnt use the intel IGC? But at this point now you show me that they are installed in the LXC container? :)
Yeah, I went back later and added them. Plex kept complaining that they weren't installed when I did upgrades.

Don't know what im doing wrong :(
Hmmm... Can you try changing your machine type to q35?
 
Last edited:
Ok I will install those as well.

What does that do ? Have I done everything correct ?
Im trying to use LXC container since they are lightweight .

And THANKS for trying to help me so far :)
 
Im lost :( - don't know where to start

If im running a VM and NOT a LXC .

How should I proceed then? Or do you recommend LXC if yes - what should I do :) ?
 
@nick.kopas

Think I have solved it :). . Installed the Ubuntu 20.04 LTS with the hwe kernel .

HW transcoding working with all the latest Intel Runtime Compute drivers.

Lxc is a serious pain for me - I have had SO many problems :(
 
I know how to create the containers - but it I can't get hw transcoding to work for lxc :/
 
@nick.kopas
Sorry for disturbing you again - but I tried to setup an priviliged container. I reinstalled everything also PVE server.

Let me give you an update what im seing so far :

I have added this : GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

on PVE shell I see this
ls -l /dev/dri

Code:
drwxr-xr-x 2 root root         80 Jun 10 13:22 by-path
crw-rw---- 1 root video  226,   0 Jun 10 13:22 card0
crw-rw---- 1 root render 226, 128 Jun 10 13:22 renderD128

Which should be fine .
I made the LXC container:

Change the /etc/pve/lxc/id.conf

Code:
arch: amd64
cores: 4
features: fuse=1
hostname: Plex
memory: 2096
net0: name=eth0,bridge=vmbr0,firewall=0,gw=192.168.0.1,hwaddr=2E:A4:B3:3A:C4:5F,ip=192.168.0.102/24,type=veth
ostype: ubuntu
rootfs: local-zfs:subvol-101-disk-0,size=2G
snaptime: 1654852367
swap: 4096
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry: /dev/dri/renderD128 dev/renderD128 none bind,optional,create=file

Which this in the container - I see:

ls -l /dev/dri

Code:
drwxr-xr-x 2 root root         80 Jun 10 11:22 by-path
crw-rw---- 1 root video  226,   0 Jun 10 11:22 card0
crw-rw---- 1 root syslog 226, 128 Jun 10 11:22 renderD128

So as I see it - everything is OK with GPU Passthrough .

Then I installed your ICG files - all install fine:

Installed Plexmediaserver and then im missing OpenCL - Not installed

Code:
PlexMediaServer install: PlexMediaServer-1.26.2.5797-5bd057d2b - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install:   Installation Type:   New
PlexMediaServer install:   Process Control:     systemd
PlexMediaServer install:   Plex User:           plex
PlexMediaServer install:   Plex Group:          plex
PlexMediaServer install:   Video Group:         syslog
PlexMediaServer install:   Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install:   Temp Directory:      /tmp
PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
PlexMediaServer install:   Intel i915 Hardware: Found
PlexMediaServer install:   Nvidia GPU card:     Not Found
PlexMediaServer install:
PlexMediaServer install:   OpenCL:              Not Installed
PlexMediaServer install:   Intel Gmmlib:        Installed
PlexMediaServer install:   Intel IGC Core:      Installed
PlexMediaServer install:   Intel IGC OpenCL:    Installed
PlexMediaServer install:   Intel OpenCL:        Installed
PlexMediaServer install:
PlexMediaServer install: WARNING: The OpenCL library, required for hardware transcoding of HDR content, is missing.
PlexMediaServer install:          Please install package:  'ocl-icd-libopencl1'
PlexMediaServer install:
PlexMediaServer install: INFO:    dpkg will install package 'ocl-icd-libopencl1' automatically
PlexMediaServer install:          if available for your host upon successful installation of Plex Media Server.
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
Created symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service -> /lib/systemd/system/plexmediaserver.service.
PlexMediaServer install: PlexMediaServer-1.26.2.5797-5bd057d2b - Installation successful.  Errors: 0, Warnings: 1
Setting up beignet-opencl-icd:amd64 (1.3.2-7build1) ...
Setting up ocl-icd-libopencl1:amd64 (2.2.11-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for mime-support (3.64ubuntu1) ...

What am I doing wrong ?

The odd thing is . Even though I have GRUB with intel_iommu=on , I cant see that its enabled?

dmesg | grep -e DMAR -e IOMMU
Code:
root@pve:~#
[    0.025333] ACPI: DMAR 0x000000006EFF9000 0000A8 (v01 INTEL  NUC9i5FN 00000038      01000013)
[    0.025415] ACPI: Reserving DMAR table memory at [mem 0x6eff9000-0x6eff90a7]
[    0.197488] DMAR: Host address width 39
[    0.197492] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.197504] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap 1c0000c40660462 ecap 19e2ff0505e
[    0.197513] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.197521] DMAR: dmar1: reg_base_addr fed91000 ver 1:0 cap d2008c40660462 ecap f050da
[    0.197529] DMAR: RMRR base: 0x0000006f546000 end: 0x0000006f78ffff
[    0.197534] DMAR: RMRR base: 0x00000078800000 end: 0x0000007cffffff
[    0.197540] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.197546] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.197550] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.200364] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.648050] DMAR: No ATSR found
[    0.648055] DMAR: No SATC found
[    0.648059] DMAR: IOMMU feature fl1gp_support inconsistent
[    0.648060] DMAR: IOMMU feature pgsel_inv inconsistent
[    0.648064] DMAR: IOMMU feature nwfs inconsistent
[    0.648066] DMAR: IOMMU feature pasid inconsistent
[    0.648069] DMAR: IOMMU feature eafs inconsistent
[    0.648071] DMAR: IOMMU feature prs inconsistent
[    0.648074] DMAR: IOMMU feature nest inconsistent
[    0.648077] DMAR: IOMMU feature mts inconsistent
[    0.648079] DMAR: IOMMU feature sc_support inconsistent
[    0.648082] DMAR: IOMMU feature dev_iotlb_support inconsistent
[    0.648085] DMAR: dmar0: Using Queued invalidation
[    0.648093] DMAR: dmar1: Using Queued invalidation
[    0.652434] DMAR: Intel(R) Virtualization Technology for Directed I/O

(HW) Transcoding seems to be working though :) - but OpenCL I cant get installed?

Capture.JPG
But it seems to be enabled on the LXC container.

All help would be appreciated .

Thanks
 
Last edited:
What am I doing wrong ?
Nothing. From what I see above, you got everything working!

The Plex installer handled OpenCL:
Code:
Setting up beignet-opencl-icd:amd64 (1.3.2-7build1) ...
Setting up ocl-icd-libopencl1:amd64 (2.2.11-1ubuntu1) ...

NOTE: Allowing LXC Containers access to devices on the host doesn't require VFIO.
 
  • Like
Reactions: Morphy
Im going to bed.. jesus :)

THANKS for clarifying :)

Do you know why its saying the OpenCL isnt installed at the top? but further down its shows its installed?

PlexMediaServer install: OpenCL: Not Installed
PlexMediaServer install: Intel Gmmlib: Installed
PlexMediaServer install: Intel IGC Core: Installed
PlexMediaServer install: Intel IGC OpenCL: Installed
PlexMediaServer install: Intel OpenCL: Installed

Okay so LXC no need to passthrough GPU , got it.
VM needs it - OK got it :)
 

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!