AMD 7900 XT Constant screen flickering between previous and current state

I have just upgraded from A to B:
NVIDIA RTX 3060ti → AMD 7900 XT
AMD 5600X → AMD 5800X3D

Here is my system info:

System:
  Kernel: 6.1.1-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    Desktop: GNOME v: 43.2 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: Micro-Star model: B550-A PRO (MS-7C56) v: 2.0
    serial: <superuser required> UEFI: American Megatrends LLC. v: A.82
    date: 08/05/2021
CPU:
  Info: 8-core model: AMD Ryzen 7 5800X3D bits: 64 type: MT MCP arch: Zen 3
    rev: 2 cache: L1: 512 KiB L2: 4 MiB L3: 96 MiB
  Speed (MHz): avg: 2382 high: 3400 min/max: 2200/3400 boost: enabled cores:
    1: 3400 2: 2720 3: 2200 4: 2200 5: 2200 6: 2200 7: 2200 8: 3400 9: 2200
    10: 2200 11: 2200 12: 2200 13: 2200 14: 2200 15: 2200 16: 2200
    bogomips: 108835
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Navi 31 [Radeon RX 7900 XT/7900 XTX] driver: amdgpu v: kernel
    arch: RDNA-3 bus-ID: 2d:00.0
  Display: wayland server: X.org v: 1.21.1.6 with: Xwayland v: 22.1.7
    compositor: gnome-shell driver: gpu: amdgpu resolution: 1: 1920x1080~60Hz
    2: 3440x1440~60Hz
  API: OpenGL v: 4.5 Mesa 22.3.1 renderer: llvmpipe (LLVM 14.0.6 256 bits)
    direct render: Yes
Audio:
  Device-1: AMD driver: snd_hda_intel v: kernel bus-ID: 5-1.1:3
  Device-2: AMD Starship/Matisse HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 2f:00.4
  Device-3: Cambridge Silicon Radio Audioengine 2+ type: USB
    driver: hid-generic,snd-usb-audio,usbhid
  Sound API: ALSA v: k6.1.1-1-MANJARO running: yes
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.63 running: yes
Network:
  Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel bus-ID: 04:00.0
  IF: wlp4s0 state: down mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Micro-Star MSI driver: r8169 v: kernel port: f000 bus-ID: 2a:00.0
  IF: enp42s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 1-2.1:5
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 4.12 TiB used: 34.61 GiB (0.8%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 PRO 500GB
    size: 465.76 GiB temp: 41.9 C
  ID-2: /dev/sda vendor: Seagate model: ST4000DM004-2CV104 size: 3.64 TiB
  ID-3: /dev/sdb type: USB vendor: SanDisk model: USB 3.2Gen1
    size: 28.65 GiB
Partition:
  ID-1: / size: 457.09 GiB used: 9.45 GiB (2.1%) fs: ext4 dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 299.4 MiB used: 312 KiB (0.1%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 38.9 C mobo: N/A gpu: amdgpu temp: 49.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 517
Info:
  Processes: 360 Uptime: 9m Memory: 31.27 GiB used: 2.52 GiB (8.0%)
  Init: systemd Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: 1212 Shell: Zsh
  v: 5.9 inxi: 3.3.24

The issue is that my screen is constantly flickering in between its current state and a previous state. Sometimes, it seems to calm down/reset itself, but other times there is a significant time difference between the two states (I can see the clock in the gnome bar flickering in between 16:40 and 16:42 currently)

It does this on both the USB live version and installed version. Hopefully someone knows far more than me and can help with this.

I haven’t tried forcing x11 instead of Wayland yet, but considering it does this even at the login screen, I don’t believe that is the issue at this point.

P.S I am currently on a clean install. Edit. I have tried x11, it is the same/worse and the pointer doesn’t render

Hi @Wolfick, and welcome!

Accorfing to the Arch wiki article about KDE:

Flickering in fullscreen when compositing is enabled

In System Settings > Display and Monitor > Compositor, uncheck Compositing: Allow applications to block compositing. This may harm performance.

Also, there might be something useful in the Arch wiki article on amdgpu:

https://wiki.archlinux.org/title/AMDGPU

Hope this helps!

Edit:

Although not the same card, have a look here:

https://askubuntu.com/questions/1270565/20-04-display-flickering-with-amd-drivers

Edit #2:

Should none of these work, please com back and reply with the outputs of:

xrandr

Unfortunately I am using Gnome not KDE.

I have gone through the amdgpu installations, including trying to grab the proprietary drivers, but nothing seems to be working. Neither does that other person on askubuntu.

The output for xrandr:

Screen 0: minimum 16 x 16, current 3440 x 1440, maximum 32767 x 32767
XWAYLAND0 connected primary 3440x1440+0+0 (normal left inverted right x axis y axis) 820mm x 350mm
   3440x1440     59.94*+
   1920x1440     59.90  
   1600x1200     59.87  
   1440x1080     59.87  
   1400x1050     59.86  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.78  
   1024x768      59.68  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1920x1200     59.88  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   720x480       59.71  
   640x400       59.20  
   320x200       58.96  
   2560x1440     59.91  
   2048x1152     59.90  
   1920x1080     59.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77

I currently only have the one monitor pluggled in until I can resolve the issue.

Hope that doesn’t take long!

40+ hours in of research and work and here I am. Hopefully my toil will be of assistance towards others here for the same help, much of which I am sure has been stated many times and I am just rehashing.

Disclaimer: The distros tested have been Ubuntu, Manjaro-{gnome, kde, xfce}, Pop OS, Arch. The main distro tested and I am most familiar with is manjaro-gnome. If you are here for a different distro, this may or may not be helpful.

I found that these cards work perfectly fine with ubuntu out of the box, but I was locked at only being able to use one monitor, and additional monitors simply not being detected by the software. I have not tested any further than this. Pop OS, also being debian based, shares the same issue I had with ubuntu in which I could only output to a single monitor.

What you need in order to make the 7900 XT, or apparently the XTX, work correctly is LLVM 15+ and Mesa 23+

As all the current distros come with LLVM 14, you will not be able to get it to work on a basic installation. The older radeon drivers will cause it to hang as soon as amdgpu loads, and you won’t even be able to load the installers. I don’t know why Manjaro-gnome is an exception to this, but what is installed is not in a functional state.

It may be possible to deconstruct manjaro-gnome enough that a new llvm and mesa can be compiled, but I ran into a dependency train starting at Clang which was a giant road block.

You can boot any of these distros that freeze by passing nomodeset in the boot options, but this can have issues with software to my knowledge so it isn’t a viable means of making the GPU functional.

My approach was to build an entirely new Arch installation, the below of which should be of assistance to you.

Part A

Arch Installation

Install a new copy of Arch using the Arch Installation Guide Wiki with the following adjustments:

In section 2.2, include base-devel and git, so your command will look like this:

# pacstrap -K /mnt base linux linux-firmware base-devel git

Continue with installation as per normal, or if you are new to this process, refer back to the documentation in the installation guide for assistance.

DO NOT install any package that depends on mesa or llvm during this process. It will download the older version from the main repositories, which is not what you want. Make sure you check the packages that are going to be installed before continuing any package installation.

Booting into the new install

Note: You will need to do this from a user profile, so if you haven’t created a user yet, now is the time. You cannot build a package (makepkg) as root.

From here, the first task is to build LLVM and Mesa. As of this post, the official repos (pacman -Syu) do not have the versions you need, so you will need to install them directly from the AUR.

LLVM-gitAUR
Mesa-gitAUR

I simply cloned these into the /opt directory, but it is entirely up to you were you do this. Once you are where you wish to build the files, you simply need to do the following three commands:

# git clone https://aur.archlinux.org/llvm-git.git
# cd llvm-git
# makepkg -si

Just keep hitting enter to select the default options. The compiling will likely take 1h or longer so don’t worry. This is normal, just let it do its thing.

After that, go back to the directory you are cloning the packages into and do the following:

# git clone https://aur.archlinux.org/mesa-git.git
# cd mesa-git
# MESA_WHICH_LLVM=2 makepkg -si

If you installed llvm-minimal-git, you would instead do MESA_WHICH_LLVM=1

This will also take a long time.

Congratulations

You are now ready to install whatever desktop environment/window manager/compositor etc that you want, as well as whatever else you need.

Troubleshooting

Build Freezing

Should LLVM or Mesa freeze and stop running during the build process, most likely during the testing phases iirc, it is possible that you are running out of memory as can be seen here and here.

You can reduce the number of threads being used for the build by following this: How do I limit cpu core usage for makepkg

Or, you can add ‘taskset --cpu-list 0-11’ before the makepkg command. You will need to adjust the 0-11 to the number of threads you have available on your cpu and wish to use. This fixed my llvm build freezing with the following command for example:

taskset --cpu-list 0-11 makepkg -si

You can read more in this forum thread: Ninja Overburdening System

Build Error

Read the message, and what failed. It is possible there is a package llvm or mesa are trying to use that you haven’t installed. Install that package and run the ‘makepkg -si’ line again.

#Part B
##Drivers

This part is more of just information, rather than help. Refer to the amdgpu wiki article @Mirdarthos has included a link for as a first step to any trouble shooting. You are now under 2.1 Experimental

You may still need to install the lib32 variants of llvm and mesa, which my computer unironically failed to build and failed at the check(). Hydrapaper had the same issue and I passed an unethical --nocheck to circumvent it, so maybe I will be a repeat criminal. Do as I say, not as I do.

It is probably a good idea to install the xf86-video-amdgpu-gitAUR package however.

Unfortunately, the vulkan-radeon-git package mentioned here does not exist any longer, and there are issues with the other packages at the time of this post. Even more unfortunate, is that for some reason you require vulkan support to play any games on Steam that use DX11 or DX12 (The Witcher 3 and Elden Ring are included in this category. Maybe Cyberpunk too, but I do not own that so didn’t try)

I found vulkan-radeon to conflict with mesa-git and could not be installed, but amdvlk and vulkan-amdgpu-proAUR can be installed. amdvlk apparently has issues, but I find the proprietary amdgpu-pro to be no better in testing them.

More bad news, the drivers are not in a state to properly engage the GPU in these Direct X games. Here are some metrics:

This is The Witcher on DX12 (Less than 1fps): It is also worth noting that ray tracing cannot even be turned on.

This is The Witcher on DX11 (20fps? The GPU can be seen to be much more engaged, but it is extremely choppy gameplay and not a good experience. Perfectly fine if you are just standing stationary though!)

This is Elden Ring (Performance was stable momentarily but would drop to about 10fps or less)

For reference, here is a perfectly healthy Doom Eternal that runs on Vulkan, and performs at an easy 130-160fps on ultra+ settings with ray tracing enabled.

Conclusion

Now, I am sure there is a way to fix this, perhaps it is just a single steam Launch Option that needs to be put into the games’ settings. The issue may also be directly tied to the power management of the GPU. Maybe once I ensure I have installed the lib32 llvm and mesa, it will just work, computers be computers. Alas, I do not have a solution for you if this is where you are stuck.

Once the main distros are packaged with llvm 15 or later, the compatibility of these cards should see a great improvement in working out of the box, while the drivers will also likely improve. With the Ubuntu 23.04 release, I have high expectations the multi monitor would no longer be an issue, which should pass on to Pop OS and any other debian build.

I can only hope that future releases of mesa would resolve the issue with direct x games out of the box, but that is just my personal feelings.

I saw a reference from amd that they were making adjustments to their drivers as well (or maybe it was someone else), so they will be able to select which driver to use better and you will no longer need to pass nomodeset to boot as well.

P.S There are also some helpful reddit posts you can browse through of other early adopters also troubleshooting.

I hope this has been helpful for you.

Thanks! This helped me to get my 7900 XTX up and running after several attempts with other guides.

I only had to manually remove/reinstall some dependencies or the pacman -U llvm-… command would fail, but that was pretty much it!

thanks again :wink:
-mudo