AMD PerfOpt iGPU bypass moves into IOMMU core for Linux 7.4
AMD's PerfOpt memory-bypass feature for integrated Radeon graphics is being rearchitected from an AMDGPU driver knob into the IOMMU subsystem's domain attachment path for cleaner integration and broader hardware coverage.
Summary
Linux 7.4-rc2 incorporates a restructuring of AMD's PerfOpt performance optimization, which allows integrated Radeon GPUs to bypass IOMMU translation when accessing system memory directly. The feature, which delivers measurable throughput gains particularly for AI and LLM workloads on AMD SoCs, previously required manual enablement through an amdgpu module parameter. With this revision, PerfOpt activation becomes automatic during IOMMU domain attachment for eligible iGPUs rather than relying on driver-specific policy interfaces.
The change affects AMD SoCs with integrated Radeon graphics across multiple hardware generations, not merely the latest designs. By shifting responsibility from the AMDGPU driver to the IOMMU core, the implementation eliminates the amdgpu.iommu_perfopt= parameter entirely and removes exported enable/disable callbacks. The patch also hardens state management around suspend, resume, crash kernel recovery, and VFIO translated domains where bypass must be explicitly cleared.
IOMMU integration and state management changes
- Domain-attachment activation: PerfOpt is now enabled from the IOMMU driver's domain attachment paths rather than through an AMDGPU policy knob, with eligible iGPUs marked during default identity domain selection.
- Capability setup simplification: For identity attachments, the code skips GCR3 setup and ATS/PRI/PASID enablement, reducing initialization overhead for bypass-eligible devices.
- Safety boundaries for translated domains: PerfOpt is explicitly cleared before attaching eligible GPUs to translated or blocked domains, including unmanaged VFIO domains, with failure propagation for bypass clear operations.
- Hardware-direct feature detection: Feature support is read directly from hardware rather than cached structures, which may be unavailable during early initialization; initialization aborts if the initial state clear fails.
- State persistence and cleanup: A boolean under the IOMMU lock tracks activation per-IOMMU, with state preserved across suspend/shutdown and restored only where previously active, plus explicit clearing during crash kernel device table reuse.
Why it matters
For Linux distribution maintainers and users running AI inference or compute workloads on AMD Ryzen mobile and desktop SoCs, this change means PerfOpt becomes a transparent, always-on optimization without manual tuning. The removal of the amdgpu.iommu_perfopt= parameter simplifies documentation and support, while the hardened state management around VFIO and crash kernels reduces the risk of memory isolation failures in virtualized or recovery scenarios. System administrators deploying AMD iGPUs for local LLM inference through ROCm or Mesa should see the same performance benefits with reduced configuration surface area when Linux 7.4 reaches stable release around late December.
Original reference: www.phoronix.com →