Fix visual artifact on Linux running AMD 3400G

Fix visual artifact on Linux running AMD 3400G

I did a mini-itx build with AMD 3400G. It works great except occasionaly visual artifacts which affected Firefox the most when watching videos. The problem is solved by disabling IOMMU. I verfied that setting kernel parameter iommu=pt also works.

https://en.wikipedia.org/wiki/Input%E2%80%93output_memory_management_unit

IOMMU is just like MMU which provides memory virtualization but for PCI devices instead of CPU. AMD 3400G has an integrated graphics card, which has to use system main memory. IOMMU provides extra protection but it also slows things down due to this extra step of virtual-physical memory translation. I do not use VMs on this machine, so I really don't need IOMMU. DMA (direct memory access) from the graphics card would be much faster.

There's a kernel parameter amd_iommu https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html?highlight=amd_iommu, which I just set it to off in /etc/default/grub. Visual artifacts are gone after update-grub and reboot.