Of the many exciting changes in Linux 7.4, one of the exciting out-of-the-box performance improvements is the new "PerfOpt" functionality for AMD SoCs with integrated Radeon graphics. AMD PerfOpt can deliver some nice iGPU performance improvements especially for AI/LLM workloads. With today's Linux 7.4-rc2 kernel release there are a few tweaks to the PerfOpt code in the IOMMU area. AMD PerfOpt allows the integrated GPU to bypass the IOMMU when directly accessing system memory. This is enabled by default for the AMDGPU driver with iGPUs. The feature isn't limited to just the newest and best Radeon iGPUs but is even delivering performance gains for prior-gen hardware too. Via this week's IOMMU fixes pull request are a few tweaks to the PerfOpt code. AMD Linux engineer Mario Limonciello explained of the changes with the patch now merged to Linux Git: "PerfOpt is usable by integrated GPUs in identity mode. Enable it from the IOMMU driver's domain attachment paths instead of requiring an amdgpu policy knob and exported enable/disable interfaces. Mark supported integrated GPUs as PerfOpt-eligible when selecting their default identity domain. Skip GCR3 setup and ATS/PRI/PASID enablement for these identity attachments, then enable PerfOpt after installing the DTE. Clear PerfOpt before attaching an eligible GPU to a translated or blocked domain, including unmanaged domains used by VFIO. Propagate failures to clear bypass, but keep a completed identity attachment successful if the optional PerfOpt enable fails. Clear inherited PerfOpt state during initialization, including when a crash kernel reuses device tables. Read feature support directly from hardware because cached features may not be available yet, and stop initialization if the initial clear fails. Each IOMMU has at most one PerfOpt-eligible GPU, so track activation with a boolean under the IOMMU lock. Preserve this state while clearing hardware at suspend and shutdown, and restore the bit on resume only where it was active. Do not enable PerfOpt unconditionally during early IOMMU initialization. Remove the amdgpu parameter, driver callbacks, and exported interfaces. Translated attachments retain their normal device capability setup." The amdgpu.iommu_perfopt= module parameter is now removed for those that missed out on the opportunity for directly comparing the performance impact of PerfOpt on their hardware. In any event look for this useful improvement with Linux 7.4, which should be out in stable form around the end of December. Linux 7.4-rc2 with this code is expected for release later today for testing.
AMD PerfOpt Performance Boosting Code Tweaked For Linux 7.4-rc2
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.