Tips on getting the amdgpu driver to work

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
SHenion
Level 1
Level 1
Posts: 4
Joined: Thu Apr 06, 2023 6:02 pm

Tips on getting the amdgpu driver to work

Post by SHenion »

Have had to help a few on linuxmint-help irc channel on this.

Myself, I have spent a long time getting it to work. Tried many kernels, 4 different distros and all kinds of kernal parameters. The best I could get it it would get past a driver crash in about 1 of 10 boots.

Searched endlessly and only found a reference 5.18 kernel about a cache coherency fix. Tried 5.19 and 6.1 kernels and still the same.

I was looking through the bios on this small HP PC and under "Option ROM settings" was this entry:
"EFI boot except for video"

So even using UEFI, it initialized the video bios with legacy calls.

Changed to "All EFI" and it works flawlessly.

Have had others in irc and forums find bios options called "legacy" or "Compatibility" . Every one was different. Once turned off, it works.

So, the lesson is turn off any legacy or compatibility boot options in bios and use pure UEFI boot. Also easier with secure boot off.

Lastly have seen occurrences where the amdgpu driver is not enabled by the installer and it runs the radeon driver. This seems to apply to GPU's embedded in the CPU. I think it may be related to not enabling proprietary driver on install. The docs for amdgpu are confusing. Some talk card model numbers while the driver talks of chipset names (i.e Raven Ridge is chipset while CPU refers to it as Vega 11 Graphics).

To manually enable the driver:

From terminal:

Code: Select all

apt install  xserver-xorg-video-amdgpu libdrm-amdgpu1 libdrm-amdgpu1:i386  
They may already be installed.

View the file /etc/modprobe.d/blacklist.conf

After the first 3 comment lines (start with #, first line: # This file ...) there is supposed to be the following two lines:

Code: Select all

#radeon screws up amdgpu
blacklist radeon
If they are not there, add them after the first blank line. You will have to edit the file as root (sudo nano /etc/modprobe.d/blacklist.conf)

Save and reboot and you should be on the amdgpu driver. Check System Reports and look at the Graphics section it and for driver it should show Loaded: amdgpu

If it does not work, you will have to check the logs for amdgpu entries. Seems common issue is bios problems as shown at the beginning.

Fallback if this does not work:

Code: Select all

apt install xserver-xorg-video-radeon libdrm-radeon1 libdrm-radeon1:i386
This might uninstall the amdgpu files.
Then comment out the "blacklist radeon" line (add a # at the start of the line.

Hope this helps.
User avatar
SMG
Level 24
Level 24
Posts: 22399
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Tips on getting the amdgpu driver to work

Post by SMG »

SHenion wrote: Thu Apr 06, 2023 6:39 pm Have had to help a few on linuxmint-help irc channel on this.
Welcome to the forum, SHenion.

If you would provide information about you hardware, then it would help others because most of what you posted only applies to specific older technology.

UEFI computers work best when they are in UEFI mode. That means do not use Legacy Boot. That applies to more than just graphics drivers, but it definitely applies to amdgpu.
SHenion wrote: Thu Apr 06, 2023 6:39 pmAlso easier with secure boot off.
The amdgpu driver is open source and has no relevance to secure boot.
SHenion wrote: Thu Apr 06, 2023 6:39 pmLastly have seen occurrences where the amdgpu driver is not enabled by the installer and it runs the radeon driver. This seems to apply to GPU's embedded in the CPU.
No, it does not apply to GPUs embedded in the CPU. It applies to all technology which is GCN2 or older regardless of whether it is embedded in the CPU or it is a separate GPU.

GCN1 and GCN2 have experimental support for amdgpu. Those two generations can use either radeon or amdgpu. Anything older must use radeon and anything newer must use amdgpu.
SHenion wrote: Thu Apr 06, 2023 6:39 pmI think it may be related to not enabling proprietary driver on install.
It has nothing to do with the proprietary driver. There is no proprietary driver one can enable on install. The open-source AMD drivers load automatically from the kernel. Nothing needs to be installed.
SHenion wrote: Thu Apr 06, 2023 6:39 pm To manually enable the driver:

From terminal:

Code: Select all

apt install  xserver-xorg-video-amdgpu libdrm-amdgpu1 libdrm-amdgpu1:i386  
They may already be installed.
They are loaded from the kernel automatically and one uses kernel parameters to enable the amdgpu drivers and disable the radeon drivers.
SHenion wrote: Thu Apr 06, 2023 6:39 pmView the file /etc/modprobe.d/blacklist.conf

After the first 3 comment lines (start with #, first line: # This file ...) there is supposed to be the following two lines:

Code: Select all

#radeon screws up amdgpu
blacklist radeon
If they are not there, add them after the first blank line. You will have to edit the file as root (sudo nano /etc/modprobe.d/blacklist.conf)
None of that is necessary because the kernel parameters takes care of that.

If you need further help, please post your complete system information.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
SHenion
Level 1
Level 1
Posts: 4
Joined: Thu Apr 06, 2023 6:02 pm

Re: Tips on getting the amdgpu driver to work

Post by SHenion »

Well kernel parameters to enable is fine but usually the problems occur and you cant get into GRUB to temporarily change them and then won't boot to GUI or text. Have not seen the params to select one driver over the other documented.

On mine, it boots off M.2 NVME SSD. So grub loads and runs the kernel before you can hit shift or ESC (we are talking milliseconds here). Add to that, the HP bios treats almost any key as "oh you hit a key, here's a bios menu." Once in a while, hitting CTL-ALT-DEL at the right time reboots into grub.

I edited default/grub so it always gives a menu. Makes it much easier when trying the many options I tried with little effect (I had gotten it to boot maybe 20% of the time before the bios fix by setting nofbmode.)

My PC is an HP Elitedesk 705 G4 SFF, only a few years old.

YES, I think using EFI boot is needed to allow the bios to pass the hardware config info to the OS. The kernel source fixes seem to refer to cache coherency race conditions and conflicts, hence not the same on every boot.
User avatar
SMG
Level 24
Level 24
Posts: 22399
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Tips on getting the amdgpu driver to work

Post by SMG »

SHenion wrote: Thu Apr 06, 2023 7:35 pm Have not seen the params to select one driver over the other documented.
I've personally posted the information on this forum on many topics. The info is also listed in ArchLinux wiki as well as numerous other places.

To enable amdgpu:

Code: Select all

radeon.si_support=0 amdgpu.si_support=1 radeon.cik_support=0 amdgpu.cik_support=1
However, as I mentioned that only applies to GCN1 (Southern Islands) and GCN2 (Sea Islands) GPUs and APUs.
SHenion wrote: Thu Apr 06, 2023 7:35 pmMy PC is an HP Elitedesk 705 G4 SFF, only a few years old.
No idea what that means because there are multiple hardware options available for that computer. If you open the System Reports app and click the System Information tab on the left, your computer's information should come up in the right pane. Then click the Copy button in the lower right and paste the results into a reply window here so we can see how Linux Mint views your hardware.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
SHenion
Level 1
Level 1
Posts: 4
Joined: Thu Apr 06, 2023 6:02 pm

Re: Tips on getting the amdgpu driver to work

Post by SHenion »

Why you want hardware info on something that works perfectly, here ya go:

Code: Select all

System:
  Kernel: 5.15.0-69-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Xfce 4.16.0
    tk: Gtk 3.24.23 wm: xfwm dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
Machine:
  Type: Desktop System: HP product: HP EliteDesk 705 G4 DM 35W (TAA) v: DBXEnabled
    serial: <superuser required> Chassis: type: 3 serial: <superuser required>
  Mobo: HP model: 83E9 v: KBC Version 07.D1.00 serial: <superuser required> UEFI: HP
    v: Q26 Ver. 02.17.00 date: 12/29/2021
CPU:
  Info: quad core model: AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics bits: 64 type: MT MCP
    arch: Zen rev: 0 cache: L1: 384 KiB L2: 2 MiB L3: 4 MiB
  Speed (MHz): avg: 2861 high: 3699 min/max: 1600/3200 boost: enabled cores: 1: 3081 2: 2906
    3: 2607 4: 2640 5: 2658 6: 1987 7: 3699 8: 3315 bogomips: 51101
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD Raven Ridge [Radeon Vega Series / Radeon Mobile Series] vendor: Hewlett-Packard
    driver: amdgpu v: kernel pcie: speed: 8 GT/s lanes: 16 ports: active: DP-1,DP-2 empty: DP-3,DP-4
    bus-ID: 0a:00.0 chip-ID: 1002:15dd
  Display: x11 server: X.Org v: 1.21.1.3 compositor: xfwm v: 4.16.1 driver: X:
    loaded: amdgpu,ati unloaded: fbdev,modesetting,vesa gpu: amdgpu display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 3520x1080 s-dpi: 96
  Monitor-1: DisplayPort-0 mapped: DP-1 pos: bottom-l model: AOC 2070W res: 1600x900 dpi: 94
    diag: 494mm (19.4")
  Monitor-2: DisplayPort-1 mapped: DP-2 pos: primary,top-right model: LG (GoldStar) IPS FULLHD
    res: 1920x1080 dpi: 102 diag: 551mm (21.7")
  OpenGL: renderer: AMD Radeon Vega 11 Graphics (raven LLVM 15.0.6 DRM 3.42 5.15.0-69-generic)
    v: 4.6 Mesa 22.2.5 direct render: Yes
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Hewlett-Packard driver: snd_hda_intel
    v: kernel pcie: speed: 8 GT/s lanes: 16 bus-ID: 0a:00.1 chip-ID: 1002:15de
  Device-2: AMD Family 17h HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    pcie: speed: 8 GT/s lanes: 16 bus-ID: 0a:00.6 chip-ID: 1022:15e3
  Sound Server-1: ALSA v: k5.15.0-69-generic running: yes
  Sound Server-2: PulseAudio v: 15.99.1 running: yes
  Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard
    driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3300 bus-ID: 05:00.0
    chip-ID: 10ec:8168
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 476.95 GiB used: 169.36 GiB (35.5%)
  ID-1: /dev/nvme0n1 vendor: Toshiba model: N/A size: 238.47 GiB speed: 15.8 Gb/s lanes: 2
    serial: <filter> temp: 44.9 C
  ID-2: /dev/sda vendor: Crucial model: CT256MX100SSD1 size: 238.47 GiB speed: 6.0 Gb/s
    serial: <filter>
Partition:
  ID-1: / size: 233.18 GiB used: 70.88 GiB (30.4%) fs: ext4 dev: /dev/nvme0n1p2
  ID-2: /boot/efi size: 511 MiB used: 6.2 MiB (1.2%) fs: vfat dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) priority: -2 file: /swapfile
USB:
  Hub-1: 1-0:1 info: Full speed or root hub ports: 1 rev: 2.0 speed: 480 Mb/s chip-ID: 1d6b:0002
  Hub-2: 2-0:1 info: Hi-speed hub with single TT ports: 10 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002
  Device-1: 2-4:2 info: Areson Corp 2.4G Receiver type: Keyboard,Mouse
    driver: hid-generic,usbhid rev: 1.1 speed: 12 Mb/s chip-ID: 25a7:fa23
  Hub-3: 3-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
  Hub-4: 4-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002
  Hub-5: 5-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
  Hub-6: 6-0:1 info: Hi-speed hub with single TT ports: 1 rev: 2.0 speed: 480 Mb/s
    chip-ID: 1d6b:0002
  Hub-7: 7-0:1 info: Super-speed hub ports: 1 rev: 3.1 speed: 10 Gb/s chip-ID: 1d6b:0003
Sensors:
  System Temperatures: cpu: 30.0 C mobo: N/A gpu: amdgpu temp: 47.0 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: apt: 2879
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https: //brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
    1: deb http: //packages.linuxmint.com vera main upstream import backport
    2: deb http: //archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
    3: deb http: //archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
    4: deb http: //archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
    5: deb http: //security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
Info:
  Processes: 293 Uptime: 10h 49m Memory: 15.07 GiB used: 2.94 GiB (19.5%) Init: systemd v: 249
  runlevel: 5 Compilers: gcc: 11.3.0 alt: 11/12 Client: Unknown python3.10 client inxi: 3.3.13
User avatar
SMG
Level 24
Level 24
Posts: 22399
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Tips on getting the amdgpu driver to work

Post by SMG »

SHenion wrote: Thu Apr 06, 2023 7:57 pm Why you want hardware info on something that works perfectly, here ya go:
Ryzens all use amdgpu. They can not use the radeon driver so there is no need to blacklist radeon. There is also no need to try and force install amdgpu by loading anything special.

However, many of the Gs (yours is 2400GE) have been problematic because they strike me as being tuned only for Windows. Or at least that is my assumption as to why they don't work as smoothly with Linux Mint. I usually check those on a case-by-case basis whenever anyone posts with issues so I don't have any general recommendations off the top of my head.

Generally speaking, I seem to recall Picasso and Raven Ridge on laptops definitely preferring a UEFI install with regards to the amdgpu driver loading consistently. In fact, I've seen the messages in the log recommending something along those lines. (I can't recall the specific message right now.) SFF are often more similar to laptops than desktops with respect to how they handle a Linux Mint install.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
SHenion
Level 1
Level 1
Posts: 4
Joined: Thu Apr 06, 2023 6:02 pm

Re: Tips on getting the amdgpu driver to work

Post by SHenion »

Don't know if "tuned for windows" but seems that the linux driver can't decode how the bios set up the hardware well unless it is EFI.

It works flawlessly here. Note, the driver core dumped much more often with two monitors and seemed most reliable on the first video port that happened to be VGA (I later swapped an HDMI module for the VGA one and was same.)

This bios is brain dead. No config options for anything fancy. Had seen posts about some bios options getting Ryzen GPU's to work (again something about some AMD cache protocol) but no options here. One good thing about this HP bios is it will download bios updates to RAM off internet, verify checksum and install. I'm wondering if the update turned on that legacy video option, I sure didn't.

As for the older chipsets, the blacklist worked but had some issues with two monitors. Seemed to swap ports rather than enable two.

I forgot to mention, LM 20, MX Linux, Debian and LM 21 all worked fine after install. Once it updated the kernel, I had the boot crashes. Seems the early 5.4 and 5.10 kernels worked. I don't see it as bugs in the newer kernels but rather they added support for more features specific to the GPU and exposed more CPU/GPU conflicts.

Oh, on Debian, i had to manually add amdgpu support (add to X config file). Archwiki mentioned blacklisting radeon. Doing that did cut the crashes down for a while until later kernels.

I started this thread to give some directions to look, thanks for filling out the info on older GPU's. Rather than repeating all the steps on irc, I can point them here.
User avatar
zcot
Level 8
Level 8
Posts: 2373
Joined: Wed Oct 19, 2016 6:08 pm

Re: Tips on getting the amdgpu driver to work

Post by zcot »

This is an example of a strictly legacy setup. That's Mint 20.x Xfce.

Code: Select all

$ inxi -CGxxx
CPU:       Topology: Quad Core model: AMD A10-5800K APU with Radeon HD Graphics bits: 64 type: MCP arch: Piledriver rev: 1 
           L2 cache: 2048 KiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 30344 
           Speed: 1397 MHz min/max: 1400/3800 MHz boost: enabled Core speeds (MHz): 1: 1397 2: 1397 3: 1397 4: 1401 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Cape Verde XT [Radeon HD 7770/8760 / R7 250X] vendor: ASUSTeK 
           driver: radeon v: kernel bus ID: 01:00.0 chip ID: 1002:683d 
           Display: x11 server: X.Org 1.20.13 driver: ati,radeon unloaded: fbdev,modesetting,vesa resolution: 1600x900~60Hz 
           OpenGL: renderer: AMD VERDE (DRM 2.50.0 5.15.0-43-generic LLVM 12.0.0) v: 4.5 Mesa 21.2.6 direct render: Yes
That's a desktop. Radeon HD 7770, no APU functionality, onboard gpu disabled in BIOS.

You will see the default package installations here, I did nothing:

Code: Select all

$ apt search xserver-xorg-video | grep ^i
i   xserver-xorg-video-all                                  - X.Org X server -- output driver metapackage                       
i   xserver-xorg-video-amdgpu                               - X.Org X server -- AMDGPU display driver                           
i   xserver-xorg-video-ati                                  - X.Org X server -- AMD/ATI display driver wrapper                  
i   xserver-xorg-video-fbdev                                - X.Org X server -- fbdev display driver                            
i   xserver-xorg-video-intel                                - X.Org X server -- Intel i8xx, i9xx display driver                 
i   xserver-xorg-video-nouveau                              - X.Org X server -- Nouveau display driver                          
i   xserver-xorg-video-qxl                                  - X.Org X server -- QXL display driver                              
i   xserver-xorg-video-radeon                               - X.Org X server -- AMD/ATI Radeon display driver                   
i   xserver-xorg-video-vesa                                 - X.Org X server -- VESA display driver                             
i   xserver-xorg-video-vmware                               - X.Org X server -- VMware display driver
I have a southern island chip there, and specifically I am forcing radeon instead of the default amdgpu. A bare default install will supply amdgpu, and everything works correctly, no real issues.

However I have tested both, on this particular setup, based on something I saw from Arch wiki probably, and I so I benchmarked both drivers, and find the radeon wins-out, just a little bit, on this particular setup.

So, /etc/default/grub:

Code: Select all

radeon.si_support=1 amdgpu.si_support=0
Also, if you toy with modules:

Code: Select all

sudo update-initramfs -u -k all
Post Reply

Return to “Graphics Cards & Monitors”