Graphics glitches and artifacts with Ryzen 5 3400G APU

7,910

Solution 1

Same problems can be observed with Ubuntu 20.04 LTS / Ryzen 3 3200G / Gigabyte B450M S2H / 16GB (2x8GB) DDR4 3200.

Workaround 1:

Disable IOMMU in BIOS.

Workaround 2:

Add iommu=pt to command line in /etc/default/grub following the steps below.

  1. Run

    sudo nano /etc/default/grub
    
  2. Make the GRUB_CMDLINE_LINUX_DEFAULT line look like this

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash iommu=pt"
    
  3. Update grub by

    sudo update-grub
    
  4. Reboot with

    sudo reboot
    

Solution 2

Is there a third workaround ?

The prompt is displayed ok (same picture on both screen) Then my display is sliced horizontally Each slice is shifted

I disabled IOMMU in the bios, changed the grub conf Activated dual screen in bios too.

HDMI monitor on HDMI (full hd) VGA monitor on HDMI>VGA on a DP>HDMI passive adapter (1650x ???) This is not a hardware issue or bios setting issue as I have dual screen working

Fresh ubuntu 20.04 install with kernel 5.4

Found a 3rd workaround with this video https://www.youtube.com/watch?v=WWg8q_f7nI4

Solution 3

I'm currently using Ubuntu 20.10

While support for these devices has been in the kernel for a while, I've found I've had missing firmware when I see an update-initramfs. I also saw some AMDGPU-specific commits to upstream linux-firmware a little while ago, and tried the latest available deb package for Hirsute - it fixed all of my weird issues with the system, including requiring software IOMMU

YMMV, but try the 1.191 deb package under https://launchpad.net/ubuntu/+source/linux-firmware

Edit: step by step instructions as requested!

  1. Navigate to https://launchpad.net/ubuntu/+source/linux-firmware
  2. Expand the 1.191 arrow, under The Hirsute Hippo branch
  3. Download linux-firmware_1.191_all.deb
  4. Install the new firmware
    sudo apt install /path/to/linux-firmware_1.191_all.deb
  5. Reboot

Edit2: For reference, I have two AMD systems this really helped with. One is a Dell Inspiron 5585 w/ AMD Ryzen 3500U, the other is one I built with an AMD Ryzen 3400G.

Share:
7,910

Related videos on Youtube

James
Author by

James

Updated on September 18, 2022

Comments

  • James
    James almost 2 years

    I built a new computer and am now getting weird graphics glitches when browsing the web or streaming video in a browser.

    https://i.imgur.com/hJJm5aY.png

    https://i.imgur.com/X74isqn.png

    https://i.imgur.com/2ka12zm.mp4 (this one isn't mine, but similar to what is happening to me)

    My setup:

    Ryzen 5 3400G processor with integrated graphics

    Gigabyte B450M DS3H motherboard (BIOS is updated with latest firmware), 16GB (2x8GB) DDR4 3200

    Connected to Samsung Q70R QLED Smart 4K TV (old computer and HDMI cable worked fine with this TV)

    I have tried many of the fixes that I found searching online, but none of them seem to completely fix the problem. I have tried fresh installs of the latest Ubuntu 18.04 and 20.04 versions. I have tried a couple methods of updating or changing the kernel versions. Changing resolutions, refresh rates, or scaling does not fix the issue.

    Current configuration after fresh 20.04 install:

    lsb_release -a

    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04 LTS
    Release:    20.04
    Codename:   focal
    

    uname -a

    Linux media-server 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    

    lspci | grep VGA

    07:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Picasso (rev c8)
    

    sudo lshw -c video

    *-display                 
           description: VGA compatible controller
           product: Picasso
           vendor: Advanced Micro Devices, Inc. [AMD/ATI]
           physical id: 0
           bus info: pci@0000:07:00.0
           version: c8
           width: 64 bits
           clock: 33MHz
           capabilities: pm pciexpress msi msix vga_controller bus_master cap_list rom
           configuration: driver=amdgpu latency=0
           resources: irq:101 memory:e0000000-efffffff memory:f0000000-f01fffff ioport:e000(size=256) memory:fcb00000-fcb7ffff memory:c0000-dffff
    
  • James
    James about 4 years
    Disabling IOMMU in the BIOS completely fixed the issue on my setup (Ubuntu 18.04 LTS / Ryzen 5 3400G / Gigabyte B450M DS3H / 16GB (2x8GB) DDR4 3200). Thank you so much for the response!
  • mahela007
    mahela007 about 4 years
    What does disabling this do?
  • Matteo
    Matteo about 4 years
    my setup too was fixed by adding iommu=pt. my configuration is ubuntu 20, ryzen 3200g, Gigabyte GA-AB350M-DS3H, thanks a lot
  • graffe
    graffe almost 4 years
    I also had to add iommu=pt on my ryzen 3400g. I would love to see a detailed technical explanation of why this fixes the problem!
  • Matthew
    Matthew over 3 years
    Could you please clarify what system you tested this on? It would be helpful to know a motherboard + APU combination that definitely works. And to have confirmation that you are using the integrated graphics, not a dedicated GPU.
  • Matthew
    Matthew over 3 years
    Have you tested this workaround on an APU, please? The video seems to be about AMD dedicated GPUs, which work very differently.
  • Jerome_B
    Jerome_B over 3 years
    My hw is a B550 motherboard with a ryzen5 3400G (an APU) Since then, plenty of updates have reached my install like new linux firmware packages. I also gave 2G Ram for the graphics (at bios level). It was weird and angrying as dual screen worked on windows.
  • Matthew
    Matthew over 3 years
    Thank you for confirming that you are using an APU. I have just bought a 3400G so it is very helpful to know that the 3rd workaround can be used.
  • Lyndon
    Lyndon over 3 years
    Sure thing, info added!
  • Matthew
    Matthew over 3 years
    Thank you. I have just bought a 3400G to use with Ubuntu. Would you mind sharing what what motherboard you have found works? I have bought a B450 Mortar Max, but it's not too late for me to return it.
  • Lyndon
    Lyndon over 3 years
    Matthew, I'm personally using an ASUS Prime A320I-K motherboard, with the AMD A320 chipset. That said, your B450 should be fine, and the process I've described for adding the newer AMD firmware should work for you
  • Matthew
    Matthew over 3 years
    I tried this workaround. Unfortunately it did not fix my graphics problem. However, my problem is slightly different: the graphics freeze and the system log reports *ERROR* Waiting for fences timed out!, as per this bug.