intel / linux-intel-lts

Intel LTS kernel
Other
197 stars 111 forks source link

SR-IOV: mainlining? #33

Open jgcodes2020 opened 2 years ago

jgcodes2020 commented 2 years ago

Since drivers for SR-IOV have already been completed in this fork, could these drivers be mainlined into the kernel?

darkbasic commented 9 months ago

Most of you probably already know this but before getting too excited about mainline SR-IOV I would read this post by an AMD developer.

SR-IOV virtual functions (VFs) are not the same as physical functions (PFs). You need explicit support for the VF in the KMDs for every OS you want to run in a VM. You can't just use the regular bare metal drivers.

He is basically suggesting that AMD's Windows drivers don't support SR-IOV, thus making the whole thing pointless for most of us. If the same stands true for the Intel Windows drivers you might not have an use case case for a mainline SR-IOV kernel.

rouke-broersma commented 9 months ago

Most of you probably already know this but before getting too excited about mainline SR-IOV I would read this post by an AMD developer.

SR-IOV virtual functions (VFs) are not the same as physical functions (PFs). You need explicit support for the VF in the KMDs for every OS you want to run in a VM. You can't just use the regular bare metal drivers.

He is basically suggesting that AMD's Windows drivers don't support SR-IOV, thus making the whole thing pointless for most of us. If the same stands true for the Intel Windows drivers you might not have an use case case for a mainline SR-IOV kernel.

Who cares about using this with windows

darkbasic commented 9 months ago

Who cares about using this with windows

I would love to use it to virtualize OSX when I need to target such platform but apparently this is not an option.

stereomato commented 9 months ago

@darkbasic https://github.com/intel/linux-intel-lts/issues/33#issuecomment-1326178155 <- right here in this thread someone got it to work fine on windows so I'd assume that Intel's drivers support it?

plantroon commented 8 months ago

@darkbasic #33 (comment) <- right here in this thread someone got it to work fine on windows so I'd assume that Intel's drivers support it?

Not a chance. macOS might soon drop Intel support altogether and there's not a single Mac with Intel Xe graphics. Unless the community makes the drivers somehow, we'll never have it. Even nVidia GPUs aren't supported since High Sierra.

But the Windows side works fine. With this specific kernel.

stereomato commented 8 months ago

@darkbasic #33 (comment) <- right here in this thread someone got it to work fine on windows so I'd assume that Intel's drivers support it?

Not a chance. macOS might soon drop Intel support altogether and there's not a single Mac with Intel Xe graphics. Unless the community makes the drivers somehow, we'll never have it. Even nVidia GPUs aren't supported since High Sierra.

But the Windows side works fine. With this specific kernel.

i mean, yeah windows drivers DO support it, and that's what most people care about I assume. Shucks about macOS, but it'd be dumb to expect macOS to support this properly

webczat commented 7 months ago

ping, any progress?

stereomato commented 7 months ago

yeah, wasnt this supposed to land in q4 2023? This is a pretty nice feature that friends I have would love to use, but... not yet mainstreamed.

Coder84619 commented 7 months ago

ya what happened?

webczat commented 7 months ago

i mean, there was a comment above saying it's postponed due to drm interface changes. However no one said for how long. and until this year I hoped it will not be that long :)

plantroon commented 6 months ago

I read somewhere that the kernel 6.8 will have this, but seems like that's not happening?

If this gets merged (or if it already is?) there seems to be something regarding VF ... https://gitlab.freedesktop.org/drm/xe/kernel/-/commits/drm-xe-next

ownaginatious commented 6 months ago

Tangentially related: anyone know if there are there any interim software based solutions for partitioning 13th/14th gen Intel iGPUs until this lands? I just want to be able to pass the hardware encoding capabilities to more than one VM 😅

plantroon commented 6 months ago

Tangentially related: anyone know if there are there any interim software based solutions for partitioning 13th/14th gen Intel iGPUs until this lands? I just want to be able to pass the hardware encoding capabilities to more than one VM 😅

Kernel 6.1 or whatever older that is known/confirmed working in this thread or similar...

I am testing the Intel Xe driver from kernel 6.8 RC5, even got mesa-git and all that, and it can't even show a desktop without drawing GPU rainbow art all over it. But I bet I am doing something wrong as Phoronix already ran tests on it. But nothing was announced, it is experimental, so I had no expectations.

Still, until the Xe driver matures, they should've at least got i915 working reliably (ie no suspend issues) in mainline. I wish I could sell my laptop at this point and buy something older that at least has gvt-g working. They removed a feature for which they don't have a replacement 2 years later. Basically these GPUs have sriov support, but it was never made properly functional in any software. Hyper-V has it partially working, but it's apparent it was more focused on Windows Sandbox and WSL-g.

johntdavis84 commented 4 months ago

Any updates on SR-IOV and kernel 6.8? It's getting rolled into Proxmox 8.2, and I'd really like to be able to use SR-IOV with my Alder Lake i5-12500T iGPU without having to do the dkms-based wizardry here (that has to be done every time Proxmox updates the kernel at all...which is a lot).

See: https://www.derekseaman.com/2023/11/proxmox-ve-8-1-windows-11-vgpu-vt-d-passthrough-with-intel-alder-lake.html

Daniel15 commented 4 months ago

If the same stands true for the Intel Windows drivers you might not have an use case case for a mainline SR-IOV kernel.

@darkbasic SR-IOV seems to work fine with Intel's Windows drivers. I have an Unraid server on Linux 6.1.x, running a Windows Server 2022 VM for Blue Iris, and have no trouble using hardware accelerated video encoding/decoding in the VM. I haven't tried anything graphically intensive, but I can definitely see the iGPU being used for video encoding/decoding.

adapt-L commented 2 months ago

https://www.phoronix.com/news/Linux-6.11-DRM-Intel-Xe-Next

johntdavis84 commented 1 month ago

https://www.phoronix.com/news/Linux-6.11-DRM-Intel-Xe-Next

Thanks. :)

I see these updates, and they're always "preparing for SR-IOV" and talking about how once released the Xe driver won't be the default. Given that these news releases focus on Xe2-based GPUs and other newer hardware, I'm not quite sure how to predict what we'll actually get.

If Xe is not the default, but complete, should we just be able to switch to it somehow (instead of using i915) and have SR-IOV just start working so long as its enabled in the BIOS and everything else is configured correctly?

I'm trying to get a better understanding of when the current DKMS approach won't be needed anymore for 12th+ gen iGPUs.

jgcodes2020 commented 1 month ago

It's been over 2 years since I first opened this issue, can someone from Intel give us an update as to which drivers (Xe or i915) will support SR-IOV and when?

myownfriend commented 1 month ago

I really wish they'd surprise us and have this enabled on the A770 but I'm not counting on it.

Daniel15 commented 1 month ago

It's been over 2 years since I first opened this issue, can someone from Intel give us an update as to which drivers (Xe or i915) will support SR-IOV and when?

You might have seen it already, but the DKMS module for i915 SR-IOV support was recently updated to support kernel versions up to 6.9: https://github.com/strongtz/i915-sriov-dkms. It previously only supported up to 6.5.

johntdavis84 commented 1 month ago

It's been over 2 years since I first opened this issue, can someone from Intel give us an update as to which drivers (Xe or i915) will support SR-IOV and when?

You might have seen it already, but the DKMS module for i915 SR-IOV support was recently updated to support kernel versions up to 6.9: https://github.com/strongtz/i915-sriov-dkms. It previously only supported up to 6.5.

Yes. I'm hoping. to test this soon. :)

Meanwhile: https://www.phoronix.com/news/Intel-Xe-DRM-Next-Linux-6.12 Intel is targeting Kernel 6.12 for "Intel Xe2 Lunar Lake & Battlemage Graphics," and also "further support for SR-IOV."

jonas5 commented 1 week ago

Hello!

The latest kernel tree from intel seems to work with SR-IOV on A770. It is based on the 6.11.0-rc2 kernel version, you might want to compile this manually.

You can find this kernel tree here: https://gitlab.freedesktop.org/drm/xe/kernel

Screenshot from 2024-08-27 16-40-11

This is what i used for my configs:

/etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on kvm.ignore_msrs=1 vfio_pci.ids=8086:56a0,8086:4f90 pcie_aspm=off"

/etc/modprobe.d/blacklist.conf

blacklist i915
blacklist xe
blacklist snd_hda_intel
adapt-L commented 1 week ago

@jonas5 nice, but you blacklist xe? Did you compile xe as built-in instead of a module?

johntdavis84 commented 1 week ago

This is great news!

Hopefully this will eventually come to the 12th and 13th gen iGPUs, as well. I would love to be able to use SR-IOV on Proxmox without a DKMS kernel driver.

From this and some other things I’ve read, it seems like they’re shooting for 6.12 to have this stable and working, if not default.

On Aug 27, 2024, at 10:46 AM, jonas5 @.***> wrote:

Hello!

The latest kernel tree from intel seems to work with SR-IOV on A770. It is based on the 6.11.0-rc2 kernel version, you might want to compile this manually.

You can find this kernel tree here: https://gitlab.freedesktop.org/drm/xe/kernel

Screenshot.from.2024-08-27.16-40-11.png (view on web) https://github.com/user-attachments/assets/79a6d85a-0692-400a-adbd-5d68ca011c4d This is what i used for my configs:

/etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on kvm.ignore_msrs=1 vfio_pci.ids=8086:56a0,8086:4f90 pcie_aspm=off"

/etc/modprobe.d/blacklist.conf

blacklist i915 blacklist xe blacklist snd_hda_intel — Reply to this email directly, view it on GitHub https://github.com/intel/linux-intel-lts/issues/33#issuecomment-2312924349, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGI5CYQ7XQ6XQLZHFDI6WK3ZTSNPFAVCNFSM5Z63XG72U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMZRGI4TENBTGQ4Q. You are receiving this because you commented.

darkbasic commented 1 week ago

The latest kernel tree from intel seems to work with SR-IOV on A770

That would be huge because Intel stated multiple times that A770 doesn't support SR-IOV. Can someone else please confirm this?

adapt-L commented 3 days ago

The latest kernel tree from intel seems to work with SR-IOV on A770

That would be huge because Intel stated multiple times that A770 doesn't support SR-IOV. Can someone else please confirm this?

https://www.phoronix.com/news/Intel-Xe-Driver-SR-IOV-Plans

https://lore.kernel.org/dri-devel/20231110182231.1730-1-michal.wajdeczko@intel.com/

SR-IOV Platforms
================

Initially we plan to add SR-IOV functionality to the following SDV platforms
already supported by the Xe driver:

 - TGL (up to 7 VFs)
 - ADL (up to 7 VFs)
 - MTL (up to 7 VFs)
 - ATSM (up to 31 VFs)
 - PVC (up to 63 VFs)

Newer platforms will be supported later, but we hope that enabling will be
much faster, as majority of the driver changes are either platform agnostic
or are similar between earlier platforms (hence we start with SDVs).

Looks like Tigerlake, Alderlake, Meteorlake, Arctic Sound M, Ponte Vecchio respectively

rhysperry111 commented 2 days ago

It'd be nice to have some sort of official statement about where everything's at with this.

I'm trying to get SRIOV working with the iGPU on my Raptor Lake laptop, am on kernel 6.10 and have manually switched over to the xe driver and yet I can't seem to find a way to get it to work. It'd at least be nice to know if (or when) it'll be possible

PerAstraAdDeum commented 2 days ago

It'd be nice to have some sort of official statement about where everything's at with this.

I'm trying to get SRIOV working with the iGPU on my Raptor Lake laptop, am on kernel 6.10 and have manually switched over to the xe driver and yet I can't seem to find a way to get it to work. It'd at least be nice to know if (or when) it'll be possible

I'd love to hear that too. Has anyone made it work? If so, how?

Daniel15 commented 2 days ago

It'd be nice to have some sort of official statement about where everything's at with this.

I'm trying to get SRIOV working with the iGPU on my Raptor Lake laptop, am on kernel 6.10 and have manually switched over to the xe driver and yet I can't seem to find a way to get it to work. It'd at least be nice to know if (or when) it'll be possible

As far as I know, they're targeting Linux 6.12. Someone earlier in the comments got it working with an A770 using 6.11.0-rc2.

Having said that, Raptor Lake is not in the initial support list that @adapt-L posted above.

PerAstraAdDeum commented 2 days ago

It'd be nice to have some sort of official statement about where everything's at with this. I'm trying to get SRIOV working with the iGPU on my Raptor Lake laptop, am on kernel 6.10 and have manually switched over to the xe driver and yet I can't seem to find a way to get it to work. It'd at least be nice to know if (or when) it'll be possible

As far as I know, they're targeting Linux 6.12. Someone earlier in the comments got it working with an A770 using 6.11.0-rc2.

Having said that, Raptor Lake is not in the initial support list that @adapt-L posted above.

Sorry, but doesn't these two statements conflict with each other? From what I've read, Intel Arc Alchemist dGPUs aren't on the list that @adapt-L posted either, or am I misreading that? And I'd assume that Raptor-Lake is closer to ADL (which is on the list) then Arc Alchemist dGPUs?

Other than that, I hope SR-IOV is finally mainlined with 6.12!

rayzorben commented 1 day ago

It'd be nice to have some sort of official statement about where everything's at with this. I'm trying to get SRIOV working with the iGPU on my Raptor Lake laptop, am on kernel 6.10 and have manually switched over to the xe driver and yet I can't seem to find a way to get it to work. It'd at least be nice to know if (or when) it'll be possible

I'd love to hear that too. Has anyone made it work? If so, how?

I would like to know the answer to this question myself. I don't care 'if' it is supported but 'when' it is supported, how is this intended to be enabled? I am running the xe driver, I have enabled iommu I have set max_vfs on the kernel command line and I have tried setting sriov_numvfs to 7 in sysfs.conf as well as trying to write it to the file directly, but it is not working. Which is fine if it is not intending to work yet, but I want to know what the correct way of doing this is.

I am on 6.11.0-rc6-1

adapt-L commented 1 day ago

I think "Newer platforms will be supported later" suggests it may be possible, but unlikely considering that support is not listed on intel's site: https://www.intel.com/content/www/us/en/support/articles/000093216/graphics/processor-graphics.html

But Tigerlake is also listed as unsupported there and listed as planned to be supported in the patch note I just linked, so who knows.

But if you want a dedicated card today that supports SRIOV I think there are some old AMD workstation cards that do that.

I'm still waiting for it to be mainlined cause I don't really feel like adding experimental patches to my kernel and its been like 2 years already

Daniel15 commented 1 day ago

cause I don't really feel like adding experimental patches to my kernel

@adapt-L As far as I know, the Intel LTS kernel (the one this issue is in) supports SR-IOV with the i915 driver. If you don't want to patch your kernel or use the DKMS module that was extracted from this kernel (https://github.com/strongtz/i915-sriov-dkms), you could just run this kernel directly.