Score:0

swap xorg video driver from amdgpu to radeon

sl flag

The latest Kernel update Linux 5.15.0-53-generic introduced a bug, breaking the radeon driver for the AMD Ryzen 3 2200G with Radeon Vega Graphics. It booted to a just black screen. I tried installing AMD's drivers with apt install amdgpu or amdgpu-install. After a lot of troubleshooting it didn't throw an error and installed. On reboot the drivers didn't seem to work properly. Everything looked exactly like when disabling all video drivers with nomodeset.

This post lead me to the conclusion I need to choose the older kernel in grub. But again, everything looked like when enabling nomodeset, even though I didn't. Further investigation showed me, that my integrated graphics actually don't need the amdgpu driver, but xserver-xorg-video-radeon.

But X11 clearly loads amdgpu instead of radeon.

$ lspci -k | grep -EA3 'VGA|3D|Display'

0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] (rev c8)
    Subsystem: Gigabyte Technology Co., Ltd Radeon RX Vega 11
    Kernel modules: amdgpu

So I probably configured the wrong drivers somehow, instead of fixing my initial problem.

-Processor-
AMD Ryzen 3 2200G with Radeon Vega Graphics

-Version-
Kernel      : Linux 5.15.0-53-generic (x86_64)
Version     : #59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022
C Library   : GNU C Library / (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
Distribution: Ubuntu 22.04.1 LTS

-Display-
Resolution  : 1024x768 pixels
Vendor      : The X.Org Foundation
Version     : 1.21.1.3
Current Display Name: :1

-Monitors-
Monitor 0   : 1024x768 pixels

-OpenGL-
Vendor      : (Unknown)
Renderer    : (Unknown)
Version     : (Unknown)
Direct Rendering: No

Am I right to assume I need to somehow change the video driver of my xserver? And if so, how can I safely do so? Currently everything looks like no graphics driver have been loaded.

Score:1
vg flag

This post lead me to the conclusion I need to choose the older kernel in grub.

This is the one of the two valid solutions.

You should report the bug to Canonical if it hasn't reported already, meanwhile use the older kernel (by freezing upgrades via Synaptic) and wait until an updated kernel that works on your system is ready.

You can try a PPA mainline kernel though.

The second valid solution is installing amdgpu-pro from AMD, which is an alternate driver. However I would not recommend it, since a lot of users end up having trouble with it, and if you're not fluent with the CLI, it gets hard to restore a graphical interface if things go wrong.

It's hit or miss.

radeon vs amdgpu

You can't use the radeon driver for your GPU. That driver is an older one written to work with Radeon HD 2000-6000 series and first-generation GCN cards (e.g. Radeon HD 7770, Radeon R9 280, etc).

The amdgpu driver is a newer driver that works with all GCN and RDNA chips.

Your Vega chip is the last GPU with GCN architecture, and it won't work with radeon. Trying to force it could either not work or lead to HW damage.

Driver architecture explanation

It seems you are confused so I'll explain what's going on: Your AMD drivers in Linux have 2 components: kernel space and user space.

Kernel-space drivers are shipped alongside with the kernel. When a bug is introduced, they're tied to the kernel version. Kernel bugs like these get often fixed quickly upstream (in days or weeks), but Ubuntu takes its time (often a few months) due to how backporting changes from upstream kernel works in Ubuntu.

From what you are mentioning, this is the cause of the problem.

User-space drivers are shipped separately with Mesa and X11 packages. Since the problem lies in the Kernel section of the drivers, messing with these packages won't fix it and you risk breaking up something by accident.

Update

OK from your reply you said that you downgraded your kernel and it still didn't work.

First, make sure you're actually downgraded via:

uname -r

You can try multiple Kernel versions by going to GRUB -> Advanced options for Ubuntu and start selecting the other versions.

OK, so assuming that won't work the next thing to try/suspect:

Your Xorg logs

Post the contents of /var/log/Xorg.0.log. It may contain valuable info.

Since you boot to a black screen, you can try switching to tty (Ctrl + Alt + F2)

If the keyboard is unresponsive, then boot into safe mode, install openssh-server, reboot into normal node, and control your computer from a 2nd computer.

Make sure amdgpu module is loaded

Run:

lsmod | grep amdgpu

It should have hits and amdgpu should be in use.

If it's not there then run:

sudo modprobe amdgpu

If that fails, check dmesg.

Restart your DM

Sometimes there is a race condition in loading your drivers, and the real problem is that your DM started before your GPU drivers were ready. So the DM crashed.

I've personally run into this problem: Half of the time, at random, I would boot into a black screen and the keyboard would be dead. However the following command from an SSH session would restore my computer.

I don't know which DM you use so one of these commands should be the one for you:

sudo service lightdm restart
sudo service gdm3 restart
sudo service sddm restart

Add amdgpu firmware to initramfs so it's available early

This is a fix to the mentioned race condition in the previous item.

Run the following:

echo "amdgpu" | sudo tee --append /etc/initramfs-tools/modules
sudo update-initramfs -c -k $(uname -r)

If done properly then to check it worked, running:

lsinitramfs /boot/initrd.img-$(uname -r) | grep amdgpu

Should return multiple hits (where there previously should be none).

Then reboot and cross finger things work.

You can undo this change by removing the amdgpu line from /etc/initramfs-tools/modules and running update-initramfs again

Try another firmware package

The package linux-firmware provides all the firmware blobs for your HW, including AMD's GPUs.

An older version may fix your problems, or a newer one.

You can also try the latest ones from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

You can rollback the latest ones from git via sudo apt install --reinstall linux-firmware (since they are all files that go into /lib/firmware)

Check from a LiveUSB

If you stil are unable to fix it; create a LiveUSB and boot from there: You may be tempted to reinstall Ubuntu (a valid option).

If the LiveUSB shows the same problem, you may have to consider HW damage (your iGPU is malfunctioning, or the cable to your monitor is bad, the cable is loose, or your monitor is bad, or the connector/port is). If this is the case, try Windows as well.

Hellow2 avatar
sl flag
The thing is, I actually already downgraded my kernel and it still doesn't work. I installed like stated above some stuff from amd. Then the downgrading didn't solve anything. Trying to undo the messing around with amd stuff actually uninstalled the core of xserver, but it wasn't to bad to fix. Which step would you advice me to take?
Matias N Goldberg avatar
vg flag
Updated my reply with more things for you to try. Good luck!
Hellow2 avatar
sl flag
running `sudo modprobe amdgpu` perfectly worked. If thats the case for anyone stumbling onto this, and you use SystemD as init system, follow this Thread: https://unix.stackexchange.com/questions/71064/systemd-automate-modprobe-command-at-boot-time?newreg=1b1d47c18fae4fc6ac9b24e127983dd3
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.