XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Intel iGPU passthough

    Scheduled Pinned Locked Moved Hardware
    39 Posts 10 Posters 9.1k Views 11 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bullerwinsB Offline
      bullerwins
      last edited by

      Hi!

      I've searched this topic but only found old threads without any clear solution, or using the Windows Center tool which is no longer supported.

      Is there any guide on how to pass the Intel iGPU to a VM in order to use it for example for plex encoding? CLI is fine

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Could it be PCI passthrough? That might be the easiest way

        bullerwinsB 1 Reply Last reply Reply Quote 0
        • bullerwinsB Offline
          bullerwins @olivierlambert
          last edited by

          olivierlambert I'm not sure as it not like a discrete GPU in a dedicated PCIe slot as it's integrated into the CPU. The model I'm testing in particular is an Intel 12400.

          This is the lspci output
          b4806348-dc0e-41ca-9759-ccd8a88ad255-image.png

          It looks like there is a VGA there. Should I try this guide? https://docs.xcp-ng.org/compute/

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            You could try to pass it through and see the result

            bullerwinsB 1 Reply Last reply Reply Quote 0
            • bullerwinsB Offline
              bullerwins @olivierlambert
              last edited by bullerwins

              olivierlambert I tried but getting this error when turning on the VM

              INTERNAL_ERROR(xenopsd internal error: (Failure
              "Error from xenguesthelper: Populate on Demand and PCI Passthrough are mutually exclusive"))

              Not sure what it means

              EDIT: after googleing it seems that static and dynamic memory has to be the same:
              9aa61d84-dd71-4f32-9590-8cff8c365a1a-image.png

              bullerwinsB MefosheezM 3 Replies Last reply Reply Quote 2
              • bullerwinsB Offline
                bullerwins @bullerwins
                last edited by

                bullerwins Update. The VM recognized the intel GPU:

                intel_gpu_top
                1978ef47-f998-4806-a5e0-8105a4132a2a-image.png

                lspci -k | grep -EA2 'VGA|3D'
                0e9cb348-42c8-4087-854f-3f93d022ecea-image.png

                I will test with Plex Encoding

                1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  That's a good sign, please let us know!

                  bullerwinsB 1 Reply Last reply Reply Quote 0
                  • bullerwinsB Offline
                    bullerwins @olivierlambert
                    last edited by

                    olivierlambert

                    I got it working!

                    Pic while transcoding with plex
                    ae4d6736-b170-4d1a-b423-ed037fb6c389-image.png

                    Plex info:
                    86dbffbe-c1e1-47bd-802a-4396e2fab7b2-image.png

                    Detected:
                    9957882a-0beb-4b5e-817b-df6a28716a7e-image.png

                    For future reference if anyone finds this with google:

                    I had to " sudo chmod -R 777 /dev/dri" inside the Ubuntu VM, otherwise it didnt work.

                    I'm using binhex plex docker image, I have to add the device to the container. It's really easy with portainer:

                    The "/dev/dri/" part is the important
                    96f5a51e-3281-4c01-aafc-803850a4ff8b-image.png

                    PS: olivierlambert there is a typo in the xcp docs, a space is missing in Step 5:
                    https://docs.xcp-ng.org/compute/#5-put-this-pci-device-into-your-vm
                    b2d60148-73b5-4e62-8bbe-0126deab8fd5-image.png
                    This copy/pastes as:
                    xe vm-param-set other-config:pci=0/0000:04:01.0uuid=<vm uuid>

                    It should be:
                    xe vm-param-set other-config:pci=0/0000:04:01.0 uuid=<vm uuid>

                    tjkreidlT 1 Reply Last reply Reply Quote 1
                    • olivierlambertO Offline
                      olivierlambert Vates 🪐 Co-Founder CEO
                      last edited by

                      Wow, great news! Happy to see you have now a working setup!!

                      Fixing the doc now 🙂

                      1 Reply Last reply Reply Quote 0
                      • olivierlambertO Offline
                        olivierlambert Vates 🪐 Co-Founder CEO
                        last edited by

                        Doc is now fixed 🙂

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          adriangabura
                          last edited by

                          Could you please tell us what your motherboard is called? Last time I tried, my motherboard didn't support it, though it was Intel. Also I assume such a thing is not possible on Intel Xeon chipsets like Intel® C242 chipset?

                          bullerwinsB 1 Reply Last reply Reply Quote 0
                          • bullerwinsB Offline
                            bullerwins @adriangabura
                            last edited by

                            adriangabura Gigabyte B760M Gaming X / DDR4 / MicroATX

                            1 Reply Last reply Reply Quote 0
                            • X Offline
                              xerxist
                              last edited by

                              Hello All,

                              Coming from ESXi 8 where I was doing this for a long time but for some reason I can't get it to work on XCP-NG 8.2.1 and 8.3 on my NUC11 and NUC13.

                              I can see the device in the VM when I do lspci, Plex also recognizes it.
                              The (hw) sign comes up but nothing happens after that.
                              Tried different OS's Ubuntu/Talos nothing seems to make it work then that its detected.

                              Are there some kernel arguments I need to pass in Grub for this to make it work?
                              Really hate to switch to something else as I'm really like the setup and how everything works out the box, but this is a show stopper for my use case. 😞

                              Hope someone can give me a hint here.

                              bullerwinsB 1 Reply Last reply Reply Quote 0
                              • bullerwinsB Offline
                                bullerwins @xerxist
                                last edited by

                                xerxist are you using Plex in docker or native install?

                                X 1 Reply Last reply Reply Quote 0
                                • X Offline
                                  xerxist @bullerwins
                                  last edited by xerxist

                                  bullerwins

                                  Tried docker/kubernetes Manjaro(just to switch to a later kernel)

                                  Changed it to run as root.
                                  Changed the permissions on the /dev/dri to 777.
                                  Its just weird as it clearly sees the device.

                                  4a999a7d-6686-415a-b940-5460c15326ea-image.png

                                  Actually got it to repond with FFMPEG

                                  ef83fdf3-1c6c-4f6a-96fb-e298e6ee504e-image.png

                                  It gives an error and the GPU stays like that so it hangs, which is what happens to Plex too I guess.

                                  1 Reply Last reply Reply Quote 0
                                  • tjkreidlT Offline
                                    tjkreidl Ambassador @bullerwins
                                    last edited by

                                    bullerwins Why would the driver have to be world writable (permissions 777) which seems like a security risk unless the /dev directory itself isn't. But still, a writable driver area seems very strange.

                                    X 1 Reply Last reply Reply Quote 0
                                    • X Offline
                                      xerxist @tjkreidl
                                      last edited by xerxist

                                      tjkreidl

                                      It was to rule out any permission problems.
                                      But it seems more on the iommu side of things where it goes wrong.
                                      I’ve just tried the same on proxmox and it works right away. (Well not right away, like you need to do some grub adjustments and load modules) Not sure 🤔 what I can do to fix it. Does the xcp ng kernel take these iommu grub settings too?

                                      GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt"

                                      and these modules

                                      vfio
                                      vfio_iommu_type1
                                      vfio_pci
                                      vfio_virqfd

                                      tjkreidlT 1 Reply Last reply Reply Quote 0
                                      • tjkreidlT Offline
                                        tjkreidl Ambassador @xerxist
                                        last edited by

                                        xerxist I honestly do not know, but it seems it cannot hurt to try.

                                        X 1 Reply Last reply Reply Quote 0
                                        • X Offline
                                          xerxist @tjkreidl
                                          last edited by xerxist

                                          Giving this another try 🙂

                                          tjkreidl

                                          I couldn't find those modules so this is probably not something in xcp-ng.

                                          bullerwins

                                          Is your vm running in EFI or BIOS?

                                          X bullerwinsB 2 Replies Last reply Reply Quote 0
                                          • X Offline
                                            xerxist @xerxist
                                            last edited by xerxist

                                            Got it working !!!!! 🙂

                                            Changed the VM from UEFI to BIOS and it started working.

                                            55120676-0c12-46cb-bdb3-7a986113f5c1-image.png

                                            Still though why would it need it be BIOS instead of UEFI

                                            Need to do some more testing as I also disabled something in the BIOS of the NUC11 for ASPM to so I'll bring up another VM with UEFI and test it again.

                                            tjkreidlT 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post