Skip to content

Instantly share code, notes, and snippets.

@nopcall
Forked from azsde/README.md
Created January 1, 2025 07:33
Show Gist options
  • Select an option

  • Save nopcall/671fec39b3835a85bd536ca4b030fb0f to your computer and use it in GitHub Desktop.

Select an option

Save nopcall/671fec39b3835a85bd536ca4b030fb0f to your computer and use it in GitHub Desktop.
How to share N100 vGPU in Proxmox

Intel N100 vGPU Sharing on Proxmox

1 - Install & Update Proxmox 8.2

1.1 - Update the kernel

Proxmox will need to run between version : proxmox-kernel-6.5.13-3-pve ~ 6.8.12-1-pve

Things are currently working using proxmox-kernel-6.8.12-1-pve.

1.2 Install strongtz i915 sriov dkms driver

  1. Clone this repo : https://github.com/strongtz/i915-sriov-dkms
  2. Install build tools: apt install build-* dkms
  3. Install the kernel and headers for desired version: apt install proxmox-headers-6.8.12-1-pve proxmox-kernel-6.8.12-1-pve (for unsigned kernel).
  4. Change into the root of the cloned repository and run dkms add ..
  5. Execute the command dkms install -m i915-sriov-dkms -v 2024.09.21 --force or dkms install -m i915-sriov-dkms -v $(cat VERSION) --force for a version-independent command.
  6. Once finished, the kernel commandline needs to be adjusted: nano /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT to intel_iommu=on i915.enable_guc=3 i915.max_vfs=7, or add to it if you have other arguments there already.
  7. Optionally pin the kernel version and update the boot config via proxmox-boot-tool.
  8. In order to enable the VFs, a sysfs attribute must be set. Install sysfsutils, then do echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 7" > /etc/sysfs.conf, assuming your iGPU is on 00:02 bus. If not, use lspci | grep VGA to find the PCIe bus your iGPU is on.
  9. Update your grub: update-grub update-initramfs -u
  10. Reboot the system.
  11. When the system is back up again, you should see the number of VFs under 02:00.1 - 02:00.7. Again, assuming your iGPU is on 00:02 bus.
  12. You can passthrough the VFs to LXCs or VMs. However, never touch the PF which is 02:00.0 under any circumstances.

2 - Set up your Debian 12 VM

Create a VM a attach any GPU (except number 0) to the VM, select Raw Device and tick Primary GPU

2.1 - Update the Kernel

Update the VM to use a kernel version >= 6.5.0 ( version 6.10.11+bpo-amd64 )was tested successfully).

Add the following to /etc/apt/sources.list

deb http://deb.debian.org/debian bookworm-backports main contrib non-free

Then

sudo apt update
# You can change the version to another one
sudo apt install -y linux-image-6.10.11+bpo-amd64 linux-headers-6.10.11+bpo-amd64 firmware-linux

2.2 - Install required packages

sudo apt install -y git dkms vainfo intel-media-va-driver

2.3 - Compile & Install i915 dkms module

# Replace your kernel version here
kernel=6.10.11+bpo-amd64

# Install i915-sriov-dkms module
git clone https://github.com/strongtz/i915-sriov-dkms.git /root/i915-sriov-dkms
cd /root/i915-sriov-dkms
rm -rf /usr/src/i915-sriov-dkms-* /var/lib/dkms/i915-sriov-dkms
dkms add .
dkms install -m i915-sriov-dkms -v $(cat VERSION) -k $kernel --force

# Set i915-sriov-dkms module parameters and enable grub kernel selection
echo 'GRUB_TIMEOUT=3' > /etc/default/grub.d/15_timeout.cfg
echo 'GRUB_CMDLINE_LINUX_DEFAULT="i915.enable_guc=3"' > /etc/default/grub.d/i915.cfg

# Update grub and initramfs
update-grub
update-initramfs -u -k all

# Optionally install the dkms MOK if you are using OVMF (UEFI) BIOS with SecureBoot (will ask you to set a password)
mokutil --import /var/lib/dkms/mok.pub

# Reboot

Upon reboot, you should be able to see in the logs:

dmesg | grep i915

[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-6.10.11+bpo-amd64 root=/dev/mapper/deathstar--vg-root ro i915.enable_guc=3
[    0.016200] Kernel command line: BOOT_IMAGE=/vmlinuz-6.10.11+bpo-amd64 root=/dev/mapper/deathstar--vg-root ro i915.enable_guc=3
[    4.769149] i915: loading out-of-tree module taints kernel.
[    4.773569] i915: module verification failed: signature and/or required key missing - tainting kernel
[    5.138058] i915 0000:00:10.0: Running in SR-IOV VF mode
[    5.139949] i915 0000:00:10.0: [drm] *ERROR* GT0: IOV: Unable to confirm version 1.13 (0000000000000000)
[    5.142362] i915 0000:00:10.0: [drm] *ERROR* GT0: IOV: Found interface version 0.1.13.4
[    5.145191] i915 0000:00:10.0: vgaarb: deactivate vga console
[    5.151782] i915 0000:00:10.0: [drm] Using Transparent Hugepages
[    5.153781] i915 0000:00:10.0: [drm] *ERROR* GT0: IOV: Unable to confirm version 1.13 (0000000000000000)
[    5.153827] i915 0000:00:10.0: [drm] *ERROR* GT0: IOV: Found interface version 0.1.13.4
[    5.154237] i915 0000:00:10.0: GuC firmware PRELOADED version 0.0 submission:SR-IOV VF
[    5.154243] i915 0000:00:10.0: HuC firmware PRELOADED
[    5.154855] i915 0000:00:10.0: [drm] *ERROR* GT0: GUC: mmio request 0x4100: failure 201/0
[    5.154863] i915 0000:00:10.0: [drm] *ERROR* GT0: Failed to retrieve hwconfig table: -ENOENT
[    5.161465] i915 0000:00:10.0: [drm] Protected Xe Path (PXP) protected content support initialized
[    5.161495] i915 0000:00:10.0: [drm] PMU not supported for this GPU.
[    5.161599] [drm] Initialized i915 1.6.0 20201103 for 0000:00:10.0 on minor 0

And the following command should return something like this:

# Might require root if your user doesn't have required rights for renderD128 device
vainfo --display drm --device /dev/dri/renderD128

libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_17
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.17 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSliceLP
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSliceLP
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointEncSliceLP
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointEncSliceLP
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointEncSliceLP
      VAProfileHEVCMain12             : VAEntrypointVLD
      VAProfileHEVCMain422_10         : VAEntrypointVLD
      VAProfileHEVCMain422_12         : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         : VAEntrypointVLD
      VAProfileHEVCMain444_10         : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointVLD
      VAProfileHEVCSccMain            : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          : VAEntrypointVLD
      VAProfileHEVCSccMain10          : VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         : VAEntrypointVLD
      VAProfileHEVCSccMain444         : VAEntrypointEncSliceLP
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointVLD
      VAProfileHEVCSccMain444_10      : VAEntrypointEncSliceLP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment