[SOLVED] Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] (prog-if 00 [VGA controller]) passthrough to Ubuntu VM for Plex Transcoding

I think you need to install the firmware-linux-nonfree package inside the VM guest.

To enable non-free software/firmware add non-free non-free-firmware to your debian repository in the apt sources config and run apt update afterwards:

Example:
Code:
$ cat /etc/apt/sources.list

deb http://ftp.at.debian.org/debian bookworm main contrib non-free non-free-firmware


https://wiki.debian.org/Firmware
 
I think you need to install the firmware-linux-nonfree package inside the VM guest.

thanks for this but I am unable to install it:

I tried but getting the following:

Code:
sudo apt install firmware-linux-nonfree
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  firmware-amd-graphics firmware-misc-nonfree
The following NEW packages will be installed:
  firmware-amd-graphics firmware-linux-nonfree firmware-misc-nonfree
0 upgraded, 3 newly installed, 0 to remove and 427 not upgraded.
Need to get 24.9 MB of archives.
After this operation, 136 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.at.debian.org/debian bookworm/non-free-firmware amd64 firmware-amd-graphics all 20230210-5 [11.9 MB]
Get:2 http://ftp.at.debian.org/debian bookworm/non-free-firmware amd64 firmware-misc-nonfree all 20230210-5 [13.0 MB]
Get:3 http://ftp.at.debian.org/debian bookworm/non-free-firmware amd64 firmware-linux-nonfree all 20230210-5 [49.5 kB]
Fetched 24.9 MB in 4s (5882 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package firmware-amd-graphics.
(Reading database ... 86032 files and directories currently installed.)
Preparing to unpack .../firmware-amd-graphics_20230210-5_all.deb ...
Unpacking firmware-amd-graphics (20230210-5) ...
dpkg: error processing archive /var/cache/apt/archives/firmware-amd-graphics_20230210-5_all.deb (--unpack):
 trying to overwrite '/lib/firmware/amdgpu/aldebaran_mec.bin', which is also in package linux-firmware 20220329.git681281e4-0ubuntu3.29
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package firmware-misc-nonfree.
Preparing to unpack .../firmware-misc-nonfree_20230210-5_all.deb ...
Unpacking firmware-misc-nonfree (20230210-5) ...
dpkg: error processing archive /var/cache/apt/archives/firmware-misc-nonfree_20230210-5_all.deb (--unpack):
 trying to overwrite '/lib/firmware/3com/typhoon.bin', which is also in package linux-firmware 20220329.git681281e4-0ubuntu3.29
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package firmware-linux-nonfree.
Preparing to unpack .../firmware-linux-nonfree_20230210-5_all.deb ...
Unpacking firmware-linux-nonfree (20230210-5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/firmware-amd-graphics_20230210-5_all.deb
 /var/cache/apt/archives/firmware-misc-nonfree_20230210-5_all.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)


I guess it's not do able just now... :(
 
I am sorry I forgot it was ubuntu. It should include non-free firmware. Please remove this debian repo from your /etc/apt/sources.list .

5.15.0-1051-kvm is a modified kernel and I think this could be the problem. Try the generic kernel where i915 should be included:
Code:
apt install linux-image-generic
 
Last edited:
Judging by the way how the system reports, that there is no i915 driver module, might it be, that this driver module is actually included in the (probably missing) "linux-modules-extra-{kernel-version}" package?
Did you by any chance perform a "minimal" install for that Ubuntu VM?
 
Installing linux-generic also installs such a linux-modules-extra package.
Code:
apt install linux-generic
 
Just checked: As expected, the "i915.ko" is part of the "linux-modules-extra" package in recent Ubuntu versions. And I can only guess, that on "minimal" (non standard!) installs, this does most likely NOT get installed by default. Install the matching package and try again.
 
Just checked: As expected, the "i915.ko" is part of the "linux-modules-extra" package in recent Ubuntu versions. And I can only guess, that on "minimal" (non standard!) installs, this does most likely NOT get installed by default. Install the matching package and try again.
You were absolutely right. I installed the apt install linux-generic
and I can see the following:
Code:
sudo find / -name *i915*
/usr/lib/modules/5.15.0-100-generic/kernel/drivers/gpu/drm/i915
/usr/lib/modules/5.15.0-100-generic/kernel/drivers/gpu/drm/i915/i915.ko
/usr/lib/x86_64-linux-gnu/dri/i915_dri.so
/usr/lib/firmware/i915
/usr/src/linux-kvm-headers-5.15.0-1051/drivers/gpu/drm/i915
/usr/src/linux-kvm-headers-5.15.0-1051/tools/testing/selftests/drivers/gpu/i915.sh
/usr/src/linux-kvm-headers-5.15.0-1051/include/drm/i915_drm.h
/usr/src/linux-kvm-headers-5.15.0-1051/include/drm/i915_component.h
/usr/src/linux-kvm-headers-5.15.0-1051/include/drm/i915_pciids.h
/usr/src/linux-kvm-headers-5.15.0-1051/include/drm/i915_mei_hdcp_interface.h
/usr/src/linux-kvm-headers-5.15.0-1051/include/sound/hda_i915.h
/usr/src/linux-kvm-headers-5.15.0-1051/include/uapi/drm/i915_drm.h
/usr/src/linux-headers-5.15.0-100/drivers/gpu/drm/i915
/usr/src/linux-headers-5.15.0-100/tools/testing/selftests/drivers/gpu/i915.sh
/usr/src/linux-headers-5.15.0-100/include/drm/i915_drm.h
/usr/src/linux-headers-5.15.0-100/include/drm/i915_component.h
/usr/src/linux-headers-5.15.0-100/include/drm/i915_pciids.h
/usr/src/linux-headers-5.15.0-100/include/drm/i915_mei_hdcp_interface.h
/usr/src/linux-headers-5.15.0-100/include/sound/hda_i915.h
/usr/src/linux-headers-5.15.0-100/include/uapi/drm/i915_drm.h

but when I try to load i915 drivers I get the following:
Code:
modprobe i915
modprobe: FATAL: Module i915 not found in directory /lib/modules/5.15.0-1051-kvm

I think I have to copy the i915 related files to the /lib/modules/5.15.0-1051-kvm location?? or what's the most optimal way of doing this?

thanks again for your help
 
it was already installed:
Code:
sudo apt install linux-modules-extra-5.15.0-100-generic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-modules-extra-5.15.0-100-generic is already the newest version (5.15.0-100.110).
linux-modules-extra-5.15.0-100-generic set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

as I mentioned in my previous post. I can find the
igpu drivers at /usr/lib/modules/5.15.0-100-generic/kernel/drivers/gpu/drm/i915/i915.ko
but mod probe can't find them...
 
"/usr/lib/modules/5.15.0-100-generic/kernel/drivers/gpu/drm/i915/i915.ko" is clearly not the correct place for the modules. I have no idea how they ended up there, or what you are actually doing.

Why don't you lose that strange image and do a clean install, like you would do with a bare-metal system?

General hint from me (out of professional experience):
If you expect meaningful help, then please learn how to describe your setup and your issue much more in detail. And also learn how to help yourself better.
This is not meant as an offense, but as friendly advice.
You will only get anywhere on topics like that, if you are not 100% dependant on answers from others.
You don't need to know everything, but a little more proactivity never hurts.
 
Why don't you lose that strange image and do a clean install, like you would do with a bare-metal system?

General hint from me (out of professional experience):
If you expect meaningful help, then please learn how to describe your setup and your issue much more in detail. And also learn how to help yourself better.
This is not meant as an offense, but as friendly advice.
You will only get anywhere on topics like that, if you are not 100% dependant on answers from others.
You don't need to know everything, but a little more proactivity never hurts.
I was thinking the same tbh...
I did spin up a fresh ubuntu minimal image (by Full cloning).. Then I installed:
Code:
sudo apt install linux-generic
sudo apt install inxi
sudo apt install xserver-xorg-video-intel mesa-utils

It automatically installed in the wrong location some reason. If this image is not suitable then I am thinking to try a normal one. or a Debian one
 
/usr/lib/modules/5.15.0-100-generic/kernel/drivers/gpu/drm/i915/i915.ko is the right location. You are just running the wrong kernel.

but when I try to load i915 drivers I get the following:
Code:
modprobe i915
modprobe: FATAL: Module i915 not found in directory /lib/modules/5.15.0-1051-kvm
modprobe searches in the -kvm directory which indicates that you are still running the kvm kernel.

Please reboot into the generic kernel and than load the module. (It most likely will automatically load the module)
 
Please reboot into the generic kernel and than load the module. (It most likely will automatically load the module)
Hi Markus,

I have the following:
Code:
root@system:~$ ls /lib/modules
5.15.0-100-generic  5.15.0-1051-kvm

How do I boot into the generic one?
 
This is how I resolved it:

Make sure you can see your iGPU in it's own group:

Code:
for d in /sys/kernel/iommu_groups/*/devices/*; do n=${d#*/iommu_groups/*}; n=${n%%/*}; printf 'IOMMU group %s ' "$n"; lspci -nns "${d##*/}"; done

IOMMU group 0 00:02.0 VGA compatible controller [0300]: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] [8086:3e92]
IOMMU group 10 02:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD Blue SN570 NVMe SSD 1TB [15b7:501a]
IOMMU group 11 03:00.0 Non-Volatile memory controller [0108]: HGST, Inc. Ultrastar SN200 Series NVMe SSD [1c58:0023] (rev 02)
...

Change your Grub file to this:
Code:
vi /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on i915.enable_gvt=1"

Load the modules:
Code:
# Modules required for PCI passthrough
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

# Modules required for Intel GVT
kvmgt
exngt
vfio-mdev

Create the GPU blacklist so that proxmox doesn't use it's drivers:
Code:
nano /etc/modprobe.d/blacklist.conf

blacklist nouveau
blacklist i915

Update the grub:
Code:
update-grub

initramfs:
Code:
update-initramfs -u -k all

reboot

Now, create the VM but You can't use minimal ubuntu image. I tied installing various images but it didn't work so I ended up using the normal Ubuntu Server.

Pass the iGPU:
1712961257562.png

It should be able to pick up the iGPU without any issues within the VM now. you can use the tools like intel_gpu_top or check if render is available at cd /dev/dri && ls -l

Now, setup plex using the following docker-compose in portainer:
Code:
---
services:
  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - VERSION=docker
      - PLEX_CLAIM=claim-your-plex-claim
    group_add:
      - "109"
    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128
    volumes:
      - /path/to/config:/config
      - /path/to/movies:/movies
      - /path/to/tv:/tv
    restart: unless-stopped

Notice the group_add, it's just you're adding plex to the video group which you can find out by: getent group render | cut -d: -f3

That should be it! Now I can get rid my GPU for plex ;)
 
Last edited:

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!