How to install amdgpu driver for AMD Radeon RX400 Series

This guide is tested under AMD Radeon RX 470 and AMD Radeon RX 480 GPUs.

In order to install openSUSE Leap 42.2 you need to start the installer using ‘nomodeset’ in grub menu, otherwise you will end up with a blank screen.
After the installation is finished, you need to edit grub restore your changes. Basically, remove the ‘nomodeset’ because you will end up in a *never-ending loop of flickering *and changing tty is not going to work :confused:

Once you finally managed to boot into your openSUSE Leap 42.2 you will notice that Desktop cannot be loaded. Here’s what you have to do:

Remove the nomodeset permanetly
In order to avoid editing the grub everytime you boot, it’s good idea to remove the ‘nomodeset’ from your kernel-line once and for all.

Edit:

/etc/default/grub

Find the line:

GRUB_CMDLINE_LINUX_DEFAULT="nomodeset resume=/dev/vda1 splash=silent quiet crashkernel=184M-:92M  showopts"

**remove **the **‘nomodeset’ **and save the file. Last but not least, refresh the grub:

# grub2-mkconfig -o /boot/grub2/grub.cfg

Apply the latest patches

Update your system using zypper as follows:

# zypper patches

and the reboot:

# systemctl reboot

Install the latest stable kernel
OpenSUSE Leap 42.2 comes with Kernel 4.4 which doesn’t have the required firmware for the new Polaris GPUs. Thus you need to install a new one:

zypper ar -f http://download.opensuse.org/repositories/Kernel:/stable/standard/Kernel:stable.repo
zypper ref # accept
zypper dup -- from Kernel_stable # go with the Solution (1)
systemctl reboot

That’s it, after that it should work.

# dmesg | grep amdgpu

    4.089304] [drm] amdgpu kernel modesetting enabled.
    4.094350] fb: switching to amdgpudrmfb from VESA VGA
    4.116042] amdgpu 0000:01:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
    4.120508] amdgpu 0000:01:00.0: VRAM: 8192M 0x0000000000000000 - 0x00000001FFFFFFFF (8192M used)
    4.120509] amdgpu 0000:01:00.0: GTT: 16039M 0x0000000200000000 - 0x00000005EA79DFFF
    4.120521] [drm] amdgpu: 8192M of VRAM memory ready
    4.120522] [drm] amdgpu: 16039M of GTT memory ready.
    4.121902] amdgpu 0000:01:00.0: amdgpu: using MSI.
    4.121956] [drm] amdgpu: irq initialized.
    4.122109] amdgpu: powerplay initialized
    4.122601] amdgpu 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000200000008, cpu addr 0xffff96e7170a6008
    4.122658] amdgpu 0000:01:00.0: fence driver on ring 1 use gpu addr 0x0000000200000018, cpu addr 0xffff96e7170a6018
    4.122695] amdgpu 0000:01:00.0: fence driver on ring 2 use gpu addr 0x0000000200000028, cpu addr 0xffff96e7170a6028
    4.122738] amdgpu 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000200000038, cpu addr 0xffff96e7170a6038
    4.122778] amdgpu 0000:01:00.0: fence driver on ring 4 use gpu addr 0x0000000200000048, cpu addr 0xffff96e7170a6048
    4.122805] amdgpu 0000:01:00.0: fence driver on ring 5 use gpu addr 0x0000000200000058, cpu addr 0xffff96e7170a6058
    4.122845] amdgpu 0000:01:00.0: fence driver on ring 6 use gpu addr 0x0000000200000068, cpu addr 0xffff96e7170a6068
    4.122881] amdgpu 0000:01:00.0: fence driver on ring 7 use gpu addr 0x0000000200000078, cpu addr 0xffff96e7170a6078
    4.122921] amdgpu 0000:01:00.0: fence driver on ring 8 use gpu addr 0x0000000200000088, cpu addr 0xffff96e7170a6088
    4.122990] amdgpu 0000:01:00.0: fence driver on ring 9 use gpu addr 0x0000000200000098, cpu addr 0xffff96e7170a6098
    4.123026] amdgpu 0000:01:00.0: fence driver on ring 10 use gpu addr 0x00000002000000a8, cpu addr 0xffff96e7170a60a8
    4.123355] amdgpu 0000:01:00.0: fence driver on ring 11 use gpu addr 0x0000000001ff0420, cpu addr 0xffffb3dfc405a420
    4.123467] amdgpu 0000:01:00.0: fence driver on ring 12 use gpu addr 0x00000002000000c8, cpu addr 0xffff96e7170a60c8
    4.123508] amdgpu 0000:01:00.0: fence driver on ring 13 use gpu addr 0x00000002000000d8, cpu addr 0xffff96e7170a60d8
    4.789820] fbcon: amdgpudrmfb (fb0) is primary device
    5.722695] amdgpu 0000:01:00.0: fb0: amdgpudrmfb frame buffer device
    5.744223] [drm] Initialized amdgpu 3.8.0 20150101 for 0000:01:00.0 on minor 1
# lsmod | grep drm
drm_kms_helper        159744  2 amdgpu,i915
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
drm                   360448  7 amdgpu,i915,ttm,drm_kms_helper

01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Polaris10] [1002:67df] (rev c7)
        Subsystem: Dell Device [1028:1005]
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu
# /sbin/modinfo amdgpu | grep 67DF
alias:          pci:v00001002d000067DFsv*sd*bc*sc*i*
  • Note that ‘67DF’ is the ‘Device ID’ of my GPU.

Fix your Xorg
As you can see Xorg is not picking up the ‘amdgpu’ driver

# grep amdgpu /var/log/Xorg.0.log
-> Returns nothing

But it picks ’

radeon

’ and ’

fglrx

’ as a autoconfigured driver.
We need to blacklist those, but still we need to inform Xorg
to load ‘amdgpu’.

How to load ‘amdgpu’ driver:
Create this file with the following content:

vi /etc/X11/xorg_pci_ids/amdgpu.ids

  # AMDGPU PCI Ids. To enable the amdgpu driver for your device
  # find the PCI ID in the list and uncomment the entry (remove the '#').
  # If your device is not enabled on the list and you find it to be working,
  # please let us know in:
  # http://bugzilla.opensuse.org/show_bug.cgi?id=972126
  **100267DF**

Then save and exit the file.

Note that the ‘100267DF’ is the PCI ID of my GPU (Radeon RX 480). You can find yours by issuing the command:


# lspci -nnk | grep 0300
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Polaris10] [1002:[b]67df] (rev c7)

Then reboot:

# systemctl reboot

and then you will see:

 # grep amdgpu /var/log/Xorg.0.log
      16.042] (II) Matched amdgpu from file name amdgpu.ids
      16.042] (II) Matched amdgpu from file name amdgpu.ids
      16.042] (==) Matched amdgpu as autoconfigured driver 0
      16.042] (==) Matched amdgpu as autoconfigured driver 5
      16.042] (II) LoadModule: "amdgpu"
      16.042] (II) Loading /usr/lib64/xorg/modules/drivers/amdgpu_drv.so
      16.044] (II) Module amdgpu: vendor="X.Org Foundation"

Blacklist radeon and fglrx
This fails and it looks like a bug:

The Xorg loads the amdgpu driver but it still tried to load the wrong things, like radeon and fglrx:

d243:~ # grep fglrx /var/log/Xorg.0.log
    16.042] (==) Matched fglrx as autoconfigured driver 1
    16.042] (==) Matched fglrx as autoconfigured driver 6
    16.044] (II) LoadModule: "fglrx"
    16.045] (WW) Warning, couldn't open module fglrx
    16.045] (II) UnloadModule: "fglrx"
    16.045] (II) Unloading fglrx
    16.045] (EE) Failed to load module "fglrx" (module does not exist, 0)
d243:~ # grep radeon /var/log/Xorg.0.log
    16.045] (II) LoadModule: "radeon"
    16.045] (II) Loading /usr/lib64/xorg/modules/drivers/radeon_drv.so
    16.046] (II) Module radeon: vendor="X.Org Foundation"
    16.490] (II) UnloadModule: "radeon"
    16.490] (II) Unloading radeon

So, to blacklist them:

vi /etc/modprobe.d/50-blacklist.conf
blacklist radeon
blacklist fglrx

Take these changes into effect for the next boot:

mkinitrd
systemctl reboot

unfortunatelly the blacklisting is not working :confused:

A workaround is the following:

vi /etc/X11/xorg.conf.d/50-screen.conf
Section "Device"
   Identifier "AMD Radeon RX 400"
   Driver "amdgpu"
   Option "DRI" "3"
   Option "TearFree" "true"
EndSection
vi /etc/X11/xorg.conf.d/50-screen.conf
Section "Screen"
  Identifier "Default Screen"
  Device "AMD Radeon RX 400"
  Monitor "Default Monitor"
EndSection
vi /etc/X11/xorg.conf.d/50-monitor.conf
Section "Monitor"
  Identifier "Default Monitor"
EndSection

Doing it that why instead of creating the

/etc/X11/xorg_pci_ids/amdgpu.ids

file, the blacklisting works.

The open source ‘amdgpu’ driver seems to perform quite well. Here’s my score in Unigine Heaven benchmark:

  • extreme: Score 1928, Average 51, Minimum 8.5, Max: 111.4
  • basic: Score 4190, Average 166, Minimum 13.5, Max: 286

PS: The Proprietary amdgpu-pro driver is not available for the opensuse for the moment. If you try to apply to one for SLED, you are going to end-up in kernel panic, so do not try this for now.

I tried this before on a 4.8 kernel, and while the system booted and the driver loaded, I had screen tearing that didn’t go away even with tearfree enabled in the xorg conf file. Everything was fine on Tumbleweed so I assuming it was the newer Mesa packages. Have you seen this issue and were you able to get past it in leap?

Hi there, it’s working steps for a RX 460 card?

I have installed 4.9 compiled kernel, and have this output error with dmesg

user@linux-khwe:~> dmesg | grep amdgpu    2.618961] [drm] **amdgpu**** kernel modesetting enabled.
    2.623285] **amdgpu**** 0000:01:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0xffff
    2.624079] **amdgpu****** 0000:01:00.0: Direct firmware load for **amdgpu******/polaris11_mc.bin failed with error -2
    2.624080] mc: Failed to load firmware "**amdgpu******/polaris11_mc.bin"
    2.624181] [drm:gmc_v8_0_sw_init [[b]amdgpu****]] *ERROR* Failed to load mc firmware!
    2.624262] [drm:[b]amdgpu****_device_init **amdgpu******]] *ERROR* sw_init of IP block <gmc_v8_0> failed -2
    2.624329] **amdgpu****** 0000:01:00.0: **amdgpu******_init failed
    2.624396] **amdgpu****** 0000:01:00.0: Fatal error during GPU init
    2.624462] [drm] **amdgpu******: finishing device. ****************************    2.625288] **amdgpu**************************: probe of 0000:01:00.0 failed with error -2****

How i can solve it?

Thanks

Hi I think there are a few typos here?

zypper dup -- from Kernel_stable # go with the Solution (1)

should be:

zypper dup --from Kernel_stable # go with the Solution (1)

and


vi /etc/X11/xorg.conf.d/50-screen.conf
Section "Device"
   Identifier "AMD Radeon RX 400"
   Driver "amdgpu"
   Option "DRI" "3"
   Option "TearFree" "true"
EndSection

should be:

vi /etc/X11/xorg.conf.d/50-device.conf
Section "Device"
   Identifier "AMD Radeon RX 400"
   Driver "amdgpu"
   Option "DRI" "3"
   Option "TearFree" "true"
EndSection

Thanks
For this.

For a unknown reason Xorg it’s unloading amdgpu

    14.283] (II) **LoadModule**: "glx"
    14.308] (II) **LoadModule**: "amdgpu"
    14.314] (II) **LoadModule**: "fglrx"
    14.314] (II) **LoadModule**: "ati"
    14.315] (II) **LoadModule**: "radeon"
    14.320] (II) **LoadModule**: "modesetting"
    14.321] (II) **LoadModule**: "fbdev"
    14.322] (II) **LoadModule**: "vesa"
    14.362] (II) **LoadModule**: "fbdevhw"
    14.363] (II) **LoadModule**: "glamoregl"
    14.851] (II) **LoadModule**: "fb"
    14.852] (II) **LoadModule**: "shadow"
    15.040] (II) **LoadModule**: "libinput"
**linux-coolbay:~ #** cat /var/log/Xorg.0.log | grep UnloadModule     
    14.314] (II) **UnloadModule**: "fglrx"
    14.853] (II) **UnloadModule**: "amdgpu"
    14.853] (II) **UnloadModule**: "radeon"
    14.853] (II) **UnloadModule**: "fbdev"
    14.853] (II) **UnloadModule**: "vesa"


i create also 10-amdgpu.conf file in /etc/X11/xorg.conf.d with:

Section "OutputClass"
        Identifier "AMDgpu"
        MatchDriver "amdgpu"
        Driver "amdgpu"
EndSection

Prevents some startup errors.

How i can get amdgpu working? What driver is in use?

I have blacklisted radeon, fglrx and ati

Some help please! i’m near solution!

Ok, i solve it.

Updated Xorg from repo, all goes smooth.

Steps:

zypper ar http://download.opensuse.org/repositories/X11:/XOrg/openSUSE_Leap_42.2/ "X11:Xorg"
zypper dup --repo X11:Xorg

I am trying to get an RX480 Ellesmere card working, so I’ll post here, even though this should probably be bumped to a different forum. Any time I upgrade the kernel outside of the OS installed repositories, I lose ext4 support, which leaves me with an un-bootable system. If I run “mkinitrd -v” I’ll see errors for many missing modules, including ext4. If I run “modinfo ext4” I get a missing module error. If I check the path, there is no ext4 folder under /fs in the kernel path. I have tried kernel-default and kernel-vanilla with the same results. kernel-source has the modules, but I have never tried to build a kernel from source. Any idea what might be happening?